glitch-soc / mastodon

A glitchy but lovable microblogging server
https://glitch-soc.github.io/docs/
GNU Affero General Public License v3.0
680 stars 180 forks source link

glitch-soc stops working after update #2762

Closed MagicLike closed 5 days ago

MagicLike commented 5 days ago

Steps to reproduce the problem

  1. Update as always using https://glitch-soc.github.io/docs as a reference
  2. Update dependencies as prompted
  3. Finish update with no error messages
  4. Get error page & error messages in syslog

Expected behaviour

glitch-soc should just have updated and worked normally

Actual behaviour

It seems like a misconfig through the update / a file missing

Detailed description

Instead of a HTTP 500, I just get the "We're sorry, but something went wrong on our end." error page, but the syslog goes a bit more into detail:

Jul  1 13:06:18 sekundenklebertransportverbot bundle[1286]: E, [2024-07-01T13:06:18.714971 #1286] ERROR -- : [ad23ec41-2417-4ab9-a8a7-3b6bc8f98346]
Jul  1 13:06:18 sekundenklebertransportverbot bundle[1286]: [ad23ec41-2417-4ab9-a8a7-3b6bc8f98346] ActionView::Template::Error (Webpacker can't find flavours/glitch/application.js in /home/mastodon/live/public/packs/manifest.json. Possible causes:
Jul  1 13:06:18 sekundenklebertransportverbot bundle[1286]: 1. You want to set webpacker.yml value of compile to true for your environment
Jul  1 13:06:18 sekundenklebertransportverbot bundle[1286]:    unless you are using the `webpack -w` or the webpack-dev-server.
Jul  1 13:06:18 sekundenklebertransportverbot bundle[1286]: 2. webpack has not yet re-run to reflect updates.
Jul  1 13:06:18 sekundenklebertransportverbot bundle[1286]: 3. You have misconfigured Webpacker's config/webpacker.yml file.
Jul  1 13:06:18 sekundenklebertransportverbot bundle[1286]: 4. Your webpack configuration is not creating a manifest.
Jul  1 13:06:18 sekundenklebertransportverbot bundle[1286]: Your manifest contains:

[content of manifest.json]

I tried refreshing, reloading and rebuilding of multiple aspects of glitch-soc, but the error persists and I don't know what to do besides running random commands from stack overflow which is not necessarily a good idea, so I wanted to open an issue before doing something dumb... :woozy_face:

Mastodon instance

soc.sekundenklebertransportverbot.de

Mastodon version

4.3.0-alpha.4+glitch

Technical details

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

MagicLike commented 5 days ago

The API seems to work tho, as Tusky works flawlessly

ClearlyClaire commented 5 days ago

It seems the assets failed to build.

Try bundle exec rails assets:clobber assets:precompile, and get back to me if you hit any error.

MagicLike commented 5 days ago

It seems the assets failed to build.

Try bundle exec rails assets:clobber assets:precompile, and get back to me if you hit any error.

The compilation fails almost instantly:

Compilation failed:
/home/mastodon/live/node_modules/webpack-cli/bin/cli.js:93
                throw err;
                ^

TypeError: settings.resolved_paths is not iterable
    at Object.<anonymous> (/home/mastodon/live/config/webpack/rules/babel.js:9:17)
    at Module._compile (/home/mastodon/live/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (/home/mastodon/live/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/mastodon/live/config/webpack/rules/index.js:1:77)
    at Module._compile (/home/mastodon/live/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (/home/mastodon/live/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/mastodon/live/config/webpack/shared.js:13:15)
    at Module._compile (/home/mastodon/live/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (/home/mastodon/live/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/mastodon/live/config/webpack/production.js:13:22)
    at Module._compile (/home/mastodon/live/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (/home/mastodon/live/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at WEBPACK_OPTIONS (/home/mastodon/live/node_modules/webpack-cli/bin/utils/convert-argv.js:114:13)
    at requireConfig (/home/mastodon/live/node_modules/webpack-cli/bin/utils/convert-argv.js:116:6)

Node.js v20.15.0
ClearlyClaire commented 5 days ago

Do you have any local change to glitch-soc's source code?

MagicLike commented 5 days ago

Not that I know of

ClearlyClaire commented 5 days ago

Can you give me the output of git status?

MagicLike commented 5 days ago

well it seems there are still some modified bits and a revert I did some time ago did not finish cleanly...

HEAD detached from dfbf96021e
Revert currently in progress.
  (run "git revert --continue" to continue)
  (use "git revert --skip" to skip this patch)
  (use "git revert --abort" to cancel the revert operation)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   public/robots.txt

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    app/javascript/skins/glitch/mastodon-modern/

no changes added to commit (use "git add" and/or "git commit -a")
ClearlyClaire commented 5 days ago

dfbf96021e is a pretty old commit… are you ok with resetting all your local changes?

If so, can you try: git revert --abort git reset --hard 6d6064d2c0242c6b923b79db05fefa3d8c581827

MagicLike commented 5 days ago

Yeah I am fine with that, here is the output:

mastodon@sekundenklebertransportverbot:~/live$ git revert --abort
warning: You seem to have moved HEAD. Not rewinding, check your HEAD!
mastodon@sekundenklebertransportverbot:~/live$ git reset --hard 6d6064d2c0242c6b923b79db05fefa3d8c581827
HEAD is now at 6d6064d2c0 fix(collapsing): fix and simplify post collapsing CSS (#2757)
mastodon@sekundenklebertransportverbot:~/live$ git status
HEAD detached from dfbf96021e
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    app/javascript/skins/glitch/mastodon-modern/

nothing added to commit but untracked files present (use "git add" to track)

I guess I have to build / "update" again?

ClearlyClaire commented 5 days ago

Yes! It's possible that the files in app/javascript/skins/glitch/mastodon-modern/ would cause the issue, but I don't think that's it. You can always move them out of the source code directory if you encounter the same error to check whether that's related.

MagicLike commented 5 days ago

Okay, so I ran the compilation again and got the same error. Then I just deleted the mastodon-modern theme (when I first tried to add it, it did not work and I kinda forgot about it so it was never updated) and after some time it actually worked! I can access the webinterface without any problems now and all error messages are gone! :tada:

Thank you for the quick response and help :heart: