Getcwd: cannot access parent directories

Hello, I’ve a problem with my current Gitea deployment where the occasional push to the server will return the following server error message:

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Failing the push to the gitea server. access is mainly via ssh repository urls.

Server Information:
Unraid server with gitea docker
unraid: 6.9.2
docker: Container ID: 697c3f687632 By: gitea/gitea
gitea: 1.16.8
git: 2.30.3

Repository Root Path /data/git/repositories
Static File Root Path /data/gitea
Custom File Root Path /data/gitea
Log Path /data/gitea/log
LFS Content Path /data/git/lfs
GITEA_CUSTOM /data/gitea
GITEA_WORK_DIR /data/gitea

/data is mapped to a folder on the docker host.

This looks like a client side problem, right? Could you please share details about how you push to the gitea server exactly?

Using Fork (but also had the problem with SourceTree) Both using the external git installed on the system.

Git version: 2.36.1.windows.1

I get this on multiple systems and even get this when directly interacting with the git over console.

The error returns as a Server error response on the push call.

It’s like 10% of the push attempts that seem to fail.

It would be super useful if you could share the exact command you type and all the output. There may be a clue as to why that happens. A 10% failure rate may suggest the problem is unrelated to Gitea (just a hunch).

Yes I thought about that just after I closed the console only had that one line copied. And of course it hasn’t happen during the rest of this day. I will post all the console output as soon as it happens again probably tomorrow.

Anonymized the repository url
Out put after a Git push command:

[03:07:53]	[Step 1/1] Locking support detected on remote "origin". Consider enabling it with:
[03:07:53]	[Step 1/1]   $ git config lfs.https://gitea.***.net/****/Library2022.git/info/lfs.locksverify true
[03:07:55]	[Step 1/1] Uploading LFS objects: 100% (2/2), 52 KB | 0 B/s, done.
[03:07:56]	[Step 1/1] remote: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory        
[03:07:56]	[Step 1/1] remote: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory        
[03:07:56]	[Step 1/1] remote: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory        
[03:07:56]	[Step 1/1] fatal: unable to get current working directory: No such file or directory
[03:07:56]	[Step 1/1] Gitea: Internal error
[03:07:56]	[Step 1/1] send-pack: unexpected disconnect while reading sideband packet
[03:07:56]	[Step 1/1] fatal: the remote end hung up unexpectedly
[03:07:56]	[Step 1/1] Process exited with code 128

That output is not familiar to me. Can you please share the exact command line you typed? Is it

$ git push

or something else?

That specific one I posted was via an automatic build. It uses the following lines to commit the changes

git add -A
git commit -m "Updated %CommitBranch% %DLLName%" -q
git push origin %CommitBranch%

Since it happens rarely, could it be a something related to the automatic build? I can imagine the environment of the automatic build changing from one run to the other. I can’t quite figure out why a git push to Gitea would fail to perform 10% of the time when repeated in the exact same environment.

It’s a real mystery that’s why I posted it here. Sadly the problem doesn’t only occur in the automatic build system. Even pushing from the developer PC sometimes fails. It’s less of a problem there because a quick new push will fix it. On the build system it’s more annoying because it fails the build.

Gitea: Internal error

Seems to suggest it’s something on the server side. That’s why I’m expecting a configuration error. Maybe some timed period task Gitea executes that leaves the current working directory on some directory that is removed?