无法使用 aws eclipse 工具包调试 aws-sam 项目
Unable to debug aws-sam project using aws eclipse toolkit
我正在尝试使用步骤 here 调试 aws-sam 应用程序。但是,我无法让 eclipse 工具包进入调试模式。 运行 在调试模式下的第一步似乎有效,即项目构建并成功运行测试,如下面的输出所示
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building A sample Java Spring web service created with AWS CodeStar. 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ HelloWorld ---
...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.aws.codestar.projecttemplates.handler.HelloWorldHandlerTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.036 s - in com.aws.codestar.projecttemplates.handler.HelloWorldHandlerTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ HelloWorld ---
[INFO] Building jar: C:\Users\MyUser\git\AwsJavaSpring\target\HelloWorld-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.085 s
[INFO] Finished at: 2018-07-30T11:09:32-04:00
[INFO] Final Memory: 30M/423M
[INFO] ------------------------------------------------------------------------
此操作失败后的下一步,我无法解释它打印出的错误消息。
[AWS Toolkit] Running command: C:\Users\MyUser\AppData\Roaming\Python\Scripts\sam.exe local invoke GetHelloWorld --debug-port 5858 --event C:\Users\MyUser\git\AwsJavaSpring\sample-s3-event --profile personal --template C:\Users\MyUser\git\AwsJavaSpring\.serverless.template
[AWS Toolkit] Waiting for SAM Local to attach the port 5858
Traceback (most recent call last):
File "C:\Users\MyUser\AppData\Roaming\Python\Scripts\sam-script.py", line 11, in <module>
load_entry_point('aws-sam-cli==0.4.0', 'console_scripts', 'sam')()
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\samcli\commands\local\invoke\cli.py", line 44, in cli
docker_network, log_file, skip_pull_image, profile) # pragma: no cover
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\samcli\commands\local\invoke\cli.py", line 70, in do_cli
aws_profile=profile) as context:
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\samcli\commands\local\cli_common\invoke_context.py", line 93, in __enter__
self._check_docker_connectivity()
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\samcli\commands\local\cli_common\invoke_context.py", line 287, in _check_docker_connectivity
docker_client.ping()
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\client.py", line 187, in ping
return self.api.ping(*args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\api\daemon.py", line 166, in ping
return self._result(self._get(self._url('/_ping'))) == 'OK'
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\utils\decorators.py", line 46, in inner
return f(self, *args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\api\client.py", line 198, in _get
return self.get(url, **self._set_request_timeout(kwargs))
File "c:\python27\lib\site-packages\requests\sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "c:\python27\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "c:\python27\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "c:\python27\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "c:\python27\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "c:\python27\lib\site-packages\urllib3\connectionpool.py", line 357, in _make_request
conn.request(method, url, **httplib_request_kw)
File "c:\python27\lib\httplib.py", line 1042, in request
self._send_request(method, url, body, headers)
File "c:\python27\lib\httplib.py", line 1082, in _send_request
self.endheaders(body)
File "c:\python27\lib\httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "c:\python27\lib\httplib.py", line 882, in _send_output
self.send(msg)
File "c:\python27\lib\httplib.py", line 844, in send
self.connect()
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\transport\npipeconn.py", line 31, in connect
sock.connect(self.npipe_path)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\transport\npipesocket.py", line 22, in wrapped
return f(self, *args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\transport\npipesocket.py", line 50, in connect
win32pipe.WaitNamedPipe(address, self._timeout)
pywintypes.error: (2, 'WaitNamedPipe', 'The system cannot find the file specified.')
[AWS Toolkit] SAM Local invocation done.
我不确定 "specified file" 它无法找到什么,因为从上面的消息中看不清楚。我已经使用 docker run hello-world
命令测试了我的 docker 安装,它按预期工作。
在使基本示例起作用时,我在这里缺少什么?这是 Windows 上 docker 的问题还是 aws eclipse 工具包的问题?
事实证明,上述问题是由于 运行 以管理员身份使用 eclipse,即 right-click -> Run as Administrator
。
但是,现在我 运行 遇到了另一个描述的问题 here
我正在尝试使用步骤 here 调试 aws-sam 应用程序。但是,我无法让 eclipse 工具包进入调试模式。 运行 在调试模式下的第一步似乎有效,即项目构建并成功运行测试,如下面的输出所示
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building A sample Java Spring web service created with AWS CodeStar. 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ HelloWorld ---
...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.aws.codestar.projecttemplates.handler.HelloWorldHandlerTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.036 s - in com.aws.codestar.projecttemplates.handler.HelloWorldHandlerTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ HelloWorld ---
[INFO] Building jar: C:\Users\MyUser\git\AwsJavaSpring\target\HelloWorld-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.085 s
[INFO] Finished at: 2018-07-30T11:09:32-04:00
[INFO] Final Memory: 30M/423M
[INFO] ------------------------------------------------------------------------
此操作失败后的下一步,我无法解释它打印出的错误消息。
[AWS Toolkit] Running command: C:\Users\MyUser\AppData\Roaming\Python\Scripts\sam.exe local invoke GetHelloWorld --debug-port 5858 --event C:\Users\MyUser\git\AwsJavaSpring\sample-s3-event --profile personal --template C:\Users\MyUser\git\AwsJavaSpring\.serverless.template
[AWS Toolkit] Waiting for SAM Local to attach the port 5858
Traceback (most recent call last):
File "C:\Users\MyUser\AppData\Roaming\Python\Scripts\sam-script.py", line 11, in <module>
load_entry_point('aws-sam-cli==0.4.0', 'console_scripts', 'sam')()
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\samcli\commands\local\invoke\cli.py", line 44, in cli
docker_network, log_file, skip_pull_image, profile) # pragma: no cover
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\samcli\commands\local\invoke\cli.py", line 70, in do_cli
aws_profile=profile) as context:
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\samcli\commands\local\cli_common\invoke_context.py", line 93, in __enter__
self._check_docker_connectivity()
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\samcli\commands\local\cli_common\invoke_context.py", line 287, in _check_docker_connectivity
docker_client.ping()
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\client.py", line 187, in ping
return self.api.ping(*args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\api\daemon.py", line 166, in ping
return self._result(self._get(self._url('/_ping'))) == 'OK'
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\utils\decorators.py", line 46, in inner
return f(self, *args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\api\client.py", line 198, in _get
return self.get(url, **self._set_request_timeout(kwargs))
File "c:\python27\lib\site-packages\requests\sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "c:\python27\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "c:\python27\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "c:\python27\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "c:\python27\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "c:\python27\lib\site-packages\urllib3\connectionpool.py", line 357, in _make_request
conn.request(method, url, **httplib_request_kw)
File "c:\python27\lib\httplib.py", line 1042, in request
self._send_request(method, url, body, headers)
File "c:\python27\lib\httplib.py", line 1082, in _send_request
self.endheaders(body)
File "c:\python27\lib\httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "c:\python27\lib\httplib.py", line 882, in _send_output
self.send(msg)
File "c:\python27\lib\httplib.py", line 844, in send
self.connect()
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\transport\npipeconn.py", line 31, in connect
sock.connect(self.npipe_path)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\transport\npipesocket.py", line 22, in wrapped
return f(self, *args, **kwargs)
File "C:\Users\MyUser\AppData\Roaming\Python\Python27\site-packages\docker\transport\npipesocket.py", line 50, in connect
win32pipe.WaitNamedPipe(address, self._timeout)
pywintypes.error: (2, 'WaitNamedPipe', 'The system cannot find the file specified.')
[AWS Toolkit] SAM Local invocation done.
我不确定 "specified file" 它无法找到什么,因为从上面的消息中看不清楚。我已经使用 docker run hello-world
命令测试了我的 docker 安装,它按预期工作。
在使基本示例起作用时,我在这里缺少什么?这是 Windows 上 docker 的问题还是 aws eclipse 工具包的问题?
事实证明,上述问题是由于 运行 以管理员身份使用 eclipse,即 right-click -> Run as Administrator
。
但是,现在我 运行 遇到了另一个描述的问题 here