Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Permission denied onconfig.lock when cloning in Docker under MacOS #1566

Closed
@mmajchrzycki

Description

@mmajchrzycki

Hi,
I found a bug related to theFileLock system. What I'm doing:

  1. In Ubuntu 20.04 running under Docker, I'm cloning the repository usingclone_from.
  2. The directory that I'm cloning to is mounted under MacOS as follows:
    docker run --rm --interactive -v $PWD:/work --user $(id -u):$(id -g) /bin/bash
  3. Docker container is running with UID and GID of the MacOS

I'm getting this error:

Exception in thread my-repository:Traceback (most recent call last):  File "/usr/local/lib/python3.8/dist-packages/git/util.py", line 941, in _obtain_lock_or_raise    fd = os.open(lock_file, flags, 0)PermissionError: [Errno 13] Permission denied: '/work/repo/my-repository.git/.git/config.lock'The above exception was the direct cause of the following exception:Traceback (most recent call last):  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner    self.run()  File "/app/clone-tool.py", line 124, in run    git.Repo.clone_from(self.git_url, repo_dir)  File "/usr/local/lib/python3.8/dist-packages/git/repo/base.py", line 1325, in clone_from    return cls._clone(  File "/usr/local/lib/python3.8/dist-packages/git/repo/base.py", line 1252, in _clone    with repo.remotes[0].config_writer as writer:  File "/usr/local/lib/python3.8/dist-packages/git/remote.py", line 1146, in config_writer    writer = self.repo.config_writer()  File "/usr/local/lib/python3.8/dist-packages/git/repo/base.py", line 604, in config_writer    return GitConfigParser(self._get_config_path(config_level), read_only=False, repo=self)  File "/usr/local/lib/python3.8/dist-packages/git/config.py", line 366, in __init__    self._acquire_lock()  File "/usr/local/lib/python3.8/dist-packages/git/config.py", line 385, in _acquire_lock    self._lock._obtain_lock()  File "/usr/local/lib/python3.8/dist-packages/git/util.py", line 951, in _obtain_lock    return self._obtain_lock_or_raise()  File "/usr/local/lib/python3.8/dist-packages/git/util.py", line 944, in _obtain_lock_or_raise    raise IOError(str(e)) from eOSError: [Errno 13] Permission denied: '/work/repo/my-repository.git/.git/config.lock'

Theconfig.lock file as listed under Ubuntu:

$ ls -lals: cannot access 'config.lock': No such file or directorytotal 144drwxr-xr-x 14 501 dialout    448 Mar 24 13:42 .drwxr-xr-x 18 501 dialout    576 Mar 24 13:42 ..-rw-r--r--  1 501 dialout     23 Mar 24 13:42 HEADdrwxr-xr-x  2 501 dialout     64 Mar 24 13:42 branches-rw-r--r--  1 501 dialout    298 Mar 24 13:42 config-?????????  ? ?   ?            ?            ? config.lock-rw-r--r--  1 501 dialout     73 Mar 24 13:42 descriptiondrwxr-xr-x 14 501 dialout    448 Mar 24 13:42 hooks-rw-r--r--  1 501 dialout 122075 Mar 24 13:42 indexdrwxr-xr-x  3 501 dialout     96 Mar 24 13:42 infodrwxr-xr-x  4 501 dialout    128 Mar 24 13:42 logsdrwxr-xr-x  4 501 dialout    128 Mar 24 13:42 objects-rw-r--r--  1 501 dialout    114 Mar 24 13:42 packed-refsdrwxr-xr-x  5 501 dialout    160 Mar 24 13:42 refs

Also listed under MacOS:

$ ls -latotal 288drwxr-xr-x  14 mmajchrzycki  staff     448 Mar 24 14:42 .drwxr-xr-x  18 mmajchrzycki  staff     576 Mar 24 14:42 ..-rw-r--r--   1 mmajchrzycki  staff      23 Mar 24 14:42 HEADdrwxr-xr-x   2 mmajchrzycki  staff      64 Mar 24 14:42 branches-rw-r--r--@  1 mmajchrzycki  staff     298 Mar 24 14:42 config----------   1 mmajchrzycki  staff       0 Mar 24 14:42 config.lock-rw-r--r--   1 mmajchrzycki  staff      73 Mar 24 14:42 descriptiondrwxr-xr-x  14 mmajchrzycki  staff     448 Mar 24 14:42 hooks-rw-r--r--   1 mmajchrzycki  staff  122075 Mar 24 14:42 indexdrwxr-xr-x   3 mmajchrzycki  staff      96 Mar 24 14:42 infodrwxr-xr-x   4 mmajchrzycki  staff     128 Mar 24 14:42 logsdrwxr-xr-x   4 mmajchrzycki  staff     128 Mar 24 14:42 objects-rw-r--r--   1 mmajchrzycki  staff     114 Mar 24 14:42 packed-refs

I will provide a minimum set-up (docker file and python script) to reproduce it later.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp