I have a Google Cloud Function that processes messages from a queue. When I put all the modules in the root of the function (where main.py and requirements.txt live) everything works fine. If I move the modules into a local package as shown here in the docs., then when I deploy the function by uploading the Zip file using the cloud console I get an error saying Build failed: Build error details not available with no other info.
.
├── main.py
├── module_one.py
├── module_two.py
└── requirements.txt
at the root of the archive I upload works just fine.
.
├── main.py
├── requirements.txt
├── local_package_one/
│ ├── __init__.py
│ └── module_one.py
└── local_package_two/
├── __init__.py
└── module_two.py
earns me Build failed: Build error details not available. In the second configuration, I update all the affected import statements. I initially suspected the requirements.txt file since it isn't shown in the example, but here they state that it should work just fine. The example there also shows a top-level folder named after the function, so I tried putting that at the root of the archive with everything inside of it and got the same results.
I changed the imports from
from module_one import MyClass
to
from local_package_one.module_one import MyClass