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

[Only affects wings 1.11.9 and up] Unable to mount an NFS "folder" inside the pterodactyl server volume. #5040

Open
3 tasks done
LZNetwork-Main opened this issue Mar 22, 2024 · 8 comments
Labels
not confirmed Report seems plausible but requires additional testing or 3rd part confirmation.

Comments

@LZNetwork-Main
Copy link

LZNetwork-Main commented Mar 22, 2024

Current Behavior

After mounting an NFS share into a server's volume (for example /var/lib/pterodactyl/volumes/volume_id/data) and after starting the server, the server throws this error:
Error Event [68d61a4e-0836-4694-99c0-6094e2819970]: failed to chown root server directory during pre-boot process: server/filesystem: chown: failed to chown during walk function: stat 0c89372c-9a08-4cee-b516-7dd0d4db3bca/part.602: file does not exist

I tried on two separate nodes and got the same result.

Expected Behavior

Mount an NFS share into a server's volume (for example /var/lib/pterodactyl/volumes/volume_id/data) start the server, the server will change its permissions and everything works fine - this was the behaviour before wings version 1.11.9

Steps to Reproduce

  1. Create a server - it does not matter which egg or docker image.
  2. Mount an NFS share into this servers volume
  3. Start the server

Panel Version

1.11.5

Wings Version

1.11.11

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

https://ptero.co/igoselytov

Is there an existing issue for this?

  • I have searched the existing issues before opening this issue.
  • I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
@LZNetwork-Main LZNetwork-Main added the not confirmed Report seems plausible but requires additional testing or 3rd part confirmation. label Mar 22, 2024
@LZNetwork-Main LZNetwork-Main changed the title [Only afftects wings 1.11.9 and up] Unable to mount an NFS "folder" inside the pterodactyl server volume. [Only affects wings 1.11.9 and up] Unable to mount an NFS "folder" inside the pterodactyl server volume. Mar 22, 2024
@ptoal
Copy link

ptoal commented Mar 23, 2024

I can confirm this. I have an NFS4 mounted disk at /var/srv/gstorage1/wings1 that is owned by my pterodactyl:pterodactyl user. When attempting to start any server with 1.11.11, I get the same error. Reverting back to 1.11.8 works fine.

I haven't looked at the code yet, but my first guess is that wings is doing something with privileges that is changing its effective user id, and the NFS server is denying access.

@LZNetwork-Main
Copy link
Author

Yes, I've also downgraded the node that runs the server with the mount. The node is private anyways so it does not really matter for now.

I do not think it's something to do with the user id, although I am not an expert by any stretch of imagination, so please excuse me if I'm wrong - since I do not really know how the internal processes of Wings work.
However, I've spun up a new NFS4 share that allowed any user from the IP of the node to read/write and I got the same result.

From what I've seen in the log:
WARN: [Mar 22 17:36:51.772] failed to determine root fs directory size error=server/filesystem: directorysize: failed to walk directory: walkdirat err: stat 0c89372c-9a08-4cee-b516-7dd0d4db3bca/part.602: file does not exist root=/var/lib/pterodactyl/volumes/a8c306f0-a28d-47c2-aeec-147b7c90df30 it cannot find the file 0c89372c-9a08-4cee-b516-7dd0d4db3bca/part.602 which is interesting, because the NFS4 share is mounted in 0c89372c-9a08-4cee-b516-7dd0d4db3bca/data/ and not in the root of the volume.

Also, Wings apparently has a problem with calculating the volume size:

WARN: [Mar 22 17:36:51.772] failed to determine root fs directory size error=server/filesystem: directorysize: failed to walk directory: walkdirat err: stat 0c89372c-9a08-4cee-b516-7dd0d4db3bca/part.602: file does not exist root=/var/lib/pterodactyl/volumes/a8c306f0-a28d-47c2-aeec-147b7c90df30

Stacktrace:
stat 0c89372c-9a08-4cee-b516-7dd0d4db3bca/part.602: file does not exist
walkdirat err
github.com/pterodactyl/wings/server/filesystem.(*Filesystem).DirectorySize.func1
	github.com/pterodactyl/wings/server/filesystem/disk_space.go:170
github.com/pterodactyl/wings/internal/ufs.(*UnixFS).walkDir
	github.com/pterodactyl/wings/internal/ufs/walk_unix.go:59
github.com/pterodactyl/wings/internal/ufs.(*UnixFS).walkDir
	github.com/pterodactyl/wings/internal/ufs/walk_unix.go:76
github.com/pterodactyl/wings/internal/ufs.(*UnixFS).walkDir
	github.com/pterodactyl/wings/internal/ufs/walk_unix.go:76
github.com/pterodactyl/wings/internal/ufs.(*UnixFS).walkDir
	github.com/pterodactyl/wings/internal/ufs/walk_unix.go:76
github.com/pterodactyl/wings/internal/ufs.(*UnixFS).walkDir
	github.com/pterodactyl/wings/internal/ufs/walk_unix.go:76
github.com/pterodactyl/wings/internal/ufs.(*UnixFS).walkDir
	github.com/pterodactyl/wings/internal/ufs/walk_unix.go:76
github.com/pterodactyl/wings/internal/ufs.(*UnixFS).walkDir
	github.com/pterodactyl/wings/internal/ufs/walk_unix.go:76
github.com/pterodactyl/wings/internal/ufs.(*UnixFS).WalkDirat
	github.com/pterodactyl/wings/internal/ufs/walk_unix.go:33
github.com/pterodactyl/wings/server/filesystem.(*Filesystem).DirectorySize
	github.com/pterodactyl/wings/server/filesystem/disk_space.go:168
github.com/pterodactyl/wings/server/filesystem.(*Filesystem).updateCachedDiskUsage
	github.com/pterodactyl/wings/server/filesystem/disk_space.go:147
github.com/pterodactyl/wings/server/filesystem.(*Filesystem).DiskUsage
	github.com/pterodactyl/wings/server/filesystem/disk_space.go:113
github.com/pterodactyl/wings/server/filesystem.(*Filesystem).HasSpaceAvailable
	github.com/pterodactyl/wings/server/filesystem/disk_space.go:68
github.com/pterodactyl/wings/server/filesystem.(*Filesystem).HasSpaceErr
	github.com/pterodactyl/wings/server/filesystem/disk_space.go:53
github.com/pterodactyl/wings/server.(*Server).onBeforeStart
	github.com/pterodactyl/wings/server/power.go:194
github.com/pterodactyl/wings/server.(*Server).HandlePowerAction
	github.com/pterodactyl/wings/server/power.go:131
github.com/pterodactyl/wings/router/websocket.(*Handler).HandleInbound
	github.com/pterodactyl/wings/router/websocket/websocket.go:363
github.com/pterodactyl/wings/router.getServerWebsocket.func3
	github.com/pterodactyl/wings/router/router_server_ws.go:85
runtime.goexit
	runtime/asm_amd64.s:1650

server/filesystem: directorysize: failed to walk directory

@parkervcp
Copy link
Member

This probably has to do with the fact that we are using the unix file stuff now as a change from the old filepath.

I am going to assume they are treated differently because it's externally mounted and the io package doesn't know how to handle the mount properly.

@matthewpi
Copy link
Member

Where exactly on the filesystem are you mounting to?

I think I might know what the issue is.

@LZNetwork-Main
Copy link
Author

LZNetwork-Main commented Mar 25, 2024

Where exactly on the filesystem are you mounting to?

I think I might know what the issue is.

I am mounting exactly to /var/lib/pterodactyl/volumes/volume_id/data, of course, where "volume_id" is replaced by the actual volume_id.

Edit: Just in case it helps, I am using this mount under the minio egg, where I am mounting the data folder inside the pterodactyl volume to my NAS with NFSv4. Oh, and I do not have Squash enabled on my NFS server.

@Hmmmz
Copy link

Hmmmz commented Mar 25, 2024

I have a similar problem with this error that "file not exist" when checking file permission while starting on a NFS share with the new Wings version but I mount to "/var/lib/pterodactyl" instead, any ideas?

@LZNetwork-Main
Copy link
Author

Hello, just checking in, any updates?

@simonmicro
Copy link
Contributor

simonmicro commented Apr 2, 2024

Hey, same problem here - just killed all my servers as I rolled out the update via Ansible. This also seemed to cause a lot of corrupt backups, idk how this came. Stupid mistake from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not confirmed Report seems plausible but requires additional testing or 3rd part confirmation.
Projects
None yet
Development

No branches or pull requests

6 participants