teamhephy / builder

MIT License
3 stars 12 forks source link

Pushing any app without env variables fails #47

Closed kingdonb closed 5 years ago

kingdonb commented 5 years ago

It was reported again today, on the Hephy slack by user @edison, that the teamhephy/example-python-django example fails when the basic instructions are followed.

Starting build... but first, coffee!
-----> Restoring cache...
      No cache file found. If this is the first deploy, it will be created now.
cp: cannot stat ‘/tmp/env/*’: No such file or directory
remote: 2018/09/03 02:43:49 Error running git receive hook [Build pod exited with code 1, stopping build.]

This was confirmed after testing to be the same issue we've seen with any app that gets pushed and is lacking any set environment variables. The telling error message is:

cp: cannot stat ‘/tmp/env/*’: No such file or directory

What that error is telling you is that it tried to enumerate the environment variables from the config and it didn't find any trace of them. The workaround is deis config:set FOO=bar (eg. set any environment variable, even if your app doesn't need one. Doesn't matter what it is. Then push a release again and wait for builder to finish.)

Hopefully this helps until we can fix it properly and get it into a release! Users should not be required to set up dummy ENV variables just to make the builder happy. This must have been a regression in one of the final Deis Workflow releases; I don't remember this being a problem forever, and none of the example apps recommend adding such dummy environment variables.

edisonwang commented 5 years ago

Thanks for fill out this issue for me, just tried your solution and it works:

$deis config:set FOO=foo 
Creating config... done

=== cheery-crawfish Config
FOO      foo
$ git push deis master                                                                                                                                                        
Counting objects: 114, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (62/62), done.
Writing objects: 100% (114/114), 23.10 KiB | 23.10 MiB/s, done.
Total 114 (delta 39), reused 114 (delta 39)
remote: Resolving deltas: 100% (39/39), done.
Starting build... but first, coffee!
-----> Restoring cache...
       No cache file found. If this is the first deploy, it will be created now.
-----> Python app detected
-----> Installing python-3.5.2
-----> Installing pip
-----> Installing requirements with pip
       Collecting Django==1.10.6 (from -r /tmp/build/requirements.txt (line 1))
       Downloading https://files.pythonhosted.org/packages/b9/bb/723f78e6f6aea78590331eba4e42b8a09c33ce154204a942525a91101d0b/Django-1.10.6-py2.py3-none-any.whl (6.8MB)
       Collecting gunicorn==19.6.0 (from -r /tmp/build/requirements.txt (line 2))
       Downloading https://files.pythonhosted.org/packages/72/de/ec28a64885e0b390063379cca601b60b1f9e51367e0c76030ac8a5cddd5e/gunicorn-19.6.0-py2.py3-none-any.whl (114kB)
       Installing collected packages: Django, gunicorn
       Successfully installed Django-1.10.6 gunicorn-19.6.0

-----> $ python manage.py collectstatic --noinput
       61 static files copied to '/tmp/build/staticfiles'.

-----> Discovering process types
       Procfile declares types -> web
-----> Checking for changes inside the cache directory...
       Files inside cache folder changed, uploading new cache...
       Done: Uploaded cache (61M)
-----> Compiled slug size is 58M
Build complete.
Launching App...
...
...
...
...
...
Done, cheery-crawfish:v3 deployed to Workflow

Use 'deis open' to view this application in your browser

To learn more, use 'deis help' or visit https://deis.com/

To ssh://deis-builder.dev.xxxxxxxx:2222/cheery-crawfish.git
 * [new branch]      master -> master

After below command:

$ deis open

Web page opened as expected.

kingdonb commented 5 years ago

Superb. We're going to keep this issue open until you no longer need the workaround.