- Le plus récent
- Le plus de votes
- La plupart des commentaires
Hi,
This will be due to Python buffering the output. Please see: https://docs.aws.amazon.com/greengrass/v2/developerguide/troubleshooting.html#python-component-no-log-output.
Cheers,
Michael Dombrowski
I suppose not, as the first LoC is print("up and running", flush=True). Is there anywhere else that stdout would be redirected to?
Edited by: kdixson on Apr 26, 2021 6:56 PM
The output will be in the component's logfile, located at <root>/logs/<component name>.log.
Are you certain that your lambda is actually being run? If it is running is it in container mode? If yes, you may need to increase the memory limit which is only 16MB by default and will often cause the lambda to be killed.
Please provide the code, or a minimal example which replicates the issue.
Cheers,
Michael Dombrowski
Here is my code: https://gist.github.com/Lard4/28c86ae0670ef21da911b4520444c7f0
It's curious because if you comment out line 42, the topic will publish successfully, but nothing will get logged. In fact, the log file doesn't even exist in /greengrass/v2/logs.
If you leave 42 uncommented, something happens (I suppose some sort of exception gets thrown) and the lambda doesn't report a status and after 60 seconds, greengrass kills and retries the lambda. No print statements or exceptions get logged in the lambda's log. However, you can see the exception where greengrass gets no timely status report and kills the lambda. (see the greengrass.log here: https://gist.github.com/Lard4/8a7842c1f138243eacfc789033bd2e4c)
Please remove the file and stream options which are referring to sys.stdout. Just use a normal print or log statement.
Are you running in container mode? As I mentioned before, it is possible that it is running out of memory and being killed.
It is not possible for the component's log file to not exist; the log file is created just as soon as the component is deployed to the system.
Please provide the contents of <root>/configs/effectiveConfig.yaml file.
Cheers,
Michael Dombrowski
I've tried it both in a container and not in a container. Both don't log anything. Here is my effectiveConfig.yaml: https://gist.github.com/Lard4/d3d7ef24fdce17dcd3c63686f3b86908
Note that the lambda under investigation is called DataIngestionLambda
Edited by: kdixson on Apr 27, 2021 11:06 AM
I just removed the sys.stdout from the print statements, and no log file is being created.
Please attach the entirety of the logs directory to this forum post so that I can review all the logs.
Cheers,
Michael Dombrowski
I ended up uninstalling greengrass and reinstalling, this fixed my issues
Contenus pertinents
- demandé il y a un an
- demandé il y a 6 mois
- demandé il y a 7 mois
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a un an