Discourse on Docker - Backup link 404

Hi all,

After generating a backup, receiving the link to download it by email, I’m redirecting to a 404 page.
Few minutes later, if I use the same link I’m receiving Sorry, this backup download link has already been used or has expired.

Step to reproduce

  1. Install Discourse for Docker
  1. Go to the Admin panel, Backups tabs and create a Backup. (backups are saved in local storage)

  2. The new backup generated will appear in the list

  3. Click on Download , and you will receive A link to download this backup has been emailed to you.

  4. You will receive an email like this:

Here’s the site backup download (https://discourse.XXX.com/admin/backups/XXX-2023-03-15-145648-v20230308042434..tar.gz?token=<MyToken>) you requested.

  1. After clicking on the link, I’m facing to a blank page with a 404.
    If I right click to save the link, it will download a corrupted zip file.

Nginx logs:
[15/Mar/2023:15:22:15 +0000] "discourse.XXX.com" <myIpAddress> "GET /admin/backups/XXX-2023-03-15-145648-v20230308042434..tar.gz?token=<myToken> HTTP/2.0" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0" "backups/show" 404 822 "-" 0.820 0.821 "Isso" "-" "-" "-" "-" "-" "-"

There is nothing in error.log

What’s the backup path folder ?
How can I troubleshoot this issue ?


1 Like

That’s weird! Where’s the second dot coming from? I can’t reproduce the issue and I’ve never seen that behavior before. So, I don’t have an explanation for it. Any chance that something manipulates the link in your email?


Good catch!

I haven’t changed anything in customizetext

That’s my default email:

Here's the [site backup download](%{backup_file_path}) you requested.

We sent this download link to your validated email address for security reasons.

(If you *didn't* request this download, you should be seriously concerned -- someone has admin access to your site.)

I installed Discourse yesterday from this Git repositroy, and I followed this guide

I’m gonna have a deeper look tomorrow.

At least I can download the backups now :slight_smile:

I’ve seen this before on a friend’s instance, never did figure out the root cause though. It did it for about a month and then after a CLI rebuild of the container it stopped doing it.

I wanted to update my subdomain, so I can give a try to rebuild the container, but just to confirm : This should not reset my configuration / theme / data etc. ?

Looking at /var/discourse/shared/standalone mentioned by Jay, I believe this is where the data are persisted correct ?

1 Like