Docker_manager returns null for progress despite there being progress

If during an upgrade I check the progress of said upgrade via the API, I get null progress (logs and percentage) even though the UI shows progress.

The command I’m running is this:

curl -X GET "https://example.com/admin/docker/progress" -H "Content-Type: multipart/form-data;" -d "path=all" -d "api_key=1234" -d "api_username=system"

In the beginning of the upgrade, the output I get looks like this:

{"progress":{"logs":"********************************************************\n*** Please be patient, next steps might take a while ***\n********************************************************\nCycling Unicorn, to free up memory\nRestarting unicorn pid:... 386\n","percentage":"10"}}

In the middle of the upgrade, the output looks like this:

{"progress":{"logs":null,"percentage":null}}

I believe the progress goes to null right when the job queue is stopped. The admin UI still shows lots of progress (the below log is from the UI), but the progress via API remains at null.

Stopping job queue to reclaim memory, master pid is 386
$ cd /var/www/discourse && git fetch --tags && git reset --hard HEAD@{upstream}
From https://github.com/discourse/discourse
 - [tag update]      latest-release -> latest-release
HEAD is now at 6525613 PERF: Use joins for `Post.for_mailing_list` instead of `NOT IN`.
$ cd /var/www/discourse/plugins/discourse-custom-wizard && git fetch --tags && git reset --hard HEAD@{upstream}
HEAD is now at e127d0c Merge pull request #7 from procourse/fix_footer_logo

Any ideas what’s going on?

3 Likes

I know the UI is getting updated through the MessageBus, so I’m wondering if when the Unicorn workers are stopped, the API endpoint you’re looking at doesn’t update or isn’t accessible at that time.

https://github.com/discourse/docker_manager/blob/3fedba4a4df5ebe5183e3b0bb52541d0b67ee90c/lib/docker_manager/upgrader.rb#L115-L120

2 Likes

Is there an alternative way of getting progress? I just need to know if the upgrade is still ongoing. The status doesn’t seem to be in /var/www/discourse/log/production.log and I’m open to hackery methods like scraping the upgrade page…