“Bad request” when trying to access ghost admin

My YunoHost server

Hardware: computer
YunoHost version: 11.0.9.15
I have access to my server : Through SSH, through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

Following a post in the ghost forum we realized that maybe the issue is more related to the ghost_ynh package than ghost itself, so migrating the issue here.

To briefly describe the issue: opening the ghost admin page would return Bad request. @badrihippo helped me there to try to investigate the issue, and I don’t know if that’s a normal thing but it seems that the ghost user doesn’t have it’s own home directory (or that it’s not well set up), this creating some issues.

If anyone has some suggestions on how to debug the issue, would be very welcome :slight_smile:

Okay, I can see .yarn and .npm in your /var/www/ghost__3/ directory, so it looks like that’s what we should be considering “home”. My guess is that something in the way you logged in somehow changed the home directory.

This random page on the Internet says we can change it (back) by running the following as root:

usermod -d /var/www/ghost__3 ghost__3

(There’s also a -m option to move the contents of the existing “home directory”, but we don’t need that in this case, especially since there doesn’t seem to be any existing "home directory!)

Try that and see if it works? At the very least, ghost__3 will have permissions to create all the files and directories it needs, and if I’m not mistaken this is exactly how it’s supposed to happen by default anyway.

Ok, so the usermod -d /var/www/ghost__3 ghost__3 command seem to have resolved the issue with the home directory.

But now I’m having the following error:

ghost__3@yuno:~/ghost/admin$ yarn build --environment/production
yarn run v1.22.19
$ ember build --environment/production
WARNING: Node v16.17.1 is not tested against Ember CLI on your platform. We recommend that you use the most-recent "Active LTS" version of Node.js. See https://git.io/v7S5n for details.
The option '--environment/production' is not registered with the 'build' command. Run `ember build --help` for a list of supported options.
Environment: development
cleaning up...
Build Error (broccoli-persistent-filter:Babel > [Babel: @ember/test-helpers]) in @ember/test-helpers/-internal/build-registry.js

EACCES: permission denied, mkdir '/tmp/root/if-you-need-to-delete-this-open-an-issue-async-disk-cache/984382c81bbeb83d69509149d9b9b9eb15beaaa3'


Stack Trace and Error Report: /tmp/error.dump.fb59b24fdf24a2758b1422938f1a444c.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Not so sure what the issue is now, seem something related to ember (have to say I don’t really know what ember is, so…).
I guess the permission error in /tmp folder is a side effect and maybe not important, but still questioning.

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