19 Jul 2024 |
Alexandru Lupu | as long as you are on 3.0.x there should not be any issues | 13:41:27 |
sdelcroix | Hi again :) I've updated 0.26.10 to 0.27.0. When I run bin/rails decidim:webpacker:install then bin/rails assets:precompile I get the following error :
bin/rails assets:precompile
Compiling...
Compilation failed:
[webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve 'postcss-loader' in '/data/decidim-apps/decidim-app_27'
at /data/decidim-apps/decidim-app_27/node_modules/webpack/lib/Compilation.js:2017:28
at /data/decidim-apps/decidim-app_27/node_modules/webpack/lib/NormalModuleFactory.js:817:13
at eval (eval at create (/data/decidim-apps/decidim-app_27/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
at /data/decidim-apps/decidim-app_27/node_modules/webpack/lib/NormalModuleFactory.js:275:22
at eval (eval at create (/data/decidim-apps/decidim-app_27/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at /data/decidim-apps/decidim-app_27/node_modules/webpack/lib/NormalModuleFactory.js:560:15
at /data/decidim-apps/decidim-app_27/node_modules/webpack/lib/NormalModuleFactory.js:118:11
at /data/decidim-apps/decidim-app_27/node_modules/webpack/lib/NormalModuleFactory.js:631:8
at /data/decidim-apps/decidim-app_27/node_modules/neo-async/async.js:2830:7
at done (/data/decidim-apps/decidim-app_27/node_modules/neo-async/async.js:2925:13)
resolve 'postcss-loader' in '/data/decidim-apps/decidim-app_27'
Parsed request is a module
using description file: /data/decidim-apps/decidim-app_27/package.json (relative path: .)
resolve as module
looking for modules in /data/decidim-apps/decidim-app_27/node_modules
single file module
using description file: /data/decidim-apps/decidim-app_27/package.json (relative path: ./node_modules/postcss-loader)
no extension
/data/decidim-apps/decidim-app_27/node_modules/postcss-loader doesn't exist
.js
/data/decidim-apps/decidim-app_27/node_modules/postcss-loader.js doesn't exist
/data/decidim-apps/decidim-app_27/node_modules/postcss-loader doesn't exist
/data/decidim-apps/node_modules doesn't exist or is not a directory
/data/node_modules doesn't exist or is not a directory
/node_modules doesn't exist or is not a directory
| 16:39:35 |
sdelcroix | When I run bin/rails assets:precompile again, that says : Everything's up-to-date. Nothing to do I then ran bin/rails assets:clean and bin/rails assets:precompile again but it always says : Everything's up-to-date. Nothing to do
I've followed the upgrade documentation.
| 16:42:48 |
sdelcroix | Here are the postcss* folders that I have in node_modules folder :
drwxrwxr-x 4 decidim decidim 4096 avril 8 2022 postcss
drwxrwxr-x 2 decidim decidim 4096 avril 8 2022 postcss-html
drwxrwxr-x 3 decidim decidim 4096 avril 8 2022 postcss-less
drwxrwxr-x 3 decidim decidim 4096 avril 8 2022 postcss-media-query-parser
drwxrwxr-x 2 decidim decidim 4096 avril 8 2022 postcss-resolve-nested-selector
drwxrwxr-x 3 decidim decidim 4096 avril 8 2022 postcss-safe-parser
drwxrwxr-x 2 decidim decidim 4096 avril 8 2022 postcss-sass
drwxrwxr-x 3 decidim decidim 4096 avril 8 2022 postcss-scss
drwxrwxr-x 3 decidim decidim 4096 avril 8 2022 postcss-selector-parser
drwxrwxr-x 2 decidim decidim 4096 avril 8 2022 postcss-syntax
drwxrwxr-x 3 decidim decidim 4096 avril 8 2022 postcss-value-parser
| 16:43:26 |
sdelcroix | I have the error again if I run bundle exec rails webpacker:clobber then bin/rails assets:precompile | 16:58:54 |
sdelcroix | I have mentions about postcss-loader in package-lock.json. Do I just need to run npm update ? | 17:11:18 |
sdelcroix | * I have mentions about postcss-loader in package-lock.json. Do I just need to run npm update ?
grep postcss-loader package-lock.json
"postcss-loader": "^6.2.1",
"node_modules/@decidim/webpacker/node_modules/postcss-loader": {
"resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-6.2.1.tgz",
"postcss-loader": "^5.2.0",
"postcss-loader": "^6.2.1",
"postcss-loader": {
"resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-6.2.1.tgz",
| 17:11:52 |
sdelcroix | * I have mentions about postcss-loader in package-lock.json. Do I just need to run npm update ?
grep postcss-loader package-lock.json
"postcss-loader": "^6.2.1",
"node_modules/@decidim/webpacker/node_modules/postcss-loader": {
"resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-6.2.1.tgz",
"postcss-loader": "^5.2.0",
"postcss-loader": "^6.2.1",
"postcss-loader": {
"resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-6.2.1.tgz",
| 17:12:12 |
sdelcroix | * I have mentions about postcss-loader in package-lock.json. Do I just need to run npm update ?
grep postcss-loader package-lock.json
"postcss-loader": "^6.2.1",
"node_modules/@decidim/webpacker/node_modules/postcss-loader": {
"resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-6.2.1.tgz",
"postcss-loader": "^5.2.0",
"postcss-loader": "^6.2.1",
"postcss-loader": {
"resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-6.2.1.tgz",
| 17:12:30 |
sdelcroix | npm update fixed the issue | 23:25:49 |
20 Jul 2024 |
| lunarcypher joined the room. | 05:01:42 |
22 Jul 2024 |
sdelcroix | Hi everyone :) Still on my 0.26 to 0.27 upgrade :)
I now have this error when accessing "Appearance" in "Parameters" :
Rendered layout /home/decidim/.rbenv/versions/3.0.7/lib/ruby/gems/3.0.0/gems/decidim-admin-0.27.7/app/views/layouts/decidim/admin/settings.html.erb (Duration: 39.3ms | Allocations: 19453)
I, [2024-07-22T15:10:45.198295 #82607] INFO -- : [0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] Completed 500 Internal Server Error in 81ms (ActiveRecord: 5.4ms | Allocations: 36514)
F, [2024-07-22T15:10:45.201355 #82607] FATAL -- : [0fbac5e6-157d-460f-b3c7-0336b6e2b5fe]
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] ActionView::Template::Error (undefined method `[]' for nil:NilClass):
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 52:
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 53: <div class="row">
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 54: <div class="columns xlarge-6">
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 55: <%= form.upload :highlighted_content_banner_image %>
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 56: </div>
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 57: </div>
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 58: </div>
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe]
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:141:in `default_maximum_attachment_size'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:133:in `defaults_hash'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:57:in `default'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:165:in `block in initialize'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:160:in `to_h'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:160:in `initialize'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:18:in `new'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:18:in `for'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) app/models/decidim/organization.rb:71:in `settings'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) app/models/decidim/organization.rb:76:in `maximum_upload_size'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/has_upload_validations.rb:11:in `block in validates_upload'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/file_validator_humanizer.rb:82:in `max_file_size'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/form_builder.rb:491:in `max_file_size'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/form_builder.rb:465:in `upload'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-admin (0.27.7) app/views/decidim/admin/organization_appearance/_form.html.erb:55
| 13:27:36 |
sdelcroix | Same error when I want to access to a participatory process or a participatory process group in backend | 13:28:40 |
sdelcroix | * Hi everyone :) Still on my 0.26 to 0.27 upgrade :)
I now have this error when accessing "Appearance" in "Parameters" in backend :
Rendered layout /home/decidim/.rbenv/versions/3.0.7/lib/ruby/gems/3.0.0/gems/decidim-admin-0.27.7/app/views/layouts/decidim/admin/settings.html.erb (Duration: 39.3ms | Allocations: 19453)
I, [2024-07-22T15:10:45.198295 #82607] INFO -- : [0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] Completed 500 Internal Server Error in 81ms (ActiveRecord: 5.4ms | Allocations: 36514)
F, [2024-07-22T15:10:45.201355 #82607] FATAL -- : [0fbac5e6-157d-460f-b3c7-0336b6e2b5fe]
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] ActionView::Template::Error (undefined method `[]' for nil:NilClass):
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 52:
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 53: <div class="row">
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 54: <div class="columns xlarge-6">
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 55: <%= form.upload :highlighted_content_banner_image %>
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 56: </div>
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 57: </div>
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] 58: </div>
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe]
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:141:in `default_maximum_attachment_size'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:133:in `defaults_hash'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:57:in `default'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:165:in `block in initialize'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:160:in `to_h'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:160:in `initialize'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:18:in `new'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/organization_settings.rb:18:in `for'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) app/models/decidim/organization.rb:71:in `settings'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) app/models/decidim/organization.rb:76:in `maximum_upload_size'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/has_upload_validations.rb:11:in `block in validates_upload'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/file_validator_humanizer.rb:82:in `max_file_size'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/form_builder.rb:491:in `max_file_size'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-core (0.27.7) lib/decidim/form_builder.rb:465:in `upload'
[0fbac5e6-157d-460f-b3c7-0336b6e2b5fe] decidim-admin (0.27.7) app/views/decidim/admin/organization_appearance/_form.html.erb:55
| 13:29:05 |
sdelcroix | Same error when trying to edit an organization :
I, [2024-07-22T17:34:48.528375 #84423] INFO -- : [2ceeee42-6c0f-480c-a555-be494b58600f] Processing by Decidim::System::OrganizationsController#edit as HTML
I, [2024-07-22T17:34:48.528488 #84423] INFO -- : [2ceeee42-6c0f-480c-a555-be494b58600f] Parameters: {"id"=>"2"}
D, [2024-07-22T17:34:48.530680 #84423] DEBUG -- : [2ceeee42-6c0f-480c-a555-be494b58600f] Decidim::Organization Load (1.5ms) SELECT "decidim_organizations".* FROM "decidim_organizations" WHERE "decidim_organizations"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]]
I, [2024-07-22T17:34:48.534032 #84423] INFO -- : [2ceeee42-6c0f-480c-a555-be494b58600f] Completed 500 Internal Server Error in 5ms (ActiveRecord: 1.5ms | Allocations: 1222)
F, [2024-07-22T17:34:48.535891 #84423] FATAL -- : [2ceeee42-6c0f-480c-a555-be494b58600f]
[2ceeee42-6c0f-480c-a555-be494b58600f] NoMethodError (undefined method `[]' for nil:NilClass):
[2ceeee42-6c0f-480c-a555-be494b58600f]
[2ceeee42-6c0f-480c-a555-be494b58600f] decidim-core (0.27.7) lib/decidim/organization_settings.rb:141:in `default_maximum_attachment_size'
[2ceeee42-6c0f-480c-a555-be494b58600f] decidim-core (0.27.7) lib/decidim/organization_settings.rb:133:in `defaults_hash'
[2ceeee42-6c0f-480c-a555-be494b58600f] decidim-core (0.27.7) lib/decidim/organization_settings.rb:57:in `default'
[2ceeee42-6c0f-480c-a555-be494b58600f] decidim-system (0.27.7) app/forms/decidim/system/file_upload_settings_form.rb:56:in `default_settings'
[2ceeee42-6c0f-480c-a555-be494b58600f] decidim-system (0.27.7) app/forms/decidim/system/file_upload_settings_form.rb:19:in `map_model'
[2ceeee42-6c0f-480c-a555-be494b58600f] decidim-core (0.27.7) lib/decidim/attribute_object/form.rb:66:in `from_model'
[2ceeee42-6c0f-480c-a555-be494b58600f] decidim-system (0.27.7) app/forms/decidim/system/update_organization_form.rb:57:in `map_model'
[2ceeee42-6c0f-480c-a555-be494b58600f] decidim-core (0.27.7) lib/decidim/attribute_object/form.rb:66:in `from_model'
[2ceeee42-6c0f-480c-a555-be494b58600f] decidim-core (0.27.7) app/controllers/concerns/decidim/form_factory.rb:56:in `from_model'
[2ceeee42-6c0f-480c-a555-be494b58600f] decidim-system (0.27.7) app/controllers/decidim/system/organizations_controller.rb:47:in `edit
'
| 15:47:00 |
Hadrien Froger | Hi sdelcroix it is probably linked to your encryption key. Check you have the good SECRET_KEY_BASE / MASTER_KEY env. these settings are encrypted (default_maximum_attachment_size , etc). | 15:48:28 |
sdelcroix | Thanks Hadrien. Hmm it's an upgrade, I didn't change this key (I never do since 0.24). How can I check it ? :) | 15:49:44 |
Hadrien Froger | Ok, so if you didn't change your env and do the upgrade on the same server, that's not the isse. | 15:50:24 |
Hadrien Froger | Can you check in rails console what gives you Rails.application.secrets.decidim[:maximum_attachment_size] | 15:51:19 |
Hadrien Froger | * Can you check in rails console what gives you Rails.application.secrets.decidim[:maximum_attachment_size] ? | 15:51:25 |
Hadrien Froger | (guessing Rails.application.secrets.decidim is nil) | 15:51:55 |
sdelcroix | Have to go home now but I’ll check that ASAP ! | 16:05:21 |
sdelcroix | One thing of the upgrade process I didn’t make yet is : 2.4. Configuration via Environment Variables | 16:09:13 |
sdelcroix | I didn’t understand how to do yet | 16:10:18 |
sdelcroix | Is it mandatory ? | 16:10:40 |
sdelcroix | In reply to @hfroger:matrix.org (guessing Rails.application.secrets.decidim is nil) I confirm it is nil | 22:06:12 |
23 Jul 2024 |
sdelcroix | OK I’ve generated a new 0.27 app and I see that config/secrets.yml is a big file now with dozen of keys :) I also see decidim key inside | 04:54:12 |
sdelcroix | I’m gonna merge it with my actual secrets.yml. And I’m using figaro so I guess I have to set ENV vars in config/application.yml | 04:57:07 |
Hadrien Froger | In reply to @sdelcroix:matrix.org OK I’ve generated a new 0.27 app and I see that config/secrets.yml is a big file now with dozen of keys :) I also see decidim key inside Yes! So basically, secrets.yml is a plain YAML file (not encrypted) with key/value configurations. Most of the values are taken from the Rails environment ENV. You need to set environment variables on your server, which depends on the host.
If you just take these new keys from secrets.yml, you should already have defaults and should be able to run your server.
For example:
default_locale: Decidim::Env.new("DECIDIM_DEFAULT_LOCALE", "en") # English by default
To set environment variables, it depends on your hosting choice:
AWS:
aws ec2 associate-instance-attribute --instance-id YOUR_INSTANCE_ID --attribute userData --value "export DECIDIM_DEFAULT_LOCALE=en"
Heroku:
heroku config:set DECIDIM_DEFAULT_LOCALE=en
etc...
| 07:17:33 |
| Quentin joined the room. | 15:24:02 |