CloudCredo / cloudrocker

Apache License 2.0
34 stars 6 forks source link

python sample app errors with uid not found: 1000 #6

Closed jbayer closed 9 years ago

jbayer commented 9 years ago

the sample flask app works fine on run.pivotal.io, so i assume it's some difference in the cloud rocker env from the normal cloud foundry environment.

$ fock add-buildpack https://github.com/cloudfoundry/python-buildpack.git
Downloading buildpack...
Cloning into 'python-buildpack'...
remote: Counting objects: 152, done.
remote: Compressing objects: 100% (90/90), done.
remote: Total 152 (delta 59), reused 123 (delta 58)
Receiving objects: 100% (152/152), 8.19 MiB | 3.03 MiB/s, done.
Resolving deltas: 100% (59/59), done.
Checking connectivity... done.
Submodule 'compile-extensions' (https://github.com/cf-buildpacks/compile-extensions.git) registered for path 'compile-extensions'
Cloning into 'compile-extensions'...
remote: Counting objects: 203, done.
remote: Compressing objects: 100% (102/102), done.
remote: Total 203 (delta 66), reused 199 (delta 64)
Receiving objects: 100% (203/203), 35.48 KiB | 0 bytes/s, done.
Resolving deltas: 100% (66/66), done.
Checking connectivity... done.
Submodule path 'compile-extensions': checked out '1b84b6955b115c84a552eaed2a28b1ae5dfb0456'
Downloaded buildpack.
vagrant@ubuntu-14:/vagrant/sample-apps/python$ fock up
Starting the CloudFocker container...
Running Buildpacks...
-------> Buildpack version 1.1.1
-----> Installing runtime (python-2.7.9)
-----> Installing dependencies with pip
Traceback (most recent call last):
  File "/app/.heroku/python/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 339, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2470, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2184, in load
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/__init__.py", line 10, in <module>
    from pip.util import get_installed_distributions, get_prog
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 15, in <module>
    from pip.locations import site_packages, running_under_virtualenv, virtualenv_no_global
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/locations.py", line 96, in <module>
    build_prefix = _get_build_prefix()
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/locations.py", line 65, in _get_build_prefix
    __get_username())
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/locations.py", line 60, in __get_username
    return pwd.getpwuid(os.geteuid()).pw_name
KeyError: 'getpwuid(): uid not found: 1000'
Traceback (most recent call last):
  File "/app/.heroku/python/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 339, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2470, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2184, in load
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/__init__.py", line 10, in <module>
    from pip.util import get_installed_distributions, get_prog
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 15, in <module>
    from pip.locations import site_packages, running_under_virtualenv, virtualenv_no_global
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/locations.py", line 96, in <module>
    build_prefix = _get_build_prefix()
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/locations.py", line 65, in _get_build_prefix
    __get_username())
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/locations.py", line 60, in __get_username
    return pwd.getpwuid(os.geteuid()).pw_name
KeyError: 'getpwuid(): uid not found: 1000'

cp: `/app/.heroku' and `/app/.heroku' are the same file
cp: `/app/.profile.d' and `/app/.profile.d' are the same file
cp: `/app/requirements.txt' and `/app/requirements.txt' are the same file
cp: `/app/runtime.txt' and `/app/runtime.txt' are the same file
Started the CloudFocker container.
Deleting the CloudFocker container...
cloudfocker-staging
Deleted container.
2015/01/03 00:55:45  Staging failed - have you added a buildpack for this type of application?
jbayer commented 9 years ago

one idea is that $HOME may not be set via https://github.com/toastdriven/django-haystack/issues/924

jbayer commented 9 years ago

looks like the missing user is likely candidate for a problem

$ docker run -t -i b013805f7ade /bin/bash
I have no name!@49536cf3faee:/$ id vcap
id: vcap: No such user
I have no name!@49536cf3faee:/$ whoami
whoami: cannot find name for user ID 1000
I have no name!@49536cf3faee:/$
jbayer commented 9 years ago

my sample python flask app https://github.com/jbayer/flask-example

hatofmonkeys commented 9 years ago

I think this is https://www.pivotaltracker.com/story/show/90826056 .

hatofmonkeys commented 9 years ago

Fixed as part of the amazing new raw-to-base-workflow-8000 allowing me to track all the wonderful 'features' wshd adds to the containers before starting the app.