awslabs / aws-crt-python

Python bindings for the AWS Common Runtime
Apache License 2.0
87 stars 43 forks source link

Python 3.6 RuntimeError: 44 (AWS_ERROR_FILE_INVALID_PATH): Invalid file path.. #330

Closed abwiggins closed 2 years ago

abwiggins commented 2 years ago

Hi,

I've been debugging this issue for a while now and can't seem to pin point the cause. I keep getting this error when trying to "connect" using the ipc client.

I am running:

I am able to connect using the certificates on my device in other ways, so I don't believe it's a credentials issue.

Here is my output:

2022-02-07T20:22:19.701Z [WARN] (Copier) service.init: stderr. dt=2022-02-07_15:22:19 lvl=ERROR msg="44 (AWS_ERROR_FILE_INVALID_PATH): Invalid file path." line=install_servicepy:43. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}
2022-02-07T20:22:19.701Z [WARN] (Copier) service.init: stderr. Traceback (most recent call last):. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}
2022-02-07T20:22:19.701Z [WARN] (Copier) service.init: stderr. File "/greengrass/v2/packages/artifacts/service.init/1.0.97/install_service.py", line 41, in <module>. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}
2022-02-07T20:22:19.701Z [WARN] (Copier) service.init: stderr. ipc_client = awsiot.greengrasscoreipc.connect(). {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}
2022-02-07T20:22:19.701Z [WARN] (Copier) service.init: stderr. File "/root/.local/lib/python3.8/site-packages/awsiot/greengrasscoreipc/__init__.py", line 65, in connect. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}
2022-02-07T20:22:19.701Z [WARN] (Copier) service.init: stderr. connect_future = connection.connect(lifecycle_handler). {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}
2022-02-07T20:22:19.701Z [WARN] (Copier) service.init: stderr. File "/root/.local/lib/python3.8/site-packages/awsiot/eventstreamrpc.py", line 449, in connect. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}
2022-02-07T20:22:19.702Z [WARN] (Copier) service.init: stderr. raise e. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}
2022-02-07T20:22:19.702Z [WARN] (Copier) service.init: stderr. File "/root/.local/lib/python3.8/site-packages/awsiot/eventstreamrpc.py", line 437, in connect. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=**service.init**, currentState=NEW}
2022-02-07T20:22:19.702Z [WARN] (Copier) service.init: stderr. protocol.ClientConnection.connect(. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}
2022-02-07T20:22:19.702Z [WARN] (Copier) service.init: stderr. File "/root/.local/lib/python3.8/site-packages/awscrt/eventstream/rpc.py", line 301, in connect. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}
2022-02-07T20:22:19.702Z [WARN] (Copier) service.init: stderr. _awscrt.event_stream_rpc_client_connection_connect(. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}
2022-02-07T20:22:19.702Z [WARN] (Copier) service.init: stderr. RuntimeError: 44 (AWS_ERROR_FILE_INVALID_PATH): Invalid file path.. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}

The item that I'm not understanding is here -- service.init: stderr. RuntimeError: 44 (AWS_ERROR_FILE_INVALID_PATH): Invalid file path.. What file path is invalid?

I can confirm the NUCLEUS_SOCKET environmental variable is set:

2022-02-07T20:46:01.821Z [INFO] (Copier) service.init: stdout. NUCLEUS_SOCKET_PATH: /greengrass/v2/ipc.socket. {scriptName=services.service.init.lifecycle.Bootstrap.Script, serviceName=service.init, currentState=NEW}

Also, here is my greengrass deployment with its necessary dependencies:

I'm wondering if it is an awsiotsdk & awscrt version issue? This component installation just recently started failing to install.

This is the best output I could get - any debugging tips would be very helpful.

Thanks!

abwiggins commented 2 years ago

For anyone else barking up this tree --> AWS_ERROR_FILE_INVALID_PATH.

It's probably due to a poorly configured provisioning setup.

I found that my config.yaml file when installing greengrass was incorrect... a field was not meeting the syntax rules for device attributes and causing it to fail