Daily performance reports keep asking to rebuild container


(Michael Downey) #1

Reproduce:

  1. Enable the site setting daily performance report (“Analyze NGINX logs daily and post a Staff Only topic with details”).

  2. Update the Docker image:

    cd /var/discourse
    ./launcher rebuild app

Expected Results:

  • A report appears in the “Staff” category periodically.

Actual Results:

  • An error message appears in the “Website performance reports” topic in the “Staff” category:

Report is only available in latest image, please run:
cd /var/discourse
./launcher rebuild app


Daily perf reports asking to rebuild container on new install
(Rafael dos Santos Silva) #2

You need a git pull before the rebuild as seen here:


(Jeff Atwood) #3

Not necessarily I thought the launcher command did an implicit git pull @sam?


(Sam Saffron) #4

That change was only made in the last year, very possible @downey has an older git repo.


(Michael Downey) #5

Don’t know exactly when the change happened but I thought I’d updated
fairly recently. After doing the first rebuild I could have sworn I saw a
git pull but I didn’t watch carefully enough. As soon as I can take a
little more downtime (probably tonight) will try again.


(Michael Downey) #6

I definitely did a full git pull and then ./launcher rebuild app last night … but still getting the same bug every day instead of a performance report.

Can anyone reproduce? Is anyone able to successfully get the performance report?


(Stefan) #7

I’m having the same issue. My guess is that because ./launcher rebuild says “Your version of Discourse Docker is ahead of origin” when git tries to get the latest version, so the latest version is never pulled?


(Sam Saffron) #8

Likely, can you just check out discourse-docker from scratch?


(Stefan) #9

Actually what I did was git reset --hard origin/master to have the repository in sync again and then another./launcher rebuild (that didn’t trigger the “ahead of origin” message). Now I’l wait to see if I get the reports. Is there any way to trigger those reports manually so that I don’t have to wait?


(Stephen) #10

Visit /sidekiq/scheduler and trigger Jobs::DailyPerformanceReport AFAIK?


(Stefan) #11

That worked, thanks! Now I get the report and that’s really nice!


(Michael Downey) #12

FWIW, I did the git reset --hard origin/master and then ./launcher rebuild app and still have the same problem.


(Michael Downey) #13

Has anyone else seen this problem? (Or can reproduce it if they’re willing to try to enable the option?)

Edit: @Lee_Ars & @Sander78 you were both reporting this in another now-locked topic, are you still having the problem?

Is there somewhere I could look to see if my Docker image is the right version or has the right code to do this?


(Sander Datema) #14

Yep, still there. Eventually I turned it off.


(Sam Saffron) #15

If you give me access to your host I can have a quick look


(Sam Saffron) #16

I don’t want to cause an outage @downey but you have an old pattern in your template:

You have:

volumes:
  - volume:
      host: /var/discourse/shared
      guest: /shared

It should be:

volumes:
  - volume:
      host: /var/discourse/shared
      guest: /shared

  - volume:
      host: /var/discourse/shared/var-logs
      guest: /var/log

This in turn causes 2 things:

  1. You are storing logs inside the container… which is bad
  2. Permissions are not ideal on that logs

(Daniela) #17

In my case the sysadmin deleted Staff category when we installed discourse (3 years ago).

Now I have create another Staff category (only admins and staff can create/reply/see it).
This category was created before the last upgrade to Discourse Docker Image 1.3.3 (so we have git pull and rebuild all and the upgrade was a success).

By the way in logs I have this error when I trigger Jobs::DailyPerformanceReport in sidekiq:


Have I missed something?


(Michael Downey) #18

So this week I did a completely new install on a new box following the standard instructions and script, and this problem is back :frowning:


(Kane York) #19

You need to set the hidden site setting staff_category_id to the ID of the new staff category.

There’s no UI to do this (because it’s hidden, you’re not supposed to change it), so you need to muck with request editing :confused:


Analyzing Discourse Performance using NGINX logs
(Michael Downey) #20

Looking at the “stock” out of the box installation, I see the following volumes that were set up:

volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

Anything wrong with that that would be causing this problem to appear?