Rebuild fails (Malformed version number string)

I am trying to rebuild an older install (3.1.0.beta5) to update a plugin without updating Discourse. In the containers/app.yaml we have version locked to a specific git hash.

This has worked for us in the past, but today the rebuild failed. The error in the logs is:

ArgumentError: Malformed version number string < 3.3.0.beta1-dev

I found a few older threads about this that mention a CLI rebuild should fix any issues, but I’ve tried this a few times and it won’t go through.

Any ideas?

Here is a slice of the error (plus some lines above/below).

Bundle complete! 137 Gemfile dependencies, 173 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into `./vendor/bundle`

I, [2024-05-15T20:59:06.357437 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all'
rake aborted!
ArgumentError: Malformed version number string < 3.3.0.beta1-dev
/var/www/discourse/lib/version.rb:44:in `block in find_compatible_resource'
/var/www/discourse/lib/version.rb:44:in `each'
/var/www/discourse/lib/version.rb:44:in `sort_by'
/var/www/discourse/lib/version.rb:44:in `find_compatible_resource'
/var/www/discourse/lib/version.rb:79:in `find_compatible_git_resource'
/var/www/discourse/lib/tasks/plugin.rake:140:in `block in <main>'
/var/www/discourse/lib/tasks/plugin.rake:121:in `block (2 levels) in <main>'
/var/www/discourse/lib/tasks/plugin.rake:119:in `each'
/var/www/discourse/lib/tasks/plugin.rake:119:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => plugin:pull_compatible
(See full trace by running task with --trace)
I, [2024-05-15T20:59:08.586468 #1]  INFO -- :
I, [2024-05-15T20:59:08.586890 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2024-05-15T20:59:08.589266 #1]  INFO -- : > sleep 10
4224:C 15 May 2024 20:59:08.593 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
4224:C 15 May 2024 20:59:08.593 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=4224, just started
4224:C 15 May 2024 20:59:08.593 # Configuration loaded
4224:M 15 May 2024 20:59:08.594 * monotonic clock: POSIX clock_gettime
4224:M 15 May 2024 20:59:08.594 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
4224:M 15 May 2024 20:59:08.594 # Failed listening on port 6379 (TCP), aborting.
I, [2024-05-15T20:59:18.592023 #1]  INFO -- :
I, [2024-05-15T20:59:18.592525 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
I, [2024-05-15T20:59:22.569878 #1]  INFO -- :
I, [2024-05-15T20:59:22.570279 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile:build'
rake aborted!
Don't know how to build task 'assets:precompile:build' (See the list of available tasks with `rake --tasks`)
Did you mean?  assets:precompile
               assets:precompile:css
               assets:precompile:before
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
(See full trace by running task with --trace)
I, [2024-05-15T20:59:23.600115 #1]  INFO -- :
I, [2024-05-15T20:59:23.600637 #1]  INFO -- : Terminating async processes
I, [2024-05-15T20:59:23.600673 #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: 35
2024-05-15 20:59:23.600 UTC [35] LOG:  received fast shutdown request
I, [2024-05-15T20:59:23.600751 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 97
97:signal-handler (1715806763) Received SIGTERM scheduling shutdown...
2024-05-15 20:59:23.605 UTC [35] LOG:  aborting any active transactions
2024-05-15 20:59:23.607 UTC [35] LOG:  background worker "logical replication launcher" (PID 50) exited with exit code 1
2024-05-15 20:59:23.609 UTC [45] LOG:  shutting down
2024-05-15 20:59:23.651 UTC [35] LOG:  database system is shut down
97:M 15 May 2024 20:59:23.666 # User requested shutdown...
97:M 15 May 2024 20:59:23.666 * Saving the final RDB snapshot before exiting.
97:M 15 May 2024 20:59:23.715 * DB saved on disk
97:M 15 May 2024 20:59:23.715 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile:build' failed with return #<Process::Status: pid 4246 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"build", "hook"=>"assets_precompile_build", "cmd"=>["su discourse -c 'bundle exec rake assets:precompile:build'"]}
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.
d64132a4857117bb081fcc96afed62539cf84318342a258d42bf23b4736b0d9b

I recommend that you get things updated,but that’s not what you asked.

Did you also pin discourse_docker to the same version from days of yore? I think that’s where the error is coming from.

Would the best way to do this be to grab the image (discourse/base:2.0.20230825-1850) from the current launcher, and then run rebuild with --run-image=discourse/base:2.0.20230825-1850 as an option? Or is there a different/better way to pin us to the same docker version?

What’s wrong with updating the plugin from the online upgrade which can be done in isolation?

4 Likes

I’m not sure why I didn’t try that first. Thanks @merefield!

2 Likes