Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running inside docker container from non-root user #75650

Closed
Cinerar mannequin opened this issue Sep 14, 2017 · 2 comments
Closed

Running inside docker container from non-root user #75650

Cinerar mannequin opened this issue Sep 14, 2017 · 2 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@Cinerar
Copy link
Mannequin

Cinerar mannequin commented Sep 14, 2017

BPO 31469
Nosy @bitdancer, @Cinerar
PRs
  • bpo-10496 Runing Inside docker container from non root user raises KeyError #3403
  • Superseder
  • bpo-10496: Python startup should not require passwd entry
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-09-14.15:33:48.783>
    created_at = <Date 2017-09-14.15:12:08.951>
    labels = ['3.7', 'type-bug', 'library']
    title = 'Running inside docker container from non-root user'
    updated_at = <Date 2017-09-14.15:34:28.949>
    user = 'https://github.com/Cinerar'

    bugs.python.org fields:

    activity = <Date 2017-09-14.15:34:28.949>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-09-14.15:33:48.783>
    closer = 'r.david.murray'
    components = ['Library (Lib)']
    creation = <Date 2017-09-14.15:12:08.951>
    creator = 'cinerar'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31469
    keywords = []
    message_count = 2.0
    messages = ['302172', '302174']
    nosy_count = 2.0
    nosy_names = ['r.david.murray', 'cinerar']
    pr_nums = ['3403']
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '10496'
    type = 'behavior'
    url = 'https://bugs.python.org/issue31469'
    versions = ['Python 3.7']

    @Cinerar
    Copy link
    Mannequin Author

    Cinerar mannequin commented Sep 14, 2017

    When i try to run youtube-dl inside docker container from non root user i recieve this error:

    failed to import the site module traceback (most recent call last): file "/usr/lib/python3.6/site.py", line 544, in main() file "/usr/lib/python3.6/site.py", line 530, in main known_paths = addusersitepackages(known_paths) file "/usr/lib/python3.6/site.py", line 282, in addusersitepackages user_site = getusersitepackages() file "/usr/lib/python3.6/site.py", line 258, in getusersitepackages user_base = getuserbase() # this will also set user_base file "/usr/lib/python3.6/site.py", line 248, in getuserbase user_base = get_config_var('userbase') file "/usr/lib/python3.6/sysconfig.py", line 601, in get_config_var return get_config_vars().get(name) file "/usr/lib/python3.6/sysconfig.py", line 558, in get_config_vars _config_vars['userbase'] = _getuserbase() file "/usr/lib/python3.6/sysconfig.py", line 205, in _getuserbase return joinuser("~", ".local") file "/usr/lib/python3.6/sysconfig.py", line 184, in joinuser return os.path.expanduser(os.path.join(*args)) file "/usr/lib/python3.6/posixpath.py", line 247, in expanduser userhome = pwd.getpwuid(os.getuid()).pw_dir keyerror: 'getpwuid(): uid not found: 1000'

    I believe this problem is described here:
    http://blog.dscpl.com.au/2015/12/unknown-user-when-running-docker.html

    this simple fix make it work again

    @Cinerar Cinerar mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir labels Sep 14, 2017
    @bitdancer
    Copy link
    Member

    It sounds like docker is just broken (I would expect unix tools to work in a docker container). That however is beside the point.

    I believe this is a duplicate of bpo-10496, but I don't know why it hasn't been fixed.

    @bitdancer bitdancer added the type-bug An unexpected behavior, bug, or error label Sep 14, 2017
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant