Unable to set password for the MariaDB "root" user - Vagrant - vagrant

I am running "Vagrant up --provision", it seems to be ok but at the end, I got an error shown below. Please help me to solve this problem as I tried many times with VPN and without VPN but getting error "Failed to start MariaDB 10.3.31 database server."
default: An error occurred while setting the password for the MariaDB administrative
default: user. This may have happened because the account already has a password, or
default: because of a communication problem with the MariaDB server.
default: You should check the account's password after the package installation.
default: Please read the /usr/share/doc/mariadb-server-10.3/README.Debian file for
default: more information.
default: Job for mariadb.service failed because the control process exited with error code.
default: See "systemctl status mariadb.service" and "journalctl -xe" for details.
default: invoke-rc.d: initscript mysql, action "start" failed.
default: ● mariadb.service - MariaDB 10.3.31 database server
default: Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
default: Drop-In: /etc/systemd/system/mariadb.service.d
default: └─migrated-from-my.cnf-settings.conf
default: Active: failed (Result: exit-code) since Sun 2021-11-07 17:38:01 UTC; 12ms ago
default: Docs: man:mysqld(8)
default: https://mariadb.com/kb/en/library/systemd/
default: Process: 6548 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
default: Process: 6404 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
default: Process: 6398 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
default: Process: 6387 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
default: Main PID: 6548 (code=exited, status=1/FAILURE)
default:
default: Nov 07 17:38:01 vvv mysqld[6548]: 2021-11-07 17:38:01 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
default: Nov 07 17:38:01 vvv mysqld[6548]: 2021-11-07 17:38:01 0 [Note] Crash recovery finished.
default: Nov 07 17:38:01 vvv mysqld[6548]: 2021-11-07 17:38:01 6 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")
default: Nov 07 17:38:01 vvv mysqld[6548]: 2021-11-07 17:38:01 0 [Note] InnoDB: Buffer pool(s) load completed at 211107 17:38:01
default: Nov 07 17:38:01 vvv mysqld[6548]: 2021-11-07 17:38:01 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
default: Nov 07 17:38:01 vvv mysqld[6548]: 2021-11-07 17:38:01 0 [Note] Server socket created on IP: '127.0.0.1'.
default: Nov 07 17:38:01 vvv mysqld[6548]: 2021-11-07 17:38:01 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
default: Nov 07 17:38:01 vvv systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
default: Nov 07 17:38:01 vvv systemd[1]: mariadb.service: Failed with result 'exit-code'.
default: Nov 07 17:38:01 vvv systemd[1]: Failed to start MariaDB 10.3.31 database server.
default: dpkg: error processing package mariadb-server-10.3 (--configure):
default: installed mariadb-server-10.3 package post-installation script subprocess returned error exit status 1
default: dpkg: dependency problems prevent configuration of mariadb-server:
default: mariadb-server depends on mariadb-server-10.3 (>= 1:10.3.31+maria~bionic); however:
default: Package mariadb-server-10.3 is not configured yet.
default:
default: dpkg: error processing package mariadb-server (--configure):
default: dependency problems - leaving unconfigured
default: No apport report written because the error message indicates its a followup error from a previous failure.
default: E: Sub-process /usr/bin/dpkg returned an error code (1)
default: Installing apt-get packages returned a failure code, cleaning up apt caches then exiting
default: Main packages check and install failed, halting provision
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.```

Try to set the database username and password in the .env file of your project. Something like this:
Then execute this command: vagrant reload --provision.
I am using HeidiSQL that lets me see and edit data and structures from my VM running one of the database systems MariaDB, MySQL etc.
Hope this answer helps you.

Related

Dante Socks5 proxy server doesn't start

I have installed Dante Proxy server by using following methods from the website. But the Server doesn't start and shows the following error. I have tried the steps from other websites also. I searched StackOverflow and saw the same issue in one question. but it has been solved yet. Anyone can solve it or suggest me any other alternative for SOCKS5 proxy server
Job for danted.service failed because the control process exited with error code. See "systemctl status danted.service" and "journalctl -xe" for details.
Error shown in systemctl status danted.service & journalctl -xe
steven#steven-VirtualBox:~$ systemctl status danted.service
● danted.service - LSB: SOCKS (v4 and v5) proxy daemon (danted)
Loaded: loaded (/etc/init.d/danted; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2019-03-10 18:12:42 IST; 2min 59s ago
Docs: man:systemd-sysv-generator(8)
Process: 3400 ExecStart=/etc/init.d/danted start (code=exited, status=1/FAILURE)
Mar 10 18:12:41 steven-VirtualBox systemd[1]: Starting LSB: SOCKS (v4 and v5) proxy daemon (danted)...
Mar 10 18:12:42 steven-VirtualBox danted[3405]: error: /etc/danted.conf: problem on line 11 near token "eth0": could not resolve hostname "eth0
Mar 10 18:12:42 steven-VirtualBox systemd[1]: danted.service: Control process exited, code=exited status=1
Mar 10 18:12:42 steven-VirtualBox danted[3400]: Starting Dante SOCKS daemon:
Mar 10 18:12:42 steven-VirtualBox systemd[1]: Failed to start LSB: SOCKS (v4 and v5) proxy daemon (danted).
Mar 10 18:12:42 steven-VirtualBox systemd[1]: danted.service: Unit entered failed state.
Mar 10 18:12:42 steven-VirtualBox systemd[1]: danted.service: Failed with result 'exit-code'.
steven#steven-VirtualBox:~$ journalctl -xe
-- The result is failed.
Mar 10 18:11:40 steven-VirtualBox systemd[1]: danted.service: Unit entered failed state.
Mar 10 18:11:40 steven-VirtualBox systemd[1]: danted.service: Failed with result 'exit-code'.
Mar 10 18:12:40 steven-VirtualBox sudo[3397]: steven : TTY=pts/18 ; PWD=/home/steven ; USER=root ; COMMAND=/bin/systemctl restart danted
Mar 10 18:12:41 steven-VirtualBox sudo[3397]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 10 18:12:41 steven-VirtualBox systemd[1]: Stopped LSB: SOCKS (v4 and v5) proxy daemon (danted).
-- Subject: Unit danted.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit danted.service has finished shutting down.
Mar 10 18:12:41 steven-VirtualBox systemd[1]: Starting LSB: SOCKS (v4 and v5) proxy daemon (danted)...
-- Subject: Unit danted.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit danted.service has begun starting up.
Mar 10 18:12:42 steven-VirtualBox danted[3405]: error: /etc/danted.conf: problem on line 11 near token "eth0": could not resolve hostname "eth0
Mar 10 18:12:42 steven-VirtualBox danted[3405]: alert: mother[1/1]: shutting down
Mar 10 18:12:42 steven-VirtualBox systemd[1]: danted.service: Control process exited, code=exited status=1
Mar 10 18:12:42 steven-VirtualBox danted[3400]: Starting Dante SOCKS daemon:
Mar 10 18:12:42 steven-VirtualBox sudo[3397]: pam_unix(sudo:session): session closed for user root
Mar 10 18:12:42 steven-VirtualBox systemd[1]: Failed to start LSB: SOCKS (v4 and v5) proxy daemon (danted).
-- Subject: Unit danted.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit danted.service has failed.
--
-- The result is failed.
Mar 10 18:12:42 steven-VirtualBox systemd[1]: danted.service: Unit entered failed state.
Mar 10 18:12:42 steven-VirtualBox systemd[1]: danted.service: Failed with result 'exit-code'.
Mar 10 18:12:50 steven-VirtualBox sudo[3407]: steven : TTY=pts/18 ; PWD=/home/steven ; USER=root ; COMMAND=/bin/systemctl status danted
Mar 10 18:12:50 steven-VirtualBox sudo[3407]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 10 18:14:38 steven-VirtualBox sudo[3407]: pam_unix(sudo:session): session closed for user root
I had the same issue and came across your question. I fixed it by adding a systemd dependency of network-online.target to the danted.service, based on reading this https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
Here's how:
sudo systemctl edit danted.service
add this:
[Unit]
After=network-online.target
Wants=network-online.target
save & exit, run this for good measure
sudo systemctl daemon-reload
sudo systemctl enable danted.service
This line is the telltale:
Mar 10 18:12:42 steven-VirtualBox danted[3405]: error: /etc/danted.conf: problem on line 11 near token "eth0": could not resolve hostname "eth0
It looks like there is no interface called eth0.
I had the same issue, found out what the actual interface is called using ifconfig and swapped out eth0 for that.
Find the interface of your device from Terminal with netstat -rn and look at the Iface column. Install netstat with sudo apt install net-tools if you don't have it. Change the settings of external: eth0 to external: xxxx where of course xxxx being your Iface value, in the file /etc/danted.conf.
If you're just starting out and there's not yet saved rules in danted.conf you can simply delete the file with sudo rm /etc/danted.conf and then create a new with sudo nano /etc/danted.conf. If using firewall it is mandatory that you open the port 1080 with sudo ufw allow 1080. In the new empty file danted.conf, paste in
logoutput: syslog
user.privileged: root
user.unprivileged: nobody
# The listening network interface or address.
internal: 0.0.0.0 port=1080
# The proxying network interface or address.
external: xxxx #Replace xxxx with the device's Iface
# socks-rules determine what is proxied through the external interface.
socksmethod: username
# client-rules determine who can connect to the internal interface.
clientmethod: none
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
}
Save the file and run
sudo systemctl restart danted.service
sudo systemctl status danted.service

Apache server not working locally in ubuntu showing an error " Failed to start The Apache HTTP Server." on terminal

user#user-desktop:~$ sudo service apache2 restart
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
user#user-desktop:~$ systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Tue 2018-09-18 16:45:15 IST; 7s ago
Process: 12099 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Sep 18 16:45:14 user-desktop systemd[1]: Starting The Apache HTTP Server...
Sep 18 16:45:14 user-desktop apachectl[12099]: apache2: Syntax error on line 225 of /etc/apache2/apache2.conf: Syntax error on line
14 of /etc
Sep 18 16:45:15 user-desktop apachectl[12099]: Action 'start' failed.
Sep 18 16:45:15 user-desktop apachectl[12099]: The Apache error log may have more information.
Sep 18 16:45:15 user-desktop systemd[1]: apache2.service: Control process exited, code=exited status=1
Sep 18 16:45:15 user-desktop systemd[1]: apache2.service: Failed with result 'exit-code'.
Sep 18 16:45:15 user-desktop systemd[1]: Failed to start The Apache HTTP Server.

Fail2Ban: Service failed when log files symlink to another device

I am using a Raspberry Pi. To reduce I/O on my SD-Card I symlink all important log files to an external USB-mounted Harddrive.
Example:
ln -s /media/usb-device/logs/auth.log /var/log/auth.log
The logging works fine. But fail2ban seems not to like that. When I enable my ssh-monitoring in my /etc/fail2ban/jail.local file,
# [sshd]
enabled = true
bantime = 3600
fail2ban crash during executing this command systemctl restart fail2ban.service
I have tried to hardcode the path:
# logpath = %(sshd_log)s
logpath = /media/usb-devive/logs/auth.log
But fail2ban throws the same error:
fail2ban.service - Fail2Ban Service
Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2018-04-28 20:42:33 CEST; 45s ago
Docs: man:fail2ban(1)
Process: 3014 ExecStop=/usr/bin/fail2ban-client stop (code=exited, status=0/SUCCESS)
Process: 3045 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)
Main PID: 658 (code=killed, signal=TERM)
Apr 28 20:42:33 raspberrypi systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Apr 28 20:42:33 raspberrypi systemd[1]: Stopped Fail2Ban Service.
Apr 28 20:42:33 raspberrypi systemd[1]: fail2ban.service: Start request repeated too quickly.
Apr 28 20:42:33 raspberrypi systemd[1]: Failed to start Fail2Ban Service.
Apr 28 20:42:33 raspberrypi systemd[1]: fail2ban.service: Unit entered failed state.
Apr 28 20:42:33 raspberrypi systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Any ideas?
"devive" in the logpath is spelt incorrectly

Failed to start system service on centos with ansible-playbook

I created a system service called cooltoo_storage on centos. I am able to start/stop/restart the service by running the command "service cooltoo_storage start/stop/restart". Now I want to configure it on ansible playbook. Below is my config for starting this service.
- name: start cooltoo_storage service
sudo: yes
service:
name: cooltoo_storage
state: started
After running the ansible-playbook, I got below error
msg: Job for cooltoo_storage.service failed because the control process exited with error code. See "systemctl status cooltoo_storage.service" and "journalctl -xe" for details.
FATAL: all hosts have already failed -- aborting
Below is the command output of "systemctl status cooltoo_storage.service",
● cooltoo_storage.service - LSB: cooltoo storage provider
Loaded: loaded (/etc/rc.d/init.d/cooltoo_storage)
Active: failed (Result: exit-code) since Mon 2016-05-02 11:39:07 CST; 1min 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 26661 ExecStart=/etc/rc.d/init.d/cooltoo_storage start (code=exited, status=203/EXEC)
May 02 11:39:07 Cool-Too systemd[1]: Starting LSB: cooltoo storage provider...
May 02 11:39:07 Cool-Too systemd[26661]: Failed at step EXEC spawning /etc/rc.d/init.d/cooltoo_storage: Exec format error
May 02 11:39:07 Cool-Too systemd[1]: cooltoo_storage.service: control process exited, code=exited status=203
May 02 11:39:07 Cool-Too systemd[1]: Failed to start LSB: cooltoo storage provider.
May 02 11:39:07 Cool-Too systemd[1]: Unit cooltoo_storage.service entered failed state.
May 02 11:39:07 Cool-Too systemd[1]: cooltoo_storage.service failed.
How should I fix this issue?
The problem is irrelevant to Ansible.
Your service cooltoo_storage failed to start. Just make sure it works:
sudo systemctl restart cooltoo_storage.service
sudo systemctl status cooltoo_storage.service
And if not - fix it. Probably cooltoo_storage custom written service. Start investigating from checking out startup config for this specific service:
systemctl cat cooltoo_storage.service
and contents of: /etc/rc.d/init.d/cooltoo_storage

FreeSwitch Start Gives this Error: ==>freeswitch.service failed. See 'systemctl status freeswitch.service' and 'journalctl -xn' for details

When I try to start Freeswitch using bellow command :
/etc/init.d/freeswitch
It gives errors:-
[....] Starting freeswitch (via systemctl): freeswitch.serviceJob for
freeswitch.service failed. See 'systemctl status
freeswitch.service' and 'journalctl -xn' for details. failed!
Then I run this systemctl status freeswitch.service command that time it gives me this error:
● freeswitch.service - freeswitch Loaded: loaded
(/lib/systemd/system/freeswitch.service; enabled) Active: failed
(Result: start-limit) since Tue 2016-03-29 00:52:08 EDT; 8s ago
Process: 25997 ExecStart=/usr/bin/freeswitch -u freeswitch -g
freeswitch -ncwait $DAEMON_OPTS (code=exited, status=1/FAILURE)
Mar 29 00:52:07 systemd[1]: Failed to start freeswitch. Mar 29
00:52:07 systemd[1]: Unit freeswitch.service entered failed state.
Mar 29 00:52:08 systemd[1]: freeswitch.service start request repeated
too quickly, refusing to start. Mar 29 00:52:08 systemd[1]: Failed to
start freeswitch. Mar 29 00:52:08 media03 systemd[1]: Unit
freeswitch.service entered failed state.
Then I run journalctl -xn this command it gives me this error:
-- Logs begin at Tue 2016-03-22 15:12:38 EDT, end at Tue 2016-03-29 01:17:01 EDT. -- Mar 29 01:05:54 freeswitch[26066]: FreeSWITCH[26066]
Error starting system! pid:26067 Mar 29 01:05:54 systemd[1]:
freeswitch.service: control process exited, code=exited status=1 Mar
29 01:05:54 systemd[1]: Failed to start freeswitch.
-- Subject: Unit freeswitch.service has failed
-- Defined-By: systemd
-- Unit freeswitch.service has failed.
-- The result is failed. Mar 29 01:05:54 systemd[1]: Unit freeswitch.service entered failed state. Mar 29 01:17:01 CRON[26073]:
pam_unix(cron:session): session opened for user root by (uid=0) Mar 29
01:17:01 CRON[26074]: (root) CMD ( cd / && run-parts --report
/etc/cron.hourly) Mar 29 01:17:01 CRON[26073]:
pam_unix(cron:session): session closed for user root
Freeswitch.log
2016-03-18 13:13:16.027486 [NOTICE] switch_loadable_module.c:1183 Deleting File Format 'ul'
2016-03-18 13:13:16.027486 [NOTICE] switch_loadable_module.c:1183 Deleting File Format 'ulaw'
2016-03-18 13:13:16.027486 [NOTICE] switch_loadable_module.c:1183 Deleting File Format 'al'
2016-03-18 13:13:16.027486 [NOTICE] switch_loadable_module.c:1183 Deleting File Format 'alaw'
2016-03-18 13:13:16.027486 [NOTICE] switch_loadable_module.c:1183 Deleting File Format 'adpcm'
2016-03-18 13:13:16.027486 [NOTICE] switch_loadable_module.c:1183 Deleting File Format 'vox'
2016-03-18 13:13:16.027486 [CONSOLE] switch_loadable_module.c:2008 Stopping: mod_sndfile
2016-03-18 13:13:16.027486 [DEBUG] switch_loadable_module.c:1330 Write lock interface 'en' to wait for existing references.
2016-03-18 13:13:16.027486 [NOTICE] switch_loadable_module.c:1338 Deleting Say interface 'en'
2016-03-18 13:13:16.027486 [CONSOLE] switch_loadable_module.c:2011 mod_say_en has no shutdown routine
This problem is related to your init script is not working properly.
so try below
/usr/local/freeswitch/bin/freeswitch
If still problem exist just try to killall freeswitch processes.
Then again start the freeswitch

Resources