Discourse on Docker - Backup link 404

Hi all,

Issue:
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
./discourse-setup
  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

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

/var/discourse/shared/standalone/backups/default

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?

4 Likes

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.

2 Likes

Hey Gerhard,

Just to make you aware, I needed to update my subdomain, so I rebuild the container (as recommended by Claudia) and it fixed the double dots issue in the mail.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.