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

Cannot login when server is starting by systemd service #8903

Closed
henry145145 opened this issue Dec 30, 2019 · 3 comments
Closed

Cannot login when server is starting by systemd service #8903

henry145145 opened this issue Dec 30, 2019 · 3 comments

Comments

@henry145145
Copy link

@henry145145 henry145145 commented Dec 30, 2019

Hi,
I am currently trying to install superset inside an AWS EC2 instance

My superset version is 0.35.1, python is 3.7.4
I made three changes inside /usr/local/lib/python3.7/site-packages/superset/config.py

  • add mapbox key
  • enable proxy fix = true
  • enable redis cache

After I install superset, I ran the following command:

superset db upgrade
export FLASK_APP=superset
flask fab create-admin
superset init
superset run -h 0.0.0.0 -p 8080 --reload --debugger

After that, I was able to login to superset using the admin account I created through flask fab create-admin

Then, I am trying to set up auto restart and here is my superset.service

[Unit]
Description=Superset service
After=network.target

[Service]
Restart=always
Type=simple
ExecStart=/usr/local/bin/superset run -h 0.0.0.0 -p 8080 --reload --debugger

[Install]
WantedBy=multi-user.target

I ran sudo service superset start and sudo service superset status and things look ok

● superset.service - Superset service
   Loaded: loaded (/etc/systemd/system/superset.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-12-30 18:22:04 UTC; 5min ago
 Main PID: 15224 (superset)
   CGroup: /system.slice/superset.service
           ├─15224 /usr/bin/python3 /usr/local/bin/superset run -h 0.0.0.0 -p 8080 --reload --debugger
           └─15232 /usr/bin/python3 /usr/local/bin/superset run -h 0.0.0.0 -p 8080 --reload --debugger

I was able to go to the superset login page, however, I was not able to login using the admin account above (it return "Invalid login. Please try again.").

Then, I stop the serivce and manually run superset run -h 0.0.0.0 -p 8080 --reload --debugger and I was able to login again.

My guess is that when the server is starting by systemd, it is not recognizing /home/ec2-user/.superset/superset.db. If that is the case, then how do I point it to the correct db?

@issue-label-bot

This comment has been minimized.

Copy link

@issue-label-bot issue-label-bot bot commented Dec 30, 2019

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

@charlesoblack

This comment has been minimized.

Copy link

@charlesoblack charlesoblack commented Jan 6, 2020

I think you can set it to run as a user (as opposed to root) by setting

User=ec2-user

in your systemd service. Otherwise, I assume it looks for the superset.db in /.superset/, not in /home/ec2-user/.superset.

@henry145145

This comment has been minimized.

Copy link
Author

@henry145145 henry145145 commented Jan 6, 2020

I think you can set it to run as a user (as opposed to root) by setting

User=ec2-user

in your systemd service. Otherwise, I assume it looks for the superset.db in /.superset/, not in /home/ec2-user/.superset.

@charlesoblack Thank you so much! It works!

@henry145145 henry145145 closed this Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.