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

Deletion messages for old backup files are not posted to Discord #501

Closed
3 of 4 tasks
makotsuba opened this issue Mar 10, 2024 · 3 comments · Fixed by #502
Closed
3 of 4 tasks

Deletion messages for old backup files are not posted to Discord #501

makotsuba opened this issue Mar 10, 2024 · 3 comments · Fixed by #502
Labels
bug Something isn't working urgency:medium Needs to be fixed in the upcoming week

Comments

@makotsuba
Copy link
Contributor

makotsuba commented Mar 10, 2024

Describe the bug

I set up a webhook to notify Discord when old backups are automatically deleted.
However, since applying release version 0.31.0, no message is being sent.

To Reproduce

Steps to reproduce the behavior:

  1. Set each environment variable 'DISCORD_PRE_BACKUP_DELETE_URL and DISCORD_POST_BACKUP_DELETE_URL' in the .env file
  2. Start the server
  3. The process will run at the time specified in BACKUP_CRON_EXPRESSION
  4. The old backup files are deleted, but no message is sent

Expected behavior

Old backup files are deleted and the message specified in DISCORD_PRE_BACKUP_DELETE_MESSAGE and DISCORD_POST_BACKUP_DELETE_MESSAGE is sent.

Actual behavior

Old backup was deleted, but no message was sent.

Screenshots

OS information (IMPORTANT)

  • OS: Synology DSM 7.2.1-69057 Update 4
  • Palworld Version: 0.1.5.1
  • Docker Image Version: 0.32.0

Hardware information (IMPORTANT)

  • CPU: AMD Ryzen R1600 (dual core)
  • Memory: 4GB ddr4 ecc unbuffered sodimm

docker-compose.yml contents (IMPORTANT)

docker-compose.yml
services:
   palworld:
      image: thijsvanloef/palworld-server-docker:latest
      restart: unless-stopped
      container_name: palworld-server
      stop_grace_period: 30s # Set to however long you are willing to wait for the container to gracefully stop
      ports:
        - 8211:8211/udp
        - 27015:27015/udp
      env_file:
         -  .env
      volumes:
         - /volume1/docker/palworld:/palworld/

Container/Host Logs (IMPORTANT)

Logs
2024/03/10 08:00:01	stderr	time="2024-03-10T08:00:01+09:00" level=info msg="job succeeded" iteration=7 job.command="bash /usr/local/bin/update" job.position=1 job.schedule="0 * * * *"
2024/03/10 08:00:01	stderr	time="2024-03-10T08:00:01+09:00" level=info msg="\x1b[1;32mThe Server is up to date!\x1b[0m" channel=stdout iteration=7 job.command="bash /usr/local/bin/update" job.position=1 job.schedule="0 * * * *"
2024/03/10 08:00:01	stderr	time="2024-03-10T08:00:01+09:00" level=info msg="\x1b[0;37mCurrent Version: 2815085007637542021\x1b[0m" channel=stdout iteration=7 job.command="bash /usr/local/bin/update" job.position=1 job.schedule="0 * * * *"
2024/03/10 08:00:00	stderr	time="2024-03-10T08:00:00+09:00" level=info msg="\x1b[1;36m****Checking for new update****\x1b[0m" channel=stdout iteration=7 job.command="bash /usr/local/bin/update" job.position=1 job.schedule="0 * * * *"
2024/03/10 08:00:00	stderr	time="2024-03-10T08:00:00+09:00" level=info msg=starting iteration=7 job.command="bash /usr/local/bin/update" job.position=1 job.schedule="0 * * * *"
2024/03/10 07:00:01	stderr	time="2024-03-10T07:00:01+09:00" level=info msg="job succeeded" iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 7 * * *"
2024/03/10 07:00:01	stderr	time="2024-03-10T07:00:01+09:00" level=info msg="job succeeded" iteration=6 job.command="bash /usr/local/bin/update" job.position=1 job.schedule="0 * * * *"
2024/03/10 07:00:01	stderr	time="2024-03-10T07:00:01+09:00" level=info msg="\x1b[1;32mThe Server is up to date!\x1b[0m" channel=stdout iteration=6 job.command="bash /usr/local/bin/update" job.position=1 job.schedule="0 * * * *"
2024/03/10 07:00:01	stderr	time="2024-03-10T07:00:01+09:00" level=info msg="\x1b[0;37mCurrent Version: 2815085007637542021\x1b[0m" channel=stdout iteration=6 job.command="bash /usr/local/bin/update" job.position=1 job.schedule="0 * * * *"
2024/03/10 07:00:00	stderr	time="2024-03-10T07:00:00+09:00" level=info msg="\x1b[0;37mSending Discord json: {\"embeds\":[{\"title\":\"Backup\",\"description\":\"Backup created at /palworld/backups/palworld-save-2024-03-10_07-00-00.tar.gz\",\"color\":52224}]}\x1b[0m" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 7 * * *"
2024/03/10 07:00:00	stderr	time="2024-03-10T07:00:00+09:00" level=info msg=/palworld/backups/palworld-save-2024-02-07_12-30-01.tar.gz channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 7 * * *"
2024/03/10 07:00:00	stderr	time="2024-03-10T07:00:00+09:00" level=info msg="\x1b[0;37mRemoving backups older than 30 days\x1b[0m" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 7 * * *"
2024/03/10 07:00:00	stderr	time="2024-03-10T07:00:00+09:00" level=info msg="\x1b[1;36m****Removing Old Backups****\x1b[0m" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 7 * * *"
2024/03/10 07:00:00	stderr	time="2024-03-10T07:00:00+09:00" level=info msg="\x1b[0;37mBackup created at /palworld/backups/palworld-save-2024-03-10_07-00-00.tar.gz\x1b[0m" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 7 * * *"
2024/03/10 07:00:00	stderr	time="2024-03-10T07:00:00+09:00" level=info msg="\x1b[1;36m****Creating backup****\x1b[0m" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 7 * * *"
2024/03/10 07:00:00	stderr	time="2024-03-10T07:00:00+09:00" level=info msg="Complete Save" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 7 * * *"
2024/03/10 07:00:00	stderr	time="2024-03-10T07:00:00+09:00" level=info msg="\x1b[0;37mSending Discord json: {\"embeds\":[{\"title\":\"Backup\",\"description\":\"Creating backup...\",\"color\":15258703}]}\x1b[0m" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 7 * * *"
2024/03/10 07:00:00	stderr	time="2024-03-10T07:00:00+09:00" level=info msg="\x1b[1;36m****Checking for new update****\x1b[0m" channel=stdout iteration=6 job.command="bash /usr/local/bin/update" job.position=1 job.schedule="0 * * * *"
2024/03/10 07:00:00	stderr	time="2024-03-10T07:00:00+09:00" level=info msg=starting iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 7 * * *"
2024/03/10 07:00:00	stderr	time="2024-03-10T07:00:00+09:00" level=info msg=starting iteration=6 job.command="bash /usr/local/bin/update" job.position=1 job.schedule="0 * * * *"

Additional context

The following is a list of the environment variables set in .env that are relevant to this case.
The webhook url has been replaced with another.

.env
DELETE_OLD_BACKUPS=true
BACKUP_CRON_EXPRESSION=0 7 * * *
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/A
DISCORD_PLAYER_JOIN_MESSAGE_URL=https://discord.com/api/webhooks/B
DISCORD_PLAYER_LEAVE_MESSAGE_URL=https://discord.com/api/webhooks/B
DISCORD_PRE_BACKUP_MESSAGE_URL=https://discord.com/api/webhooks/B
DISCORD_POST_BACKUP_MESSAGE_URL=https://discord.com/api/webhooks/B
DISCORD_PRE_BACKUP_DELETE_URL=https://discord.com/api/webhooks/B
DISCORD_POST_BACKUP_DELETE_URL=https://discord.com/api/webhooks/B
DISCORD_ERR_BACKUP_DELETE_URL=https://discord.com/api/webhooks/B

I cannot check the behavior of the DISCORD_ERR_BACKUP_DELETE environment variable, but it may not send the message as well as DISCORD_{PRE, POST}_BACKUP_DELETE.

Bug Report Checklist

  • I searched for my issue on the Known issues page
  • I searched for my issue in the Closed issues
  • I have included all relevant information required above.
  • I am willing to fix this bug
@makotsuba makotsuba added the triage Deciding urgency label Mar 10, 2024
@xHyperElectric
Copy link
Contributor

This is very similar to #496

@Diyagi
Copy link
Contributor

Diyagi commented Mar 10, 2024

There is an inconsistency in the env vars between what the backup script uses and what the dockerfile and documentation says/uses.

The backup script checks for DISCORD_PRE_BACKUP_DELETE_MESSAGE_ENABLED and DISCORD_POST_BACKUP_DELETE_MESSAGE_ENABLED, but both the documentation and dockerfile uses DISCORD_PRE_BACKUP_DELETE_ENABLED and DISCORD_POST_BACKUP_DELETE_ENABLED.

Not going to open an PR because i dont know which one to favor, so i will leave to someone else to decide.

@thijsvanloef
Copy link
Owner

thijsvanloef commented Mar 10, 2024

@Diyagi thanks for taking the time to look into it. I ment to name it DISCORD_PRE_BACKUP_DELETE_MESSAGE_ENABLED and DISCORD_POST_BACKUP_DELETE_MESSAGE_ENABLED, but I must have made a copy paste mistake somewhere down the line.
Will take a look at it tonight.

@thijsvanloef thijsvanloef linked a pull request Mar 10, 2024 that will close this issue
4 tasks
@thijsvanloef thijsvanloef added bug Something isn't working urgency:medium Needs to be fixed in the upcoming week and removed triage Deciding urgency labels Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working urgency:medium Needs to be fixed in the upcoming week
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants