Latest update won't build due to various reasons

Latest update wont build with the following errors. Failed on UI update and CLI.

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 921 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.
f7f7afc677212ddcaaa8e1979af5ddef79b3accffe118da6c9542682c104bc27
==================== END REBUILD LOG ====================
Failed to rebuild app.

Seems to be this related to this

I, [2024-07-03T21:28:32.470814 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
2024-07-03 21:28:41.149 UTC [982] discourse@discourse ERROR:  column llm_models.url does not exist at character 47
2024-07-03 21:28:41.149 UTC [982] discourse@discourse STATEMENT:  SELECT "llm_models".* FROM "llm_models" WHERE "llm_models"."url" = 'https://vllm.shadowed-by-srv.invalid' LIMIT 1
** PLUGIN FAILURE **

You are unable to start Discourse due to this error during plugin
initialization:

PG::UndefinedColumn: ERROR:  column llm_models.url does not exist
LINE 1: SELECT "llm_models".* FROM "llm_models" WHERE "llm_models"."...
                                                      ^

1 Like

Commenting out the ai plugin allows it to proceed but then get this error:

Zlib::BufError: buffer error (Zlib::BufError)

I, [2024-07-03T21:43:28.020091 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'SKIP_EMBER_CLI_COMPILE=1 bundle exec rake themes:update assets:precompile'
Purging temp files
Bundling assets
I, [2024-07-03T21:43:40.638114 #1052]  INFO -- : Writing /var/www/discourse/public/assets/break_string-cc617154cd957804f2f6a1f3bc68258c9cdca3d4b9a322bf777d145fed04790e.js
I, [2024-07-03T21:43:40.651072 #1052]  INFO -- : Writing /var/www/discourse/public/assets/service-worker-6454e7c107371e6b523b833c685557b98b38cf2f4a5eb24ff8855c1abc2da918.js
I, [2024-07-03T21:43:40.655519 #1052]  INFO -- : Writing /var/www/discourse/public/assets/locales/i18n-3b40e842fd72b9bcc74ea83e094c823cd9ca535e4ecc5e78722e6f99d3656137.js
I, [2024-07-03T21:43:40.659004 #1052]  INFO -- : Writing /var/www/discourse/public/assets/scripts/discourse-test-listen-boot-9b14a0fc65c689577e6a428dcfd680205516fe211700a71c7adb5cbcf4df2cc5.js
I, [2024-07-03T21:43:41.592285 #1052]  INFO -- : Writing /var/www/discourse/public/assets/locales/ar-d1106ddae8b17f20c063785fe90a3ffc1f919b2116980066eeadb0e1b418e060.js
I, [2024-07-03T21:43:42.009879 #1052]  INFO -- : Writing /var/www/discourse/public/assets/locales/be-f0f585d6b0bb87eff0aa46461d4ab6c16270d7fbc4ffe653640da41ecb55a684.js
I, [2024-07-03T21:43:42.414089 #1052]  INFO -- : Writing /var/www/discourse/public/assets/locales/bg-c27a4d2615e98a27acebcb9ffb14d25183cde5b45c75701a58b65b967573fd58.js
rake aborted!
Zlib::BufError: buffer error (Zlib::BufError)
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cache/file_store.rb:100:in `<<'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cache/file_store.rb:100:in `set'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cache.rb:212:in `set'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cache.rb:136:in `set'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:243:in `store_asset'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:185:in `load_from_unloaded'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:60:in `block in load'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:44:in `load'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cached_environment.rb:47:in `load'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/bundle.rb:23:in `block in call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/utils.rb:201:in `dfs'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/bundle.rb:24:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/processor_utils.rb:75:in `call_processor'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/processor_utils.rb:56:in `call_processors'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:60:in `block in load'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/loader.rb:44:in `load'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/cached_environment.rb:47:in `load'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/base.rb:66:in `find_asset'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/manifest.rb:134:in `block in find'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/manifest.rb:133:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/manifest.rb:133:in `find'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/sprockets/manifest.rb:186:in `compile'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-rails-3.5.1/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-3.7.3/lib/rake/sprocketstask.rb:147:in `with_logger'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sprockets-rails-3.5.1/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
1 Like

Ah thats a separate issue: "Zlib::BufError: buffer error" - Discourse update fails - #6 by AquaL1te

I added DISCOURSE_MAXMIND_ACCOUNT_ID: 0000 into app.yml (With the actual account ID) and it still errors with Zlib::BufError: buffer error (Zlib::BufError)

Comment out maxmind and try again.

That’s allowed it to build as a workaround but can’t get it to build with it.

Does it matter which way DISCOURSE_MAXMIND_ACCOUNT_ID are listed in the config? Im going to rebuild it at some point testing having it above the license key,

Now we’ve got a blank forum, jumps around when trying to interact with the menus

console errors

Uncaught SyntaxError: Unexpected identifier '#t'
discourse-cakeday-14…0c79d9ecda.br.js:67 Uncaught SyntaxError: Unexpected identifier '#t'
discourse-gamificati…aa953738d0.br.js:26 Uncaught SyntaxError: Unexpected identifier '#a'
discourse-gamificati…cc07ea7ef08.br.js:3 Uncaught SyntaxError: Unexpected identifier '#a'
discourse-lazy-video…b8ed6127f2.br.js:10 Uncaught SyntaxError: Unexpected identifier '#t'
discourse-presence-f…3c0d7b6fc3.br.js:12 Uncaught SyntaxError: Unexpected identifier '#s'
discourse-reactions-…901cb11c9e5.br.js:9 Uncaught SyntaxError: Unexpected identifier '#t'
docker_manager_admin…d28929dca4.br.js:11 Uncaught SyntaxError: Unexpected identifier '#t'
poll-796d99d66969f1b…fe7802fab0d.br.js:4 Uncaught SyntaxError: Unexpected identifier '#e'
admin-67b2706032147c…37109c4686.br.js:79 Uncaught SyntaxError: Unexpected identifier '#r'
39e5219……a6253fbac792b5.js:9 Uncaught SyntaxError: Unexpected identifier '#t'
8e35ecd……431326f726d28.js:14 Uncaught SyntaxError: Unexpected identifier '#c'
80f289f……3ae3799840269e.js:7 Uncaught SyntaxError: Unexpected identifier '#t'
0ca3731……0183b04205b2c7.js:5 Uncaught SyntaxError: Unexpected identifier '#e'
chunk.2e73082f9f5aebde95db.d41d8cd9.br.js:65 ℹ️ Discourse v3.3.0.beta4-dev — https://github.com/discourse/discourse/commits/70fc39211b — Ember v5.5.0
mini-profiler-resources/results:1 
        
        
       Failed to load resource: the server responded with a status of 429 ()
mini-profiler-resources/results:1 
        
        
       Failed to load resource: the server responded with a status of 429 ()
mini-profiler-resources/results:1 
        
        
       Failed to load resource: the server responded with a status of 429 ()
mini-profiler-resources/results:1 
        
        
       Failed to load resource: the server responded with a status of 429 ()
mini-profiler-resources/results:1 
        
        
       Failed to load resource: the server responded with a status of 429 ()
mini-profiler-resources/results:1 
        
        
       Failed to load resource: the server responded with a status of 429 ()
mini-profiler-resources/results:1 
        
        
       Failed to load resource: the server responded with a status of 429 ()
vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9 Uncaught (in promise) Error: There is no route named admin
    at P.handlersFor (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:384138)
    at o.isActiveForRoute (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:183474)
    at ue.isActiveForState (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:22532)
    at get isActive (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:21552)
    at get class (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:20303)
    at Te (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:76425)
    at vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:266639
    at vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:266302
    at e.track (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:345848)
    at d (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:266281)
    at vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:302259
    at vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:266302
    at e.track (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:345848)
    at d (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:266281)
    at Je (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:302493)
    at Qe.flush (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:301801)
    at Object.evaluate (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:295357)
    at Object.evaluate (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:282821)
    at It.evaluateSyscall (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:318887)
    at It.evaluateInner (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:318579)
    at It.evaluateOuter (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:318500)
    at Wt.next (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:328385)
    at Wt._execute (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:328263)
    at Wt.execute (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:328209)
    at Qt.sync (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:328863)
    at hr.render (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:51968)
    at vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:55529
    at Nt (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:317369)
    at gr._renderRoots (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:55447)
    at gr._renderRootsTransaction (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:55807)
    at gr._renderRoot (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:55324)
    at gr._appendDefinition (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:54370)
    at gr.appendOutletView (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:54024)
    at invoke (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:358138)
    at h.flush (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:357215)
    at p.flush (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:358978)
    at B._end (vendor.696635918446fec08b0d1b3ff71b7e07-5130d00d5db8931b806390ef7c3a55b4e60b44924d23e28410b820d9541895fd.br.js:9:364061)

Safe mode loads partially left side menu doesn’t work at all, however still seeing this error:

Uncaught SyntaxError: Unexpected identifier ‘#r’ (at admin-67b2706032147c458d6f1a74d1068cd7a7b0e9d34613d70a5c341737109c4686.br.js:79:115)

/assets/admin-67b2706032147c458d6f1a74d1068cd7a7b0e9d34613d70a5c341737109c4686.br.js

Seems to be from here: class l extends t.default{static#e=(()=>dt7948.g(this.prototype,“collapsed”,[n.tracked],(function(){return!1})))()#r=(()=>{dt7948.i(this,“collapsed”)})()

This seemed to be a cloudflare issue, have fixed by clearing cache.

1 Like

This advice may also be useful:

4 Likes

Hello,

Was the cache, we already have that setup since launch. We’ll make sure it’s cleared on discourse upgrades going forward.

Anyone have fix or workaround for this? Can’t use the AI plugin until resolved.

1 Like

The problem is that this line was inserted in plugin.rb on June 18

LlmModel.enable_or_disable_srv_llm!

which depends on the migration 20240514171609 which was made on May 16.

My quick workaround was to check out commit cc0b222 of the AI plugin, then rebuild, then check out the latest version.

The only thing that I am missing here is why this normally does work :thinking:

1 Like

I’ve commented out the Discourse AI plugin, rebuilt the app & cleared the Cloudflare cache.

Users can access on their phones but not on desktop.

These JavaScript errors are showing:

Uncaught ReferenceError: dt7948 is not defined
at plugin-outlet.js:47:1

Uncaught (in promise) ReferenceError: Cannot access ‘PluginOutletComponent’ before initialization at Module.default (plugin-connector.js:62:1)

Any help is appreciated.

Did you disable cloudflare dpeedups? I think that’s where I’ve seen that error.

1 Like

These are my settings in Cloudflare under Speed > Optimisation:

Is there anywhere else I should look?

I’ve done some more sleuthing on this Updating AI plugin fails

My main question was why this only happens when updating an already-installed plugin and not when the plugin is newly installed. The answer is that core catches PG::UndefinedTable exceptions but not PG:UndefinedColumn. If the plugin is already installed then the exception is the latter, if the plugin is brand new then it is the former.

2 Likes

I update 2 instances today and see some same errors:
on 1st one the light box is no longer working.
1st one is on:

3.3.0.beta4-dev

(52a047a8be)

on 2nd one I got the following error and it doesn’t render, I can’t check the current commit.

ReferenceError: dt7948 is not defined
and
ReferenceError: Cannot access '__WEBPACK_DEFAULT_EXPORT__' before initialization

I’m not using the ai plugin or cloudflare