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
Unit king-phisher.service entered failed state. #389
Comments
Please completely fill out the issue template. We need all of the details that it requests to better identify the issue and provide the help that you are requesting. Please do not open a new issue but instead just edit this one and fill out all of the details. |
Thanks for the info zeroSteiner, I updated the ticket with more info. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@wolfthefallen can you take a look at this when you have a chance? |
Sure I should have sometime later this week to look into this. |
I also wondering if we need to increase any ulimit values such us open files limit? |
If you're still getting the same error, it looks like it has something to do with the database connection. I'm basing that on the fact that it's a query which is failing. Can you run the server with debug output and in the foreground, then post the logs here? The full arguments would be |
Below is the output i got after running the debug. |
So the issue appears to be during the initialization of the database. The command I haven't seen this error before and am not quite sure what would cause that to fail. Maybe if the |
No Luck |
You might need to do For reals though, this command should give us a meaningful error: |
sure, make sense. So when I ran the command it asked me for password and I enter the postgres PW and got the result below [root@d1terll ~]# su postgres -c 'psql -At -c "SELECT usename FROM pg_user"' |
It prompted you for a password? That's probably the issue. I don't know why it would do that since you're running as root. A quick google search shows that maybe if your |
Right, i got the prompt running it again. I will have to into my pam file to try and change that. |
The PAM file seems to be there already but still same asking for a password. No luck. [root@d1terll ~]# grep pam_root /etc/pam.d/su |
The issue is definitely that your system is, for some reason prompting you for a password when you use Since the service is already running, I'm not sure we could get around this startup check without a code change to effectively bypass it. |
@Deensk check your pam su file. On most linux based systems this is found at This line in the pam su configuration file allows root to |
@wolfthefallen I think Deensk already said that was the case in the commend here. |
Yes, the auth sufficient pam_rootok.so seems to be ok. |
It's not going to have anything to do with the database. The issue is entirely with the fact that su is prompting your root user for a password which since it's not that PAM configuration, I have no idea why that is. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Doing more research on this and still haven't found anything yet. |
I'm curious if you could get around this by running |
Yeah but most of the time the server is installed on a headless system with no GUI. |
Yes, the install is in headless system with no GUI. |
I tried to reinstall but getting the following error below. I also try clearing command "pipenv lock --clear" but still showing the same error. [root@d1terll king-phisher]# sudo ./KingPhisherServer --verify-config server_config.yml |
navigate to your King-phisher folder and run: |
when i try "export PIPENV_VENV_IN_PROJECT=True && sudo -E pipenv --site-packages install" [root@d1terll king-phisher]# sudo ./KingPhisherServer --verify-config server_config.yml |
From the debug log you provided King Phisher is not seeing the postgresql service running, and fails to start it through systemctl. Please trouble shoot your postgresql instance and make sure it is running through |
Sure, got further on su -PostgreSQL command on startup. "su postgres -c psql -At -c "SELECT usename FROM pg_user" [root@d1terll king-phisher]# sudo ./KingPhisherServer -L DEBUG server_config.yml |
It looks like you're running into the same issue here where it's hanging because |
right, definitely don't know why. |
Not sure if this will be secure enough, can we set postgres database not to prompt user password at all? |
Okay, I looked into this again and I'm thinking I might have been wrong about it being Could you share the contents of your
You probably have one that is either higher that is matching, or a configuration using something other than
After changing that, restart the postgresql service and then see if King Phisher will start. |
Ok, this is how my config looks postgres=# SHOW hba_file;
|
Yeah it's that |
Ok, that worked with su and DEBUG running periodic maintenance tasks continue to run [root@d1terll king-phisher]# sudo ./KingPhisherServer -L DEBUG server_config.yml |
Yes that is 100% intended behavior. You won't see those messages if logging is set above DEBUG, I think the default is WARNING but when you have it set to DEBUG you get all kinds of internal diagnostic messages that I use to figure out what's going on. That message in particular is the periodic ping that's sent over the websocket to any connected clients. The event fires on a timer regardless if there are any clients connected or not. It looks like you're all set now so I'll close this ticket. I'm glad we were able to figure it out. |
Sure, Thank you guys for the help. |
Issue Description
I'm having issue starting king-phisher server after matching PostgreSQL DB password with King-Phisher server. I just upgraded to the latest version 1.13.1 and service wont start.
found out it was complaining about "CRITICAL server failed to build with error: failed to execute postgresql query 'SELECT usename FROM pg_user' via su and psql" and I ALTER USER king_phisher WITH PASSWORD 'new password'; but still wont start.
Reproduction Step
systemctl start king-phisher.service
result output
Job for king-phisher.service failed because a configured resource limit was exceeded. See "systemctl status king-phisher.service" and "journalctl -xe" for details.
checked journalctl -xe with this command "journalctl -u king-phisher"
and result output is
[root@d1terll.com king-phisher]# journalctl -u king-phisher
-- Logs begin at Mon 2019-07-15 19:10:57 EDT, end at Tue 2019-07-16 10:17:15 EDT. --
Jul 15 19:11:11 d1terll.com systemd[1]: Starting King Phisher Server...
Jul 15 19:11:13 d1terll.com python3[1410]: Loading .env environment variables…
Jul 15 19:11:17 d1terll.com systemd[1]: PID file /var/run/king-phisher.pid not readable (yet?) after start.
Jul 15 19:11:17 d1terll.com runuser[2653]: pam_unix(runuser:session): session opened for user postgres by (uid=0)
Jul 15 19:11:17 d1terll.com su[2680]: (to postgres) root on none
Jul 15 19:11:18 d1terll.com python3[1410]: CRITICAL server failed to build with error: failed to execute postgresql query 'SELECT usename FROM pg_u
Jul 15 19:11:18 d1terll.com systemd[1]: king-phisher.service never wrote its PID file. Failing.
Jul 15 19:11:18 d1terll.com systemd[1]: Failed to start King Phisher Server.
Jul 15 19:11:18 d1terll.com systemd[1]: Unit king-phisher.service entered failed state.
Jul 15 19:11:18 d1terll.com systemd[1]: king-phisher.service failed.
when i check status, i get below output as well.
[root@d1terll.com king-phisher]# systemctl status king-phisher.service
● king-phisher.service - King Phisher Server
Loaded: loaded (/usr/lib/systemd/system/king-phisher.service; enabled; vendor preset: disabled)
Active: failed (Result: resources) since Tue 2019-07-16 10:17:15 EDT; 11min ago
Process: 24916 ExecStart=/usr/bin/python3 /opt/king-phisher/KingPhisherServer /opt/king-phisher/server_config.yml (code=exited, status=0/SUCCESS)
Jul 16 10:17:14 d1terll.com systemd[1]: Starting King Phisher Server...
Jul 16 10:17:14 d1terll.com python3[24916]: Loading .env environment variables…
Jul 16 10:17:15 d1terll.com runuser[24929]: pam_unix(runuser:session): session opened for user postgres by (uid=0)
Jul 16 10:17:15 d1terll.com su[24952]: (to postgres) root on none
Jul 16 10:17:15 d1terll.com python3[24916]: CRITICAL server failed to build with error: failed to execute postgresql query 'SELECT usename FROM ... and psql
Jul 16 10:17:15 d1terll.com systemd[1]: PID file /var/run/king-phisher.pid not readable (yet?) after start.
Jul 16 10:17:15 d1terll.com systemd[1]: king-phisher.service never wrote its PID file. Failing.
Jul 16 10:17:15 d1terll.com systemd[1]: Failed to start King Phisher Server.
Jul 16 10:17:15 d1terll.com systemd[1]: Unit king-phisher.service entered failed state.
Jul 16 10:17:15 d1terll.com systemd[1]: king-phisher.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
Environment Details
Host OS: NAME="Red Hat Enterprise Linux Server"
VERSION="7.4 (Maipo)"
King Phisher Version:1.13.1
Error Details / Stack Trace
CRITICAL server failed to build with error: failed to execute postgresql query 'SELECT usename FROM pg_u
The text was updated successfully, but these errors were encountered: