pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.7k stars 1.7k forks source link

ValidationException: validation.uuid (HTTP/422) after new update #4290

Closed d4ve10 closed 1 year ago

d4ve10 commented 2 years ago

Current Behavior

When starting wings after the new update, the exception ValidationException: validation.uuid (HTTP/422) occurs. It also happens every minute. But the panel and wings are otherwise working completely fine.

Expected Behavior

No exception

Steps to Reproduce

For me, it happend suddenly after i updated the panel from 1.9.2 to 1.10.1 and wings from 1.6.4 to 1.7.0. I also saw, that some people in Discord had the same problem that couldn't be resolved. The exception occurred because of the new cron job that is sending activities from wings to the panel. After i digged deeper, I found out that wings send following activity data to <panel url>/api/remote/activity:

{"data":[{"user":null,"server":"31030078-6401-4ba8-b8d6-5bd4ee38a025","event":"server:power.start","metadata":{},"ip":"192.168.0.111","timestamp":"2022-07-27T21:37:16.224271015Z"},{"user":null,"server":"31030078-6401-4ba8-b8d6-5bd4ee38a025","event":"server:power.stop","metadata":{},"ip":"192.168.0.111","timestamp":"2022-07-27T21:37:33.326630494Z"}]}

In the image below is the database where the data is from. 2022-07-30_18-21 In my case, the user field is somehow null and that is why this exception occured. To fix it temporarly, I just connected to the database (sqlite3 /var/lib/pterodactyl/wings.db) and removed the rows where the user field is null (DELETE FROM activities WHERE user IS NULL;). I hope that is enough information for others to fix this errors and for the maintainers to stop it from happening again :)

Panel Version

1.10.1

Wings Version

1.7.0

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

DEBUG: [Jul 30 18:10:59.277] running in debug mode    
 INFO: [Jul 30 18:10:59.277] loading configuration from file config_file=/etc/pterodactyl/config.yml
 INFO: [Jul 30 18:10:59.277] configured wings with system timezone timezone=Europe/Berlin
DEBUG: [Jul 30 18:10:59.277] ensuring root data directory exists path=/var/lib/pterodactyl
DEBUG: [Jul 30 18:10:59.277] ensuring server data directory exists path=/var/lib/pterodactyl/volumes
DEBUG: [Jul 30 18:10:59.277] ensuring archive data directory exists path=/var/lib/pterodactyl/archives
DEBUG: [Jul 30 18:10:59.277] ensuring backup data directory exists path=/var/lib/pterodactyl/backups
 INFO: [Jul 30 18:10:59.278] checking for pterodactyl system user username={0 0}
 INFO: [Jul 30 18:10:59.278] configured system user successfully gid=0 uid=0 username=root
 INFO: [Jul 30 18:10:59.280] fetching list of servers from API
DEBUG: [Jul 30 18:10:59.280] making request to external HTTP endpoint endpoint=<panel url>/api/remote/servers?page=0&per_page=50 headers=map[Accept:[application/vnd.pterodactyl.v1+json] Authorization:[(redacted)] Content-Type:[application/json] User-Agent:[Pterodactyl Wings/v1.7.0 (id:<token id>)]] method=GET
 INFO: [Jul 30 18:10:59.473] processing servers returned by the API total_configs=3
DEBUG: [Jul 30 18:10:59.473] using 4 workerpools to instantiate server instances
 INFO: [Jul 30 18:10:59.473] creating new server object from API response server=31030078-6401-4ba8-b8d6-5bd4ee38a025
 INFO: [Jul 30 18:10:59.473] creating new server object from API response server=6958567b-55d3-4d14-993b-545d504c4dd6
 INFO: [Jul 30 18:10:59.473] creating new server object from API response server=841c6e9d-ecb3-4241-a6fa-e3618b954df1
DEBUG: [Jul 30 18:10:59.474] registering event listeners: console, state, resources... server=31030078-6401-4ba8-b8d6-5bd4ee38a025
DEBUG: [Jul 30 18:10:59.474] registering event listeners: console, state, resources... server=841c6e9d-ecb3-4241-a6fa-e3618b954df1
DEBUG: [Jul 30 18:10:59.474] registering event listeners: console, state, resources... server=6958567b-55d3-4d14-993b-545d504c4dd6
 INFO: [Jul 30 18:10:59.474] finished processing server configurations duration=1.560568ms
 INFO: [Jul 30 18:10:59.483] finished loading configuration for server server=31030078-6401-4ba8-b8d6-5bd4ee38a025
 INFO: [Jul 30 18:10:59.483] finished loading configuration for server server=841c6e9d-ecb3-4241-a6fa-e3618b954df1
 INFO: [Jul 30 18:10:59.483] finished loading configuration for server server=6958567b-55d3-4d14-993b-545d504c4dd6
 INFO: [Jul 30 18:10:59.483] configuring server environment and restoring to previous state server=841c6e9d-ecb3-4241-a6fa-e3618b954df1
 INFO: [Jul 30 18:10:59.484] configuring server environment and restoring to previous state server=6958567b-55d3-4d14-993b-545d504c4dd6
 INFO: [Jul 30 18:10:59.484] configuring server environment and restoring to previous state server=31030078-6401-4ba8-b8d6-5bd4ee38a025
 INFO: [Jul 30 18:10:59.497] configuring system crons  interval=1m0s subsystem=cron
 INFO: [Jul 30 18:10:59.497] starting cron processes   subsystem=cron
DEBUG: [Jul 30 18:10:59.497] sending sftp events to Panel cron=sftp subsystem=cron
 INFO: [Jul 30 18:10:59.498] configuring internal webserver host_address=0.0.0.0 host_port=443 use_auto_tls=false use_ssl=false
 INFO: [Jul 30 18:10:59.498] updating server states on Panel: marking installing/restoring servers as normal
DEBUG: [Jul 30 18:10:59.499] making request to external HTTP endpoint endpoint=<panel url>/api/remote/servers/reset headers=map[Accept:[application/vnd.pterodactyl.v1+json] Authorization:[(redacted)] Content-Type:[application/json] User-Agent:[Pterodactyl Wings/v1.7.0 (id:<token id>)]] method=POST
DEBUG: [Jul 30 18:10:59.499] sending internal activity events to Panel cron=activity subsystem=cron
DEBUG: [Jul 30 18:10:59.511] making request to external HTTP endpoint endpoint=<panel url>/api/remote/activity headers=map[Accept:[application/vnd.pterodactyl.v1+json] Authorization:[(redacted)] Content-Type:[application/json] User-Agent:[Pterodactyl Wings/v1.7.0 (id:<token id>)]] method=POST
 INFO: [Jul 30 18:10:59.514] sftp server listening for connections listen=0.0.0.0:2022 public_key=ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINiVi9J2XGq53TiqYMbmpPJV9+NE5NqpQNnUFeh7IMZ2
ERROR: [Jul 30 18:10:59.673] activity process failed to execute cron=activity error=cron: failed to send activity events to Panel: Error response from Panel: ValidationException: validation.uuid (HTTP/422) subsystem=cron

Stacktrace:
Error response from Panel: ValidationException: validation.uuid (HTTP/422)
github.com/pterodactyl/wings/remote.(*client).request.func1
        github.com/pterodactyl/wings/remote/http.go:160
github.com/cenkalti/backoff/v4.RetryNotifyWithTimer
        github.com/cenkalti/backoff/v4@v4.1.2/retry.go:55
github.com/cenkalti/backoff/v4.RetryNotify
        github.com/cenkalti/backoff/v4@v4.1.2/retry.go:34
github.com/cenkalti/backoff/v4.Retry
        github.com/cenkalti/backoff/v4@v4.1.2/retry.go:28
github.com/pterodactyl/wings/remote.(*client).request
        github.com/pterodactyl/wings/remote/http.go:135
github.com/pterodactyl/wings/remote.(*client).Post
        github.com/pterodactyl/wings/remote/http.go:95
github.com/pterodactyl/wings/remote.(*client).SendActivityLogs
        github.com/pterodactyl/wings/remote/servers.go:184
github.com/pterodactyl/wings/internal/cron.(*activityCron).Run
        github.com/pterodactyl/wings/internal/cron/activity_cron.go:43
github.com/pterodactyl/wings/internal/cron.Scheduler.func1
        github.com/pterodactyl/wings/internal/cron/cron.go:50
reflect.Value.call
        reflect/value.go:556
reflect.Value.Call
        reflect/value.go:339
github.com/go-co-op/gocron.callJobFuncWithParams
        github.com/go-co-op/gocron@v1.15.0/gocron.go:106
github.com/go-co-op/gocron.(*executor).start.func1.2
        github.com/go-co-op/gocron@v1.15.0/executor.go:92
github.com/go-co-op/gocron.(*executor).start.func1
        github.com/go-co-op/gocron@v1.15.0/executor.go:99
runtime.goexit
        runtime/asm_amd64.s:1581

cron: failed to send activity events to Panel

Is there an existing issue for this?

vijaypondini commented 2 years ago

What is the updated command to look for on this? Since the table got renamed to activity_logs and it's no longer "user", and that I see multiple values defaulting to NULL, I'm not confident in which one in particular it is. I don't see anything marked NULL in actor_id , actor_typr , in fact anything from activity_logs AND activity_log_subjects that would cause this issue

Is there an alternative fix to this?

playaz44 commented 2 years ago

This fix "DELETE FROM activities WHERE user IS NULL;" and reset processing state to '0' not working.

All cron tasks stuck in processing state.

d4ve10 commented 2 years ago

You are mixing up something. You are referring to the database of the pterodactyl panel where all activities are stored. I'm referring to the sqlite database of the wings server where the activities are temporary stored and then send to the panel. And if the user field in the database of the wings server is NULL, then it will throw this exception. That command that I provided only works if you use it on the database of the wings server.

playaz44 commented 2 years ago

You are mixing up something. You are referring to the database of the pterodactyl panel where all activities are stored. I'm referring to the sqlite database of the wings server where the activities are temporary stored and then send to the panel. And if the user field in the database of the wings server is NULL, then it will throw this exception. That command that I provided only works if you use it on the database of the wings server.

I did it on Wings. It is true that there is no error in Wings but still cron jobs stuck in processing state. That's why I don't consider it a solution.

d4ve10 commented 2 years ago

ah, okay, i mainly meant vijaypondini with my comment. Where did you find that you have cron jobs stuck in processing state? Are these cron jobs related to the wings server or the panel?

playaz44 commented 2 years ago

Appear in the panel in status image This happens with all schedules, no matter what command is set to execute. Every time he falls into the loop "processing" state, I asked on discord and I was sent here that this issue causes it.

d4ve10 commented 2 years ago

Then unfortunately, my fix won't help you because it has nothing to do with the schedules of the panel. Try to get some logs and post it on the discord server or create an issue if you don't find an answer.

MinerPL commented 2 years ago

In my case, it simply helped to completely delete the wings.db file instead of editing its contents. All actions (Schedules etc) work fine.

playaz44 commented 2 years ago

In my case, it simply helped to completely delete the wings.db file instead of editing its contents. All actions (Schedules etc) work fine.

Yes, It works.

tropicthedev commented 2 years ago

I am also having this issue, it usually happens whenever there is a scheduled backup running.

Logs included below just in case it helps you guys.

_wings_wings_1_logs.txt

melvyn2 commented 1 year ago

Still getting this with wings 1.11.0:

activity process failed to execute cron=activity error=cron: failed to send activity events to Panel:
Error response from Panel: ValidationException: The data.0.ip must be a valid IP address. (HTTP/422)
PrometheusDevs1 commented 1 year ago

Still getting this with wings 1.11.0:

activity process failed to execute cron=activity error=cron: failed to send activity events to Panel:
Error response from Panel: ValidationException: The data.0.ip must be a valid IP address. (HTTP/422)

Me too