422 Unprocessable Entity when trying to login with complete new setup
marvinpuethe opened this issue · 5 comments
Describe the bug
We are trying to setup the fabmanager environment using Ubuntu Server 20.04 on Hyper-V Windows 10 or Hyper-V Server. When trying to do any action like sign_in, confirmation, register the server responds with 422 Unprocessable Entity:
/users/sign_in.json:1 Failed to load resource: the server responded with a status of 422 (Unprocessable Entity)
We did the preparations described under production_readme.md manual or with the script prepare-vps.sleede.com and ran the setup with the script from setup.fab.mn.
We are using the default nginx container without lets encrypt. The env variables for smtp are configured with Office 365 and the localization variables are set to german.
To Reproduce
Steps to reproduce the behavior:
- Install Ubuntu Server 20.04 on Hyper-V Windows 10 or Hyper-V Server
- Do the installation described under production_readme.md
- When asked how to deploy select yes for nginx, no for lets encrypt. Configure SMTP for Office 365. Set the localization variables to german (de/de-DE/de-de) described at the various links.
- Open Fabmanager and try to login with the user defined in the setup process
Expected behavior
Login and Register should work and not return 422 Unprocessable Entity
Server (please complete the following information):
Browser (please complete the following information):
- Name: Google Chrome/Microsoft Edge
- Version: 93.0.4577.63/93.0.961.44
Additional context
Do you have any errors on sign up a user ?
User marvin.puethe@hrw-fablab.de has created in database ?
You can try access your container of fabmanager then find this user
docker exec -it <fabmanager_contrainer> bash
rails console
User.findBy(email: 'marvin.puethe@hrw-fablab.de')
Hi @marvinpuethe
You said that you are not using let's encrypt. Does it mean that you have your own SSL certificate or that you are only in HTTP (without encryption)?
Hi together and thanks for your response,
@sylvainbx
Currently we are in a dev environment and only serving over http without lets encrypt because it is not facing the internet.
@gnepud
I tried to access the container and run "rails console" but it said bash: rails: command not found
I also tried installing ruby from debian packages via apt update && apt install ruby ruby-dev build-essentials
and installed rails via gem install rails
. But rails console
only opens the usage help.
Greetings
Marvin
In /apps/fabmanager/config/env, try adding this:
ALLOW_INSECURE_HTTP=true
Then restart with docker-compose down && docker-compose up -d
Thanks. That worked 👍
I would recommend to set this value to true when the user disables lets encrypt.