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

ProjectZomboid64.json and crontab are resetting to factory settings on planned restarts #19

Closed
johnstsimoes opened this issue Jul 4, 2022 · 21 comments

Comments

@johnstsimoes
Copy link

johnstsimoes commented Jul 4, 2022

After moving servers and reinstalling pz-server-tool on the new one, we noticed that other jobs we add to the pzserver1 crontab AND ProjectZomboid64.json are being reset frequently to factory settings. (EDIT Jul 5: it happens on the planned restarts defined at /etc/pzst/config.json).

This is causing Xmx to reset to 8 GB (we have 128 GB, I'm using 96 GB) and server ends up crashing after a restart.

@johnstsimoes johnstsimoes changed the title Automatic factory reset of ProjectZomboid64.json and crontab ProjectZomboid64.json and crontab are resetting to factory settings on planned restarts Jul 5, 2022
@quarantin
Copy link
Owner

Hello, in order to add new crontabs running as pzserver1, you'll have to add them to a new file in /home/pzserver1/.pzst/crontabs/ and then run pzserver install as that user. Regarding Xmx being reset I pushed a fixed a few days ago that should address this issue, but I couldn't test it thoroughly yet. Try updating pzst and let me know if you're still having the issue.

@quarantin
Copy link
Owner

BTW could you send the console.txt when the crash occurs please? Also any useful information that could help troubleshoot the issue

@johnstsimoes
Copy link
Author

Thanks - it worked. I didn't know about the ~/.pzst/crontabs, I added a new file "custom" there with the other entries and pzserver install picked them up.

Also running pzmaxmem 96 added the proper entry to config.json, now it's all working well.

About the crash, it was occurring because server was defaulting to 8 GB and would run out of heap memory (Xmx reset to 8), now it's properly going for 96 after pzserver install.

Many thanks!

@quarantin
Copy link
Owner

Awesome! I'm glad to hear everything is fixed 😄

@Work991
Copy link

Work991 commented May 10, 2023

Thanks - it worked. I didn't know about the ~/.pzst/crontabs, I added a new file "custom" there with the other entries and pzserver install picked them up.

Also running pzmaxmem 96 added the proper entry to config.json, now it's all working well.

About the crash, it was occurring because server was defaulting to 8 GB and would run out of heap memory (Xmx reset to 8), now it's properly going for 96 after pzserver install.

Many thanks!

need help
send a sample message in ~/.pzst/crontabs
let me see

@quarantin
Copy link
Owner

I don't get it. Could you explain your problem in more details please?

@Work991
Copy link

Work991 commented May 11, 2023

I don't get it. Could you explain your problem in more details please?

ProjectZomboid64.json im set ram 64g.
When server restart daily ProjectZomboid64.json reset to default 8gb

Can't solve the problem according to the above thread.

@Work991
Copy link

Work991 commented May 11, 2023

/home/pzserver1/.pzst/config.json

{
	"admin": "admin",
	"maxmem": 64
}

The system does not read this instruction to use.when restart daily

Performing daily restart (05:00)
pzserver1: Restart job started (delay: 0, restart_sequence: [5, 3, 2, 1, 0.5])
pzserver1: Sending message: Restarting server in 5:00 minutes. Find a safe place to hide for restart!
pzserver1: Sending message: Restarting server in 3:00 minutes. Find a safe place to hide for restart!
pzserver1: Sending message: Restarting server in 2:00 minutes. Find a safe place to hide for restart!
pzserver1: Sending message: Restarting server in 1:00 minute. Find a safe place to hide for restart!
pzserver1: Sending message: Restarting server in 30 seconds. Find a safe place to hide for restart!
pzserver1: Stopping now!
pzrestartjob status: 0
Redirecting stderr to '/home/pzserver1/Steam/logs/stderr.txt'
[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation - version 1682708339
-- type 'quit' to exit --
Loading Steam API...OK

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
 Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
 Update state (0x5) verifying install, progress: 15.93 (844694524 / 5302076292)
 Update state (0x5) verifying install, progress: 33.54 (1778362997 / 5302076292)
 Update state (0x5) verifying install, progress: 55.03 (2917565117 / 5302076292)
 Update state (0x5) verifying install, progress: 77.35 (4101167833 / 5302076292)
 Update state (0x5) verifying install, progress: 96.88 (5136414530 / 5302076292)
Success! App '380870' fully installed.
OK
pzinstall status: 0
OK
pzstart status: 0

@quarantin quarantin reopened this May 14, 2023
@quarantin
Copy link
Owner

Which OS/Version are you using?

@Work991
Copy link

Work991 commented May 18, 2023

Which OS/Version are you using?

Ubuntu 20.4

@Work991
Copy link

Work991 commented May 18, 2023

Same problem with this case.

#29

@quarantin
Copy link
Owner

I tried again to reproduce your issue without luck.

I did the following:

  • Setup fresh install
  • Login as pzserver1:
sudo -i -u pzserver1
  • Set max memory to 4GB (Default is 8GB):
pzserver maxmem 4
  • Start the pzserver:
pzserver start
  • Once pzserver is responsive (ie you can join the game), initiate a restart:
pzserver restart
  • After the restart my ProjectZomboid64.json still contains: "-Xmx4g"

Can you try to login as pzstadmin and show me the last commit you have? Here are the steps:

sudo -i -u pzstadmin
cd pz-server-tools
git log | head -n1

@quarantin
Copy link
Owner

Also I know some hosting provider ship modified versions of Ubuntu which can break pzst. Can you show me the output of the following command?

lsb_release -a

@Work991
Copy link

Work991 commented May 22, 2023

Also I know some hosting provider ship modified versions of Ubuntu which can break pzst. Can you show me the output of the following command?

lsb_release -a

image

image

@quarantin
Copy link
Owner

OK then it's really weird. Probably something went wrong during install. I suppose you already tried to reinstall pzst? (It won't delete your saved game). If you already did, I don't know how to help except by looking myself at your server to troubleshoot the issue. Would that be OK to you?

@Work991
Copy link

Work991 commented May 22, 2023

OK then it's really weird. Probably something went wrong during install. I suppose you already tried to reinstall pzst? (It won't delete your saved game). If you already did, I don't know how to help except by looking myself at your server to troubleshoot the issue. Would that be OK to you?

1 17 * * * sudo -u "$user" pzserver restart
I use this command
.prevent the reset-Xmx64 return to default -Xmx8

use nano /etc/pzst/config.json
Set a daily restart The value will default back to -Xmx8.

@quarantin
Copy link
Owner

OK, now we're talking. I can indeed reproduce the issue.

@quarantin
Copy link
Owner

Hum, really weird, if I run pzserver install after the planned restart, then it will update the value in ProjectZomboid64.json correctly. But the daily restart script calls this command 🤔

@quarantin
Copy link
Owner

OK good news, I found the culprit. Basically from pzinstall I call pzmaxmem, which rely on the USER environment variable to be set, but it's not the case when running from cron. I will issue a patch soon.

@Work991
Copy link

Work991 commented May 22, 2023

thank you

@quarantin
Copy link
Owner

All right, it should be fixed. Sorry for the delay to troubleshoot this problem. Please reopen this issue if the fix is not satisfying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants