Title: Permission denied on `config.lock` when cloning in Docker under MacOS · Issue #1566 · gitpython-developers/GitPython · GitHub
Open Graph Title: Permission denied on `config.lock` when cloning in Docker under MacOS · Issue #1566 · gitpython-developers/GitPython
X Title: Permission denied on `config.lock` when cloning in Docker under MacOS · Issue #1566 · gitpython-developers/GitPython
Description: Hi, I found a bug related to the FileLock system. What I'm doing: In Ubuntu 20.04 running under Docker, I'm cloning the repository using clone_from. The directory that I'm cloning to is mounted under MacOS as follows: docker run --rm --i...
Open Graph Description: Hi, I found a bug related to the FileLock system. What I'm doing: In Ubuntu 20.04 running under Docker, I'm cloning the repository using clone_from. The directory that I'm cloning to is mounted und...
X Description: Hi, I found a bug related to the FileLock system. What I'm doing: In Ubuntu 20.04 running under Docker, I'm cloning the repository using clone_from. The directory that I'm cloning to is...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1566
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Permission denied on `config.lock` when cloning in Docker under MacOS","articleBody":"Hi,\r\nI found a bug related to the `FileLock` system. What I'm doing:\r\n1. In Ubuntu 20.04 running under Docker, I'm cloning the repository using `clone_from`.\r\n2. The directory that I'm cloning to is mounted under MacOS as follows:\r\n`docker run --rm --interactive -v $PWD:/work --user $(id -u):$(id -g) /bin/bash`\r\n3. Docker container is running with UID and GID of the MacOS\r\n\r\nI'm getting this error:\r\n```\r\nException in thread my-repository:\r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.8/dist-packages/git/util.py\", line 941, in _obtain_lock_or_raise\r\n fd = os.open(lock_file, flags, 0)\r\nPermissionError: [Errno 13] Permission denied: '/work/repo/my-repository.git/.git/config.lock'\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n File \"/usr/lib/python3.8/threading.py\", line 932, in _bootstrap_inner\r\n self.run()\r\n File \"/app/clone-tool.py\", line 124, in run\r\n git.Repo.clone_from(self.git_url, repo_dir)\r\n File \"/usr/local/lib/python3.8/dist-packages/git/repo/base.py\", line 1325, in clone_from\r\n return cls._clone(\r\n File \"/usr/local/lib/python3.8/dist-packages/git/repo/base.py\", line 1252, in _clone\r\n with repo.remotes[0].config_writer as writer:\r\n File \"/usr/local/lib/python3.8/dist-packages/git/remote.py\", line 1146, in config_writer\r\n writer = self.repo.config_writer()\r\n File \"/usr/local/lib/python3.8/dist-packages/git/repo/base.py\", line 604, in config_writer\r\n return GitConfigParser(self._get_config_path(config_level), read_only=False, repo=self)\r\n File \"/usr/local/lib/python3.8/dist-packages/git/config.py\", line 366, in __init__\r\n self._acquire_lock()\r\n File \"/usr/local/lib/python3.8/dist-packages/git/config.py\", line 385, in _acquire_lock\r\n self._lock._obtain_lock()\r\n File \"/usr/local/lib/python3.8/dist-packages/git/util.py\", line 951, in _obtain_lock\r\n return self._obtain_lock_or_raise()\r\n File \"/usr/local/lib/python3.8/dist-packages/git/util.py\", line 944, in _obtain_lock_or_raise\r\n raise IOError(str(e)) from e\r\nOSError: [Errno 13] Permission denied: '/work/repo/my-repository.git/.git/config.lock'\r\n```\r\n\r\nThe `config.lock` file as listed under Ubuntu:\r\n```\r\n$ ls -la\r\nls: cannot access 'config.lock': No such file or directory\r\ntotal 144\r\ndrwxr-xr-x 14 501 dialout 448 Mar 24 13:42 .\r\ndrwxr-xr-x 18 501 dialout 576 Mar 24 13:42 ..\r\n-rw-r--r-- 1 501 dialout 23 Mar 24 13:42 HEAD\r\ndrwxr-xr-x 2 501 dialout 64 Mar 24 13:42 branches\r\n-rw-r--r-- 1 501 dialout 298 Mar 24 13:42 config\r\n-????????? ? ? ? ? ? config.lock\r\n-rw-r--r-- 1 501 dialout 73 Mar 24 13:42 description\r\ndrwxr-xr-x 14 501 dialout 448 Mar 24 13:42 hooks\r\n-rw-r--r-- 1 501 dialout 122075 Mar 24 13:42 index\r\ndrwxr-xr-x 3 501 dialout 96 Mar 24 13:42 info\r\ndrwxr-xr-x 4 501 dialout 128 Mar 24 13:42 logs\r\ndrwxr-xr-x 4 501 dialout 128 Mar 24 13:42 objects\r\n-rw-r--r-- 1 501 dialout 114 Mar 24 13:42 packed-refs\r\ndrwxr-xr-x 5 501 dialout 160 Mar 24 13:42 refs\r\n```\r\n\r\nAlso listed under MacOS:\r\n```\r\n$ ls -la\r\ntotal 288\r\ndrwxr-xr-x 14 mmajchrzycki staff 448 Mar 24 14:42 .\r\ndrwxr-xr-x 18 mmajchrzycki staff 576 Mar 24 14:42 ..\r\n-rw-r--r-- 1 mmajchrzycki staff 23 Mar 24 14:42 HEAD\r\ndrwxr-xr-x 2 mmajchrzycki staff 64 Mar 24 14:42 branches\r\n-rw-r--r--@ 1 mmajchrzycki staff 298 Mar 24 14:42 config\r\n---------- 1 mmajchrzycki staff 0 Mar 24 14:42 config.lock\r\n-rw-r--r-- 1 mmajchrzycki staff 73 Mar 24 14:42 description\r\ndrwxr-xr-x 14 mmajchrzycki staff 448 Mar 24 14:42 hooks\r\n-rw-r--r-- 1 mmajchrzycki staff 122075 Mar 24 14:42 index\r\ndrwxr-xr-x 3 mmajchrzycki staff 96 Mar 24 14:42 info\r\ndrwxr-xr-x 4 mmajchrzycki staff 128 Mar 24 14:42 logs\r\ndrwxr-xr-x 4 mmajchrzycki staff 128 Mar 24 14:42 objects\r\n-rw-r--r-- 1 mmajchrzycki staff 114 Mar 24 14:42 packed-refs\r\n```\r\n\r\nI will provide a minimum set-up (docker file and python script) to reproduce it later.\r\n","author":{"url":"https://github.com/mmajchrzycki","@type":"Person","name":"mmajchrzycki"},"datePublished":"2023-03-24T14:11:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/1566/GitPython/issues/1566"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cb4e613b-aca7-d88a-063c-9727bf132d0d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E756:22117D:AA0BC3:ECEDCB:6968D93B |
| html-safe-nonce | cb42748db9138aaa5a4953d0f42a7df4e27534e9c0fd0fdc48eac168be107337 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzU2OjIyMTE3RDpBQTBCQzM6RUNFRENCOjY5NjhEOTNCIiwidmlzaXRvcl9pZCI6IjkwMjc3OTM1MTMwMjQ2NDEzMzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f8cfdb9f1f2b2045a3c9d81d3403d4a22d969c957223e5b3eb741ecb89d0db62 |
| hovercard-subject-tag | issue:1639472512 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/1566/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1129c41ce1cbbda38a27ddcdb4b73bb9e4cb207600973413a99e554d7fabd553/gitpython-developers/GitPython/issues/1566 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1129c41ce1cbbda38a27ddcdb4b73bb9e4cb207600973413a99e554d7fabd553/gitpython-developers/GitPython/issues/1566 |
| og:image:alt | Hi, I found a bug related to the FileLock system. What I'm doing: In Ubuntu 20.04 running under Docker, I'm cloning the repository using clone_from. The directory that I'm cloning to is mounted und... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mmajchrzycki |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3c4e9f2fc1db52c609205138be6a397cfde4574cb54d53015014de30dd49f27e |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1fb1ea11f8c37dd4dd50347cca70d89824e93788 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width