systemctl start postgresql-13 start failed - database

enter image description here
I am trying to install netboxtool but when i try to start postgesql it giving me below errors.Selinux already disabled.
[1][root#it ~]# systemctl start postgresql-13 Job for postgresql-13.service failed because the control process exited with error code. See "systemctl status postgresql-13.service" and "journalctl -xe" for details. [root#it ~]# journalctl -xe -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit session-6.scope has finished starting up.
-- The start-up result is done. Apr 09 19:32:45 it sshd[2686]: pam_unix(sshd:session): session opened for user root by (uid=0) Apr 09 19:32:45 it systemd-logind[641]: New session 6 of user root. -- Subject: A new session 6 has been created for user root -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
-- A new session with the ID 6 has been created for the user root.
-- The leading process of the session is 2686. Apr 09 19:32:50 it polkitd[1383]: Registered Authentication Agent for unix-process:2714:612049 (system bus name :1.38 [/usr/bin/pkttyagent --notify-fd 5 --fallbac Apr 09 19:32:50 it systemd1: Starting PostgreSQL 13 database server... -- Subject: Unit postgresql-13.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit postgresql-13.service has begun starting up. Apr 09 19:32:50 it postgresql-13-check-db-dir[2720]: "/var/lib/pgsql/13/data/" is missing or empty. Apr 09 19:32:50 it postgresql-13-check-db-dir[2720]: Use "/usr/pgsql-13/bin/postgresql-13-setup initdb" to initialize the database cluster. Apr 09 19:32:50 it postgresql-13-check-db-dir[2720]: See /usr/share/doc/postgresql13-13.6/README.rpm-dist for more information. Apr 09 19:32:50 it systemd1: postgresql-13.service: control process exited, code=exited status=1 Apr 09 19:32:50 it systemd1: Failed to start PostgreSQL 13 database server. -- Subject: Unit postgresql-13.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit postgresql-13.service has failed.
-- The result is failed. Apr 09 19:32:50 it systemd1: Unit postgresql-13.service entered failed state. Apr 09 19:32:50 it systemd1: postgresql-13.service failed. Apr 09 19:32:50 it polkitd[1383]: Unregistered Authentication Agent for unix-process:2714:612049 (system bus name :1.38, object path /org/freedesktop/PolicyKit1/A lines 2130-2166/2166 (END)

The error states that the default data directory /var/lib/pgsql/13/data is missing. Check if that exists and create it.

Related

Cannot start Apache2 server on RaspberryPi 4

I installed Apache2 on Raspberry Pi4 B but it is not starting. If anyone had the same issue, please let me know the solution.
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service.
Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service → /lib/systemd/system/apache-htcacheclean.service.
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "start" failed.
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-06-07 21:07:32 EEST; 22ms ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 30140 ExecStart=/usr/sbin/apachectl start (code=exited, status=127)
Jun 07 21:07:32 raspberrypi systemd[1]: Starting The Apache HTTP Server...
Jun 07 21:07:32 raspberrypi apachectl[30140]: /usr/sbin/apachectl: 174: /usr/sbin/apachectl: /usr/sbin/apache2: not found
Jun 07 21:07:32 raspberrypi apachectl[30140]: Action 'start' failed.
Jun 07 21:07:32 raspberrypi apachectl[30140]: The Apache error log may have more information.
Jun 07 21:07:32 raspberrypi systemd[1]: apache2.service: Control process exited, code=exited, status=127/n/a
Jun 07 21:07:32 raspberrypi systemd[1]: apache2.service: Failed with result 'exit-code'.
Jun 07 21:07:32 raspberrypi systemd[1]: Failed to start The Apache HTTP Server.
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for systemd (241-7~deb10u4+rpi1) ...
Problem solved with:
sudo apt install --reinstall apache2-bin
sudo service apache2 start

Unable to connect to SQL server instance ubuntu 18.04

I am running SQL server on ubuntu 18.04 which I was able to connect to successfully via SSMS. But I am not able to connect anymore.
My first instinct was to check if the SQL server was running by executing
sudo systemctl status mssql-server
lo and behold the SQL server instance was active so I rebooted the entire server and ran the above command again and saw the following:
mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-10-16 16:49:17 UTC; 1min 13s ago
Docs: https://learn.microsoft.com/en-us/sql/linux
Process: 1025 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=1/FAILURE)
Main PID: 1025 (code=exited, status=1/FAILURE)
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Main process exited, code=exited, status=1/FAILURE
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Scheduled restart job, restart counter is at 3.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: Stopped Microsoft SQL Server Database Engine.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Start request repeated too quickly.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: Failed to start Microsoft SQL Server Database Engine.
I checked the logs at /var/opt/mssql/log/errorlog and found this .
2019-10-14 13:52:56.16 spid51 CImageHelper::Init () Failed load of
symbol file with path = /binn/;/BINN - Not enough storage is available to
process this command.
2019-10-14 13:52:56.17 spid51 CImageHelper::Init () Failed load of
symbol file with path = /binn/;/BINN - Not enough storage is available to process this command.
2019-10-14 13:52:56.19 spid51 Error: 19099, Severity: 16, State: 1.
2019-10-14 13:52:56.19 spid51 Trace ID '1' was stopped because of an error. Cause: 0x80070005(Access is denied.). Restart the trace after correcting the problem.
2019-10-14 13:52:56.20 spid51 Error: 17053, Severity: 16, State: 1.
2019-10-14 13:52:56.20 spid51 FCB::MakePreviousWritesDurable: Operating system error (null) encountered.
2019-10-14 13:52:56.21 spid51 Error: 9001, Severity: 21, State: 1.
2019-10-14 13:52:56.21 spid51 The log for database 'master' is not available. Check the operating system error log for related error messages. Resolve any errors and restart the database.
2019-10-14 13:52:56.24 spid51 Error: 9001, Severity: 21, State: 16.
I'm not an expert and don't know the next move to make.
So the reason for this error was getting was because I messed up with the file ownership..
running the following command fixed it for me too bad I spend so much time on this:
cd /var/opt
sudo chown mssql:mssql -R mssql
time to take that dump :-D.

MSSQL Service failed to start on ubuntu

Every time i checked the MSSQL service is failing i have over 5 GB memory on my virtual server. I have changed the sql port to 1533.
r*****k:~# sudo systemctl status mssql-server
● mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Fri 2017-11-17 15:39:39 UTC; 1min 37s ago
Process: 4906 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=255)
Main PID: 4906 (code=exited, status=255)
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Unit entered failed state.
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart.
Nov 17 15:39:39 SV0*****.com systemd[1]: Stopped Microsoft SQL Server Database Engine.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Start request repeated too quickly.
Nov 17 15:39:39 SV0*****.com systemd[1]: Failed to start Microsoft SQL Server Database Engine.
r*****k:/var/opt/mssql# cat mssql.conf
> [EULA] accepteula = Y</br>
>
> [network] ipaddress = 6*.*1.1*2.*8 kerberoskeytabfile =
> /var/opt/mssql/secrets/mssql.keytab tcpport = 1533
>
> [memory] memorylimitmb = 3328
>
> [filelocation] defaultdatadir = /tmp/data
Anyone can help to stable the mssql service on the vm.
Does your Ubuntu server have the firewall enabled? If so, it may be blocking port 1533, which is preventing the service from starting on that custom port.
You may want to look in /var/log/messages for additional information as well.

"systemctl status apache2.service" error in starting apache2

root#kudo2:~# sudo systemctl restart apache2
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
root#kudo2:~# systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2017-10-03 14:22:01 UTC; 3min 33s ago
Process: 17190 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Oct 03 14:22:01 kudo2 apachectl[17190]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Oct 03 14:22:01 kudo2 apachectl[17190]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Oct 03 14:22:01 kudo2 apachectl[17190]: no listening sockets available, shutting down
Oct 03 14:22:01 kudo2 apachectl[17190]: AH00015: Unable to open logs
Oct 03 14:22:01 kudo2 apachectl[17190]: Action 'start' failed.
Oct 03 14:22:01 kudo2 apachectl[17190]: The Apache error log may have more information.
Oct 03 14:22:01 kudo2 systemd[1]: apache2.service: Control process exited, code=exited status=1
Oct 03 14:22:01 kudo2 systemd[1]: Failed to start The Apache HTTP Server.
Oct 03 14:22:01 kudo2 systemd[1]: apache2.service: Unit entered failed state.
Oct 03 14:22:01 kudo2 systemd[1]: apache2.service: Failed with result 'exit-code'.
root#kudo2:~#
Something else is already using port 80. Try starting apache on a different port or else find out what else is using port 80 and move/kill it.
You could run ss -tlnp|grep -w 80 as a superuser to see which proccess is listening on port 80. This process could be configured to listen on another port. This would free port 80 and allow apache to run.

One Click Install - Dgraph - Gru

I installed dgraph gru for interviews
go get github.com/dgraph-io/gru
cd $GOPATH/src/github.com/dgraph-io/gru
git checkout develop
go build . && ./gru -user=admin -pass=pass -secret=0a45e5eGseF41o0719PJ39KljMK4F4v2
docker run -it -p 127.0.0.1:8088:8080 -p 127.0.0.1:9080:9080 -v ~/dgraph:/dgraph --name dgraph dgraph/dgraph:v0.7.5 dgraph --bindall=true
I'm getting below error when i try to create quiz or questions
Aug 09 10:14:23 gru[16999]: [negroni] Completed 500 Internal Server Error in 30.001305978s
Aug 09 10:14:24 gru[16999]: [negroni] Completed 500 Internal Server Error in 30.000762875s
Aug 09 10:19:40 gru[16999]: Error while rejecting candidates: Couldn't get response from Dgraph: Post http://localhost:8088/query: dial tcp 127.0.0.1:8088: i/o timeout[negroni] Started POST /api/admin/add-question
Aug 09 10:20:10 gru[16999]: [negroni] Completed 500 Internal Server Error in 30.001419475s
Aug 09 10:20:17 gru[16999]: [negroni] Started POST /api/admin/get-all-questions
Aug 09 10:20:31 gru[16999]: [negroni] Started GET /api/admin/get-all-tags
Aug 09 10:20:43 gru[16999]: [negroni] Started GET /api/admin/get-all-tags
Aug 09 10:20:47 gru[16999]: [negroni] Completed 500 Internal Server Error in 30.000821271s
Aug 09 10:21:01 gru[16999]: [negroni] Completed 500 Internal Server Error in 30.000790588s
Aug 09 10:21:13 gru[16999]: [negroni] Completed 500 Internal Server Error in 30.000748794s
Aug 09 11:12:24 gru[16999]: Error while rejecting candidates: Couldn't get response from Dgraph: Post http://localhost:8088/query: dial tcp 127.0.0.1:8088: i/o timeoutError while rejecting candidates: Couldn't get response from Dgraph: Post http://localhost:8088/query: dial tcp 127.0.0.1:8088: i/o timeoutError while rejecting candidates: Couldn't get response from Dgraph: Post http://localhost:8088/query: dial tcp 127.0.0.1:8088: i/o timeoutError while rejecting candidates: Couldn't get response from Dgraph: Post http://localhost:8088/query: dial tcp 127.0.0.1:8088: i/o timeoutError while rejecting candidates: Couldn't get response from Dgraph: Post http://localhost:8088/query: dial tcp 127.0.0.1:8088: i/o timeout[negroni] Started POST /api/admin/get-all-questions
Aug 09 11:12:54 gru[16999]: [negroni] Completed 500 Internal Server Error in 30.000807257s
Aug 09 11:13:10 gru[16999]: [negroni] Started GET /api/admin/get-all-tags
Aug 09 11:13:41 gru[16999]: [negroni] Completed 500 Internal Server Error in 30.000734698s
Aug 09 11:16:56 gru[16999]: Error while rejecting candidates: Couldn't get response from Dgraph: Post http://localhost:8088/query: dial tcp 127.0.0.1:8088: i/o timeout[negroni] Started POST /api/admin/add-question
Aug 09 11:17:26 gru[16999]: [negroni] Completed 500 Internal Server Error in 30.000777429s
I tried with different versions of dgraph database.
Is there any scripts or docker to install it on the fly.
From the logs I can see that it is not able to connect to Dgraph. Thats because docker is exposing port 8088 whereas Gru server expects Dgraph to be running on 8080. You can run Dgraph like
docker run -it -p 127.0.0.1:8080:8080 -v ~/dgraph:/dgraph dgraph/dgraph:v0.7.5 dgraph --bindall=true
You also have to run Gru server and caddy as mentioned in the README. Now that I think about it the UI doesn't need to be run separately from the Gru web server. I can try adding a one-step quick install guide over the weekend.

Resources