Hi. I have a python package packaged with poetry ...
# python
Hi. I have a python package packaged with poetry that I use to distribute some reusable pulumi code within my organization. There are component resources and dynamic resources in this package. Recently we have been encountering an issue where when this package is being used, imports for certain files are failing with:
Copy code
  "key": "message",
  "type": "string",
  "value": "rpc error: code = Unknown desc = Exception calling application: No module named 'postgres_database_user'"
This is from a trace that I'm creating. There is really no useful information I've been able to find in the traces. I'm viewing them with Jaeger. These were relative imports in the python module. I changed them to absolute imports to see if it would resolve the issue but it did not. This only occurs when the package is referenced from pulumi. I can lint and run python against these files which have the imports just fine. Python interpreter does not report any issue, flake8 does not report any issue. The imports are good and the module is structured properly. Other imports for other files (submodules) in the package work just fine, and they are structured the same way. Any help in figuring out how to debug and resolve this would be appreciated. This is the command I'm using to run and generate the trace:
Copy code
TF_LOG=TRACE pulumi up --skip-preview --tracing <http://localhost:9411/api/v1/spans> --logtostderr --logflow -v=10 2> out.txt
Preview works fine, this only occurs on pulumi up. stack trace error attached for reference.
I am facing a similar issue where I cannot figure out how to debug an exception thrown by Pulumi. The output similarly lacks any context to indicate what has actually gone wrong.
I think for my issue the real indicator of something isn't right with pulumi is that preview runs fine, which in this step it should exercise all the code involved and error out on any failing imports.
and the fact that the python interpreter is quite fine with these imports.