Rebuilding Discourse after invalid GitHub repo addition

I’m experiencing an issue with my Discourse site after mistakenly adding an invalid GitHub repository to the app.yml file. When I ran ./launcher rebuild app, the process failed, and now the site won’t rebuild. Unfortunately, I have backups but they fail during the restore process. Below are the details of the issue, including the entire error log.

Steps Taken:

  1. I attempted to add DeepSeek LLM to my Discourse installation following the guidance from this post.
  2. I added the repository URL https://github.com/deepseek-ai/DeepSeek-LLM to the app.yml file.
  3. Ran ./launcher rebuild app, which failed and caused the site to become non-functional.

Full Error Log:

plaintext

CopyEdit

(See full trace by running task with --trace)
I, [2025-01-21T02:32:16.599723 #1]  INFO -- : gem install multipart-post -v 2.4.0 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed multipart-post-2.4.0
1 gem installed
gem install faraday-multipart -v 1.0.4 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed faraday-multipart-1.0.4
1 gem installed
gem install event_stream_parser -v 1.0.0 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed event_stream_parser-1.0.0
1 gem installed
gem install ruby-openai -v 7.0.0 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed ruby-openai-7.0.0
1 gem installed
gem install tokenizers -v 0.4.4 -i /var/www/discourse/plugins/discourse-ai/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed tokenizers-0.4.4-x86_64-linux
1 gem installed
gem install tiktoken_ruby -v 0.0.9 -i /var/www/discourse/plugins/discourse-ai/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed tiktoken_ruby-0.0.9-x86_64-linux
1 gem installed
gem install ed25519 -v 1.2.4 -i /var/www/discourse/plugins/discourse-ai/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Building native extensions. This could take a while...
Successfully installed ed25519-1.2.4
1 gem installed
... (more gem installation logs) ...
I, [2025-01-21T02:32:16.600035 #1]  INFO -- : Terminating async processes
I, [2025-01-21T02:32:16.600051 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 39
I, [2025-01-21T02:32:16.600103 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 107
2025-01-21 02:32:16.600 UTC [39] LOG:  received fast shutdown request
107:signal-handler (1737426736) Received SIGTERM scheduling shutdown...
2025-01-21 02:32:16.602 UTC [39] LOG:  aborting any active transactions
2025-01-21 02:32:16.604 UTC [39] LOG:  background worker "logical replication launcher" (PID 54) exited with exit code 1
2025-01-21 02:32:16.605 UTC [49] LOG:  shutting down
107:M 21 Jan 2025 02:32:16.612 # User requested shutdown...
107:M 21 Jan 2025 02:32:16.612 * Saving the final RDB snapshot before exiting.
2025-01-21 02:32:16.634 UTC [39] LOG:  database system is shut down
107:M 21 Jan 2025 02:32:16.667 * DB saved on disk
107:M 21 Jan 2025 02:32:16.667 # Redis is now ready to exit, bye bye...
> FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 837 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

Challenges:

  • I cannot restore the site from a backup.
  • Rebuilding fails consistently, leaving the site inoperable.

Request for Help:

  1. How can I approach these issues, running the rebuild app must have created an erroneous plugin or similar?
  2. Are there any manual recovery steps?
  3. Any suggestions for safely rebuilding the site from this state?

I signed up for a hosted Discourse instance and uploaded a backup but the restore option does not appear even though the file uploaded normally.

I greatly appreciate any advice or guidance on how to proceed. Please let me know if further details are needed!

If you remove the plugin, the rebuilds still fail?

Also, that repository is not a plugin. It is the source code for Deepseek. I think what Sam was referring to was to make a plugin out of it?

1 Like

And the manual recovery step is ./launcher start app — if the last alive container is not destroyed. And removing that repo from app.yml and rebuilding after that.

1 Like

Is the above the failure? You need to include the part above that shows what migration is failing.

My guess is that you either still have some broken plugin or a formatting error in your yml file, but it’s impossible to tell with the information you have proivded.

To restore a backup you have to email team@discourse.org and ask them to restore it.

1 Like

Remove this ASAP.

GitHub - deepseek-ai/DeepSeek-LLM: DeepSeek LLM: Let there be answers is not a Discourse plugin, so it shouldn’t ever appear in a app.yml file.

6 Likes

Appreciate everyone and your feedback. I cannot explain how this was resolved but it appears to be working. First thing I did when I realized my error in placing the non plugin GitHub repository in app.yml and crashing discourse was to remove that line and try and rebuild without success. I rebooted the server several times without success. Rebooting would return site to operation but rebuilding from admin or ssh would crash again. Then suddenly BAM it rebuilt from SSH and then later updated the plugins and rebuilt from admin. I now updated Ubuntu and seem to be okay. Seems to be solved but still a bit of a mystery. :partying_face:

3 Likes