Can custom CSS cause an error when trying to upgrade?

Trying to upgrade, cannot rebuild app. This is the error message:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile' failed with return #<Process::Status: pid 768 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development --retry 3 --jobs 4'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
814976ec8597f7ce9b1b55f45d359f3fc206b76ef448f7f52bb35f9f7b3ce6a7
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

I have custom css from within discourse, does building fails because of the custom css?

Thanks!

Unlikely, it is almost always third party plugins … but you should follow the advice listed there and scroll up to look for the error.

1 Like

Thanks! I’ve removed all plugins from app.yml. I left only the docker_manager plugin. I also removed all custom css from my theme. I still cannot rebuild.

Since the output of ./launcher rebuild app is large, I’m copying the latest lines here. I still think that I cannot upgrade because of a theme issue, not sure if CSS related.

I also see this error: ActiveModel::MissingAttributeError: missing attribute: minimum_discourse_version

Done compressing docker-manager-vendor-a2a9da40e6d03d9ade9ba34064f1b7b3a68b0a8c96d80eff3b1698be2d716544.js : 2.32 secs

998.881179826 Compressing: application-80346576c2dd72b0c27346285e58c7509acc8b591c18c2d0dfbd803dce05ce7b.js
uglifyjs '/var/www/discourse/public/assets/_application-80346576c2dd72b0c27346285e58c7509acc8b591c18c2d0dfbd803dce05ce7b.js' -p relative -c -m -o '/var/www/discourse/public/assets/application-80346576c2dd72b0c27346285e58c7509acc8b591c18c2d0dfbd803dce05ce7b.js' --source-map-root '/assets' --source-map '/var/www/discourse/public/assets/application-80346576c2dd72b0c27346285e58c7509acc8b591c18c2d0dfbd803dce05ce7b.js.map' --source-map-url '/assets/application-80346576c2dd72b0c27346285e58c7509acc8b591c18c2d0dfbd803dce05ce7b.js.map'
gzip -f -c -9 /var/www/discourse/public/assets/application-80346576c2dd72b0c27346285e58c7509acc8b591c18c2d0dfbd803dce05ce7b.js > /var/www/discourse/public/assets/application-80346576c2dd72b0c27346285e58c7509acc8b591c18c2d0dfbd803dce05ce7b.js.gz

brotli -f --quality=11 /var/www/discourse/public/assets/application-80346576c2dd72b0c27346285e58c7509acc8b591c18c2d0dfbd803dce05ce7b.js --output=/var/www/discourse/public/assets/application-80346576c2dd72b0c27346285e58c7509acc8b591c18c2d0dfbd803dce05ce7b.js.br


Done compressing application-80346576c2dd72b0c27346285e58c7509acc8b591c18c2d0dfbd803dce05ce7b.js : 14.39 secs

Start compiling CSS: 2019-03-07 13:11:32 UTC
Compiling css for default 2019-03-07 13:11:32 UTC
precompile target: desktop Dark
precompile target: mobile Dark
precompile target: desktop_rtl Dark
precompile target: mobile_rtl Dark
precompile target: desktop_theme Dark
precompile target: mobile_theme Dark
precompile target: admin Dark
precompile target: desktop Default
precompile target: mobile Default
precompile target: desktop_rtl Default
precompile target: mobile_rtl Default
precompile target: desktop_theme Default
precompile target: mobile_theme Default
precompile target: admin Default
precompile target: desktop 
precompile target: mobile 
precompile target: desktop_rtl 
precompile target: mobile_rtl 
precompile target: desktop_theme 
precompile target: mobile_theme 
precompile target: admin 
Compiling css for secondsite 2019-03-07 13:11:38 UTC
precompile target: desktop Oscuro
precompile target: mobile Oscuro
precompile target: desktop_rtl Oscuro
precompile target: mobile_rtl Oscuro
precompile target: desktop_theme Oscuro
precompile target: mobile_theme Oscuro
precompile target: admin Oscuro
precompile target: desktop Por defecto
precompile target: mobile Por defecto
precompile target: desktop_rtl Por defecto
precompile target: mobile_rtl Por defecto
precompile target: desktop_theme Por defecto
precompile target: mobile_theme Por defecto
precompile target: admin Por defecto
precompile target: desktop 
precompile target: mobile 
precompile target: desktop_rtl 
precompile target: mobile_rtl 
precompile target: desktop_theme 
precompile target: mobile_theme 
precompile target: admin 
Compiling css for contadores 2019-03-07 13:11:45 UTC
precompile target: desktop Por defecto
precompile target: mobile Por defecto
precompile target: desktop_rtl Por defecto
precompile target: mobile_rtl Por defecto
384:M 07 Mar 2019 13:11:47.037 * 10 changes in 300 seconds. Saving...
384:M 07 Mar 2019 13:11:47.039 * Background saving started by pid 4448
precompile target: desktop_theme Por defecto
4448:C 07 Mar 2019 13:11:47.203 * DB saved on disk
4448:C 07 Mar 2019 13:11:47.205 * RDB: 1 MB of memory used by copy-on-write
384:M 07 Mar 2019 13:11:47.240 * Background saving terminated with success
precompile target: mobile_theme Por defecto
precompile target: admin Por defecto
precompile target: desktop 
precompile target: mobile 
precompile target: desktop_rtl 
precompile target: mobile_rtl 
precompile target: desktop_theme 
precompile target: mobile_theme 
precompile target: admin 
Compiling css for cosmetologica 2019-03-07 13:11:49 UTC
precompile target: desktop Oscuro
precompile target: mobile Oscuro
precompile target: desktop_rtl Oscuro
precompile target: mobile_rtl Oscuro
precompile target: desktop_theme Oscuro
precompile target: mobile_theme Oscuro
precompile target: admin Oscuro
precompile target: desktop Por defecto
precompile target: mobile Por defecto
precompile target: desktop_rtl Por defecto
precompile target: mobile_rtl Por defecto
precompile target: desktop_theme Por defecto
precompile target: mobile_theme Por defecto
precompile target: admin Por defecto
precompile target: desktop Claro
precompile target: mobile Claro
precompile target: desktop_rtl Claro
precompile target: mobile_rtl Claro
precompile target: desktop_theme Claro
rake aborted!
ActiveModel::MissingAttributeError: missing attribute: minimum_discourse_version
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/attribute_methods/read.rb:77:in `block in _read_attribute'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.2/lib/active_model/attribute_set.rb:48:in `block in fetch_value'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.2/lib/active_model/attribute.rb:222:in `value'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.2/lib/active_model/attribute_set.rb:48:in `fetch_value'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/attribute_methods/read.rb:77:in `_read_attribute'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/attribute_methods/read.rb:40:in `__temp__d696e696d657d6f546963736f657273756f56756273796f6e6'
/var/www/discourse/app/models/theme.rb:159:in `enabled?'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/relation/delegation.rb:71:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/relation/delegation.rb:71:in `each'
/var/www/discourse/app/models/theme.rb:138:in `reject'
/var/www/discourse/app/models/theme.rb:138:in `block in transform_ids'
/var/www/discourse/app/models/theme.rb:89:in `get_set_cache'
/var/www/discourse/app/models/theme.rb:124:in `transform_ids'
/var/www/discourse/app/models/theme.rb:290:in `list_baked_fields'
/var/www/discourse/app/models/theme.rb:286:in `resolve_baked_field'
/var/www/discourse/lib/stylesheet/manager.rb:279:in `theme_digest'
/var/www/discourse/lib/stylesheet/manager.rb:263:in `digest'
/var/www/discourse/lib/stylesheet/manager.rb:247:in `stylesheet_filename'
/var/www/discourse/lib/stylesheet/manager.rb:210:in `source_map_filename'
/var/www/discourse/lib/stylesheet/manager.rb:166:in `compile'
/var/www/discourse/lib/stylesheet/manager.rb:96:in `block (2 levels) in precompile_css'
/var/www/discourse/lib/stylesheet/manager.rb:89:in `each'
/var/www/discourse/lib/stylesheet/manager.rb:89:in `block in precompile_css'
/var/www/discourse/lib/stylesheet/manager.rb:88:in `each'
/var/www/discourse/lib/stylesheet/manager.rb:88:in `precompile_css'
/var/www/discourse/lib/tasks/assets.rake:60:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.6/lib/rails_multisite/connection_management.rb:268:in `block in each_connection'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.6/lib/rails_multisite/connection_management.rb:266:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.6/lib/rails_multisite/connection_management.rb:266:in `each_connection'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.6/lib/rails_multisite/connection_management.rb:71:in `each_connection'
/var/www/discourse/lib/tasks/assets.rake:53:in `block in <top (required)>'
/var/www/discourse/lib/tasks/assets.rake:235:in `block in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => assets:precompile:css
(See full trace by running task with --trace)
I, [2019-03-07T13:11:56.096330 #13]  INFO -- : Purging temp files
Bundling assets
Compressing Javascript and Generating Source Maps

I, [2019-03-07T13:11:56.097073 #13]  INFO -- : Terminating async processes
I, [2019-03-07T13:11:56.097233 #13]  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/10/bin/postmaster -D /etc/postgresql/10/main pid: 68
2019-03-07 13:11:56.097 UTC [68] LOG:  received fast shutdown request
I, [2019-03-07T13:11:56.097745 #13]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 384
384:signal-handler (1551964316) Received SIGTERM scheduling shutdown...
2019-03-07 13:11:56.123 UTC [68] LOG:  aborting any active transactions
2019-03-07 13:11:56.131 UTC [68] LOG:  worker process: logical replication launcher (PID 77) exited with exit code 1
384:M 07 Mar 2019 13:11:56.176 # User requested shutdown...
384:M 07 Mar 2019 13:11:56.176 * Saving the final RDB snapshot before exiting.
384:M 07 Mar 2019 13:11:56.675 * DB saved on disk
384:M 07 Mar 2019 13:11:56.676 # Redis is now ready to exit, bye bye...
2019-03-07 13:11:56.804 UTC [72] LOG:  shutting down
2019-03-07 13:11:57.149 UTC [68] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile' failed with return #<Process::Status: pid 684 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development --retry 3 --jobs 4'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
36c4ed22077bd9ec2a1a1135adebd809ba1d411fc850da09ecb5c43f803a2b37
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Are you using a standard installation of Discourse, or do you have the database/app in different containers?

Hi David, I’m using a multisite installation. AFAIK only one container and database/app in the same container. Here is the relevant part of my app.yml

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
  #- "templates/web.ssl.template.yml"
  #- "templates/web.letsencrypt.ssl.template.yml"
  - "templates/web.socketed.template.yml"  # <-- Added

I’m using nginx in front of discourse, here is the relevant part of my nginx.conf

server {
        listen 80; listen [::]:80;
        server_name example.com;
        root /home/my_name/example.com;
        client_max_body_size 8M;
        location ~ (/custom_static_content) {
                try_files $uri /$uri =404;
        }
        location / {
                proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
                proxy_set_header Host $http_host;
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }
}

I’m trying to upgrade from [v2.2.0.beta3 +26]

1 Like

Great, thanks for the extra info. I was trying to work out why nobody else has run into this issue. Multisite installations are fairly rare, and different people run them in different ways. The root cause is that you are running the assets:precompile step before you migrate all the multisite databases.

I’ve added a fix for the issue - please can you try rebuilding again?

7 Likes

Thanks David, I’ve started to rebuild but I think I’m getting an image without your latest fix, because I’m seeing this: 20190217

git pull
[…]
./launcher rebuild app 1.372s

WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed

Please be patient

Unable to find image 'discourse/base:2.0.20190217' locally
2.0.20190217: Pulling from discourse/base

How should I proceed? Thanks!

That should be fine, the fix I made was in the Discourse app, not the docker image. (The latest app version gets pulled in automatically). Are you running tests-passed, or beta/stable?

Let me know if it works!

4 Likes

It worked!! :heart_eyes: I’ve been trying to upgrade for several days and you fixed it. Congrats and many thanks again!!

5 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.