Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurring when precompiling assets in v4.2.0-beta1 #26541

Closed
DalekDave opened this issue Aug 18, 2023 · 2 comments
Closed

Error occurring when precompiling assets in v4.2.0-beta1 #26541

DalekDave opened this issue Aug 18, 2023 · 2 comments
Labels
bug Something isn't working status/to triage This issue needs to be triaged

Comments

@DalekDave
Copy link

DalekDave commented Aug 18, 2023

Steps to reproduce the problem

  1. Make changes to assets, such as toot max length change as per instructions in https://kcore.org/2022/12/18/increasing-mastodon-post-length/
  2. Execute RAILS_ENV=production bundle exec rails assets:precompile
  3. Precompilation results in an error message. Error output at the command line:
mastodon@burnout:~/live$ RAILS_ENV=production bundle exec rails assets:precompile
Compiling...
Compilation failed:
node:internal/crypto/hash:69
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/home/mastodon/live/node_modules/webpack/lib/util/createHash.js:135:53)
    at ConcatenatedModule._createIdentifier (/home/mastodon/live/node_modules/webpack/lib/optimize/ConcatenatedModule.js:563:16)
    at new ConcatenatedModule (/home/mastodon/live/node_modules/webpack/lib/optimize/ConcatenatedModule.js:445:27)
    at /home/mastodon/live/node_modules/webpack/lib/optimize/ModuleConcatenationPlugin.js:250:26
    at SyncBailHook.eval [as call] (eval at create (/home/mastodon/live/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
    at SyncBailHook.lazyCompileHook (/home/mastodon/live/node_modules/tapable/lib/Hook.js:154:20)
    at /home/mastodon/live/node_modules/webpack/lib/Compilation.js:1351:37
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/mastodon/live/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/home/mastodon/live/node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.seal (/home/mastodon/live/node_modules/webpack/lib/Compilation.js:1342:27)
    at /home/mastodon/live/node_modules/webpack/lib/Compiler.js:675:18
    at /home/mastodon/live/node_modules/webpack/lib/Compilation.js:1261:4
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/mastodon/live/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:24:1)
    at AsyncSeriesHook.lazyCompileHook (/home/mastodon/live/node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.finish (/home/mastodon/live/node_modules/webpack/lib/Compilation.js:1253:28)
    at /home/mastodon/live/node_modules/webpack/lib/Compiler.js:672:17
    at eval (eval at create (/home/mastodon/live/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:11:1)
    at /home/mastodon/live/node_modules/webpack/lib/Compilation.js:1185:12
    at /home/mastodon/live/node_modules/webpack/lib/Compilation.js:1097:9
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.17.1
  1. Restart the Mastodon services.
  2. Do a complete refresh of the Mastodon Web interface and try to post a toot that exceeds 500 characters.

Expected behaviour

Maximum toot length should have been changed to, for example, 1000

Actual behaviour

No change in maximum toot length. Cannot post more than 500 characters. 500-character limit still displayed in toot editor.

Detailed description

I'd like to increase the toot max length (that subject is covered in #12265 )
I carefully followed the instructions at https://kcore.org/2022/12/18/increasing-mastodon-post-length/
Precompilation fails after making the changes (see above command line output)
When I try to precompile a second time, I get the following output:

mastodon@burnout:~/live$ RAILS_ENV=production bundle exec rails assets:precompile
Everything's up-to-date. Nothing to do

The changes I made are still in the code.

When I revert the changes, I still get the above-pasted error message.
When I precompile a second time, I get the above "Everything's up-to-date" message.

Is the precompilation error normal?

Mastodon instance

burnout.cafe

Mastodon version

v4.2.0-beta1

Technical details

If this is happening on your own Mastodon server, please fill out those:

  • OS: Ubuntu server 22.04
  • Ruby version: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
  • Node.js version: v18.17.1
@DalekDave DalekDave added bug Something isn't working status/to triage This issue needs to be triaged labels Aug 18, 2023
@renchap
Copy link
Sponsor Member

renchap commented Aug 18, 2023

Node 18 is not supported by our frontend toolchain out of the box.

You need to either use Node 16, or use NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=production bundle exec rails assets:precompile.

To force your assets to be compiled again, you can rm tmp/cache/webpacker/last-compilation-digest-production

@renchap renchap closed this as completed Aug 18, 2023
@DalekDave
Copy link
Author

Thank you for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status/to triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants