meza icon indicating copy to clipboard operation
meza copied to clipboard

Issues getting meza to run on debian (raspbian lite)

Open darenwelsh opened this issue 5 years ago • 22 comments

Environment

  • Raspberry Pi 3
  • Raspbian GNU/Linux 9 (stretch), Linux 4.14.98-v7+ kernel
  • meza version hash: 492a02f

What works so far

  1. Install raspbian lite
  2. sudo raspi-config -> Interfacing options -> ssh -> enable; restart
  3. ssh into pi
  4. sudo apt update
  5. sudo apt upgrade
  6. sudo apt install -y git
  7. sudo git clone https://github.com/enterprisemediawiki/meza /opt/meza
  8. cd /opt/meza/
  9. sudo git checkout --track origin/32.x
  10. m_install_netdata: False in config in order to skip installing netdata
  11. sudo apt install build-essential libssl-dev libffi-dev python-dev
  12. sudo pip install cryptography
  13. sudo bash /opt/meza/src/scripts/getmeza.sh
  14. sudo shutdown -r now (restart)
  15. sudo meza deploy monolith

Issue details

I ran the commands here: https://www.mediawiki.org/wiki/Meza/Install_on_existing_server

When I ran sudo bash /opt/meza/src/scripts/getmeza.sh using the master branch of meza, I got the following:

cat: /etc/redhat-release: No such file or directory
/opt/meza/src/scripts/getmeza.sh: line 27: rpm: command not found
/opt/meza/src/scripts/getmeza.sh: line 32: yum: command not found

Add ansible master user
Generating public/private rsa key pair.
Your identification has been saved in /opt/conf-meza/users/meza-ansible/.ssh/id_rsa.
Your public key has been saved in /opt/conf-meza/users/meza-ansible/.ssh/id_rsa.pub.
The key fingerprint is:
<redacted> meza-ansible@raspberrypi
The key's randomart image is:
<redacted>
+----[SHA256]-----+
meza-ansible ALL=(ALL) NOPASSWD: ALL
chown: invalid group: ‘meza-ansible:wheel’
chown: invalid group: ‘meza-ansible:wheel’
meza command installed. Use it:
  sudo meza deploy monolith

I then checked out the 32.x branch using sudo git checkout --track origin/32.x

When I ran sudo bash /opt/meza/src/scripts/getmeza.sh again, I got the following:

group 'wheel' does not exist. creating.
Reading package lists... Done
Building dependency tree
Reading state information... Done
git is already the newest version (1:2.11.0-3+deb9u4).
The following NEW packages will be installed:
  libyaml-0-2 python-yaml
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 143 kB of archives.
After this operation, 568 kB of additional disk space will be used.
Get:1 http://raspbian.mirrors.lucidnetworks.net/raspbian stretch/main armhf libyaml-0-2 armhf 0.1.7-2 [39.9 kB]
Get:2 http://raspbian.mirrors.lucidnetworks.net/raspbian stretch/main armhf python-yaml armhf 3.12-1 [103 kB]
Fetched 143 kB in 1s (112 kB/s)
Selecting previously unselected package libyaml-0-2:armhf.
(Reading database ... 35607 files and directories currently installed.)
Preparing to unpack .../libyaml-0-2_0.1.7-2_armhf.deb ...
Unpacking libyaml-0-2:armhf (0.1.7-2) ...
Selecting previously unselected package python-yaml.
Preparing to unpack .../python-yaml_3.12-1_armhf.deb ...
Unpacking python-yaml (3.12-1) ...
Setting up libyaml-0-2:armhf (0.1.7-2) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up python-yaml (3.12-1) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  python-pkg-resources
Suggested packages:
  python-setuptools-doc
The following NEW packages will be installed:
  python-pkg-resources python-setuptools
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 463 kB of archives.
After this operation, 1,590 kB of additional disk space will be used.
Get:1 http://raspbian.mirrors.lucidnetworks.net/raspbian stretch/main armhf python-pkg-resources all 33.1.1-1 [166 kB]
Get:2 http://raspbian.mirrors.lucidnetworks.net/raspbian stretch/main armhf python-setuptools all 33.1.1-1 [297 kB]
Fetched 463 kB in 1s (347 kB/s)
Selecting previously unselected package python-pkg-resources.
(Reading database ... 35644 files and directories currently installed.)
Preparing to unpack .../python-pkg-resources_33.1.1-1_all.deb ...
Unpacking python-pkg-resources (33.1.1-1) ...
Selecting previously unselected package python-setuptools.
Preparing to unpack .../python-setuptools_33.1.1-1_all.deb ...
Unpacking python-setuptools (33.1.1-1) ...
Setting up python-pkg-resources (33.1.1-1) ...
Setting up python-setuptools (33.1.1-1) ...
Searching for pip
Reading https://pypi.python.org/simple/pip/
Downloading https://files.pythonhosted.org/packages/93/ab/f86b61bef7ab14909bd7ec3cd2178feb0a1c86d451bc9bccd5a1aedcde5f/pip-19.1.1.tar.gz#sha256=44d3d7d3d30a1eb65c7e5ff1173cdf8f7467850605ac7cc3707b6064bddd0958
Best match: pip 19.1.1
Processing pip-19.1.1.tar.gz
Writing /tmp/easy_install-4r9dmC/pip-19.1.1/setup.cfg
Running pip-19.1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-4r9dmC/pip-19.1.1/egg-dist-tmp-QQ1nTb
warning: no files found matching 'docs/docutils.conf'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching 'tox.ini'
warning: no files found matching 'Makefile' under directory 'docs'
warning: no files found matching '*.bat' under directory 'docs'
warning: no previously-included files found matching 'src/pip/_vendor/six'
warning: no previously-included files found matching 'src/pip/_vendor/six/moves'
warning: no previously-included files matching '*.pyi' found under directory 'src/pip/_vendor'
no previously-included directories found matching '.github'
no previously-included directories found matching '.azure-pipelines'
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'news'
no previously-included directories found matching 'tasks'
no previously-included directories found matching 'tests'
no previously-included directories found matching 'tools'
creating /usr/local/lib/python2.7/dist-packages/pip-19.1.1-py2.7.egg
Extracting pip-19.1.1-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding pip 19.1.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/pip-19.1.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting ansible
  Downloading https://files.pythonhosted.org/packages/17/c9/d379b76ecaa42f4ee08b01c365e9ed1be0b302ff8a26eef120d481b144fa/ansible-2.8.0.tar.gz (14.3MB)
     |████████████████████████████████| 14.3MB 401kB/s
Requirement already satisfied: PyYAML in /usr/lib/python2.7/dist-packages (from ansible) (3.12)
Collecting cryptography (from ansible)
  Downloading https://files.pythonhosted.org/packages/07/ca/bc827c5e55918ad223d59d299fff92f3563476c3b00d0a9157d9c0217449/cryptography-2.6.1.tar.gz (491kB)
     |████████████████████████████████| 501kB 1.3MB/s
  Installing build dependencies ... error
  ERROR: Complete output from command /usr/bin/python /usr/local/lib/python2.7/dist-packages/pip-19.1.1-py2.7.egg/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-5gHeYN/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=18.5' wheel 'cffi>=1.8,!=1.11.3; python_implementation != '"'"'PyPy'"'"'':
  DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
  Collecting setuptools>=18.5
    Downloading https://files.pythonhosted.org/packages/ec/51/f45cea425fd5cb0b0380f5b0f048ebc1da5b417e48d304838c02d6288a1e/setuptools-41.0.1-py2.py3-none-any.whl (575kB)
  Collecting wheel
    Downloading https://files.pythonhosted.org/packages/bb/10/44230dd6bf3563b8f227dbf344c908d412ad2ff48066476672f3a72e174e/wheel-0.33.4-py2.py3-none-any.whl
  Collecting cffi!=1.11.3,>=1.8
    Downloading https://files.pythonhosted.org/packages/93/1a/ab8c62b5838722f29f3daffcc8d4bd61844aa9b5f437341cc890ceee483b/cffi-1.12.3.tar.gz (456kB)
  Collecting pycparser (from cffi!=1.11.3,>=1.8)
    Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
  Installing collected packages: setuptools, wheel, pycparser, cffi
    Running setup.py install for pycparser: started
      Running setup.py install for pycparser: finished with status 'done'
    Running setup.py install for cffi: started
      Running setup.py install for cffi: finished with status 'error'
      ERROR: Complete output from command /usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-AwGfYe/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lnZ060/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-5gHeYN/overlay --compile:
      ERROR: Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-2.7
      creating build/lib.linux-armv7l-2.7/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/__init__.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/verifier.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/cparser.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/recompiler.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/error.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/commontypes.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/lock.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/api.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/model.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/_embedding.h -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-2.7/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-armv7l-2.7
      creating build/temp.linux-armv7l-2.7/c
      arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-Ub3vap/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o
      c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
       #include <Python.h>
                          ^
      compilation terminated.
      error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
      ----------------------------------------
  ERROR: Command "/usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-AwGfYe/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lnZ060/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-5gHeYN/overlay --compile" failed with error code 1 in /tmp/pip-install-AwGfYe/cffi/
  ----------------------------------------
ERROR: Command "/usr/bin/python /usr/local/lib/python2.7/dist-packages/pip-19.1.1-py2.7.egg/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-5gHeYN/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=18.5' wheel 'cffi>=1.8,!=1.11.3; python_implementation != '"'"'PyPy'"'"''" failed with error code 1 in None
meza-ansible already exists
meza-ansible home-dir in correct location

Add ansible master user
Ansible user: meza-ansible
SSH keys exist for user meza-ansible. Moving on.
Adding the following to /etc/sudoers.d/meza-ansible:
meza-ansible ALL=(ALL) NOPASSWD: ALL
meza command installed. Use it:
  sudo meza deploy monolith

I then tried running sudo meza deploy monolith and got the following:

Type the domain or IP address you'll use to get to your wiki and press [enter]
Domain or IP address: 192.168.56.56

Type a database password and press [enter] or leave blank to auto-generate
Database password:
su meza-ansible -c "ansible-playbook /opt/meza/src/playbooks/setup-env.yml --extra-vars @/opt/conf-meza/secret/temp_vars.json"
sh: 1: ansible-playbook: not found

Please review your host file. Run command:
  sudo vi /opt/conf-meza/secret/monolith/hosts
Please review your secret config. Run command:
  sudo vi /opt/conf-meza/secret/monolith/secret.yml
Traceback (most recent call last):
  File "/usr/bin/meza", line 981, in <module>
    main(sys.argv[1:])
  File "/usr/bin/meza", line 62, in main
    globals()[command_fn]( argv[1:] )
  File "/usr/bin/meza", line 105, in meza_command_deploy
    shell_cmd = playbook_cmd( 'site', env, more_extra_vars )
  File "/usr/bin/meza", line 741, in playbook_cmd
    meza_chown( secret_file, 'meza-ansible', 'wheel' )
  File "/usr/bin/meza", line 863, in meza_chown
    os.chown( path, uid, gid )
OSError: [Errno 2] No such file or directory: '/opt/conf-meza/secret/monolith/secret.yml'

darenwelsh avatar May 26 '19 21:05 darenwelsh

Ref: https://stackoverflow.com/questions/22073516/failed-to-install-python-cryptography-package-with-pip-and-setup-py

This seemed to fix it:

sudo apt install build-essential libssl-dev libffi-dev python-dev
sudo pip install cryptography

All of that may not be required. I'm just guessing at this point.

darenwelsh avatar May 26 '19 22:05 darenwelsh

TASK [base : Ensure UFW is enabled and denying access by default (Debian only)] *****************************
Sunday 26 May 2019  23:40:51 +0100 (0:00:00.389)       0:01:35.943 ************
fatal: [localhost]: FAILED! => {
    "changed": false,
    "commands": [
        "/usr/sbin/ufw status verbose"
    ]
}

MSG:

ERROR: problem running iptables: iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Restarting the machine "fixes" the above issue (sudo shutdown -r now), but then I get the next issue:

TASK [base : Ensure sshd is running and enabled] *************************************************************************
Monday 27 May 2019  01:44:27 +0100 (0:00:03.388)       0:01:49.966 ************
fatal: [localhost]: FAILED! => {
    "changed": false
}

MSG:

Could not find the requested service sshd: host

darenwelsh avatar May 27 '19 02:05 darenwelsh

@cicalese has reported some issues with UFW on Debian. I haven't had a chance to put more work into Debian support in a while, and since there's no testing running against Debian it's hard to track where the issues are.

I'm not sure why cryptography is required from pip. #809 has suggested it should be installed for a while, but purely for efficiency. #1163 (PR running tests as I write this) ensures PIP is installed for Python 2 and 3 on Meza master branch. I know PIP for Python 3 (pip3 command) is already installed on 32.x but I don't recall if that's the case for Python 2. Meza's Ansible usage relies upon Python 2, so that'd need the corresponding PIP. I don't see you explicitly installing PIP in your steps above, but perhaps Debian already has it, or perhaps it comes along with the python-dev install you did. Anyway, adding the lines from #809 should remove your requirement to install cryptography.

As for the SSH issue, [1] indicates that on Raspbian the SSH service is called ssh rather than sshd. It's unclear to me whether on Debian in general it has the d on the end, but I think the d (meaning daemon) generally is a RedHat thing (or at least not a Debian thing).

[1] https://raspberrypi.stackexchange.com/questions/73119/enabling-ssh-by-default-on-raspbian-stretch

jamesmontalvo3 avatar May 27 '19 16:05 jamesmontalvo3

I just pushed the 32.x-ssh-service-name branch [1][2] that specifies ssh for Debian and sshd for RedHat. Give it a try. Will need @cicalese or @freephile to give it a whirl on a standard Debian 9 (not Raspbian) system to make it official, though.

[1] https://github.com/enterprisemediawiki/meza/compare/32.x..32.x-ssh-service-name [2] 13cf85182fd039142898d809b79357db8240b1a4

jamesmontalvo3 avatar May 27 '19 17:05 jamesmontalvo3

Thanks, it looks like 32.x-ssh-service-name fixed the sshd issue.

Here's the latest output from deploy. It looks like the pi cpu isn't compatible with Netdata, at least whatever this Ansible task provides.

This post indicates that netdata can be compiled on a pi. So maybe meza could detect if the hardware is a pi (or if it uses an ARM chip) and then use this alternate method.

TASK [netdata : Check if Netdata is present] *************************************************************************************
Monday 27 May 2019  19:49:44 +0100 (0:00:01.416)       0:09:59.673 ************
[DEPRECATION WARNING]: evaluating m_install_netdata as a bare variable, this behaviour will go away and you might need to add
|bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This feature will be removed in
version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [localhost]

TASK [netdata : debug] ***********************************************************************************************************
Monday 27 May 2019  19:49:45 +0100 (0:00:00.909)       0:10:00.583 ************
[DEPRECATION WARNING]: evaluating m_install_netdata as a bare variable, this behaviour will go away and you might need to add
|bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This feature will be removed in
version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [localhost] => {}

MSG:

netdata not installed


TASK [netdata : debug] ***********************************************************************************************************
Monday 27 May 2019  19:49:45 +0100 (0:00:00.384)       0:10:00.967 ************
[DEPRECATION WARNING]: evaluating m_install_netdata as a bare variable, this behaviour will go away and you might need to add
|bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This feature will be removed in
version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
skipping: [localhost]

TASK [netdata : Install Intel/AMD 64bit static build of Netdata] *****************************************************************
Monday 27 May 2019  19:49:45 +0100 (0:00:00.355)       0:10:01.323 ************
[DEPRECATION WARNING]: evaluating m_install_netdata as a bare variable, this behaviour will go away and you might need to add
|bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This feature will be removed in
version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
fatal: [localhost]: FAILED! => {
    "changed": true,
    "cmd": "bash <(curl -Ss https://my-netdata.io/kickstart-static64.sh) --dont-wait",
    "delta": "0:00:00.675421",
    "end": "2019-05-27 19:49:47.134231",
    "rc": 1,
    "start": "2019-05-27 19:49:46.458810"
}

STDERR:

 ABORTED  Static binary versions of netdata are available only for 64bit Intel/AMD CPUs (x86_64), but yours is: armv7l.


MSG:

non-zero return code

darenwelsh avatar May 27 '19 19:05 darenwelsh

Making a check for CPU architecture should be pretty straightforward. @freephile might be able to help since he added Netdata.

jamesmontalvo3 avatar May 27 '19 19:05 jamesmontalvo3

I guess I could also try Netdata's installer to see if it handles pis.

darenwelsh avatar May 27 '19 19:05 darenwelsh

To get Netdata installed, I had to sudo apt install uuid-dev zlib1g-dev make.

darenwelsh avatar May 27 '19 19:05 darenwelsh

Latest issue during deploy:

TASK [database : Rotate MariaDB log] *********************************************************************************************
Monday 27 May 2019  20:48:03 +0100 (0:00:00.962)       0:11:22.181 ************
changed: [localhost]

TASK [database : Create datadir if it does not exist] ****************************************************************************
Monday 27 May 2019  20:48:05 +0100 (0:00:01.606)       0:11:23.788 ************
fatal: [localhost]: FAILED! => {
    "changed": true,
    "cmd": "mysql_install_db --datadir=/opt/data-meza/mariadb",
    "delta": "0:00:00.062076",
    "end": "2019-05-27 20:48:06.037713",
    "rc": 1,
    "start": "2019-05-27 20:48:05.975637"
}

STDOUT:

Neither host 'localhost' nor 'localhost' could be looked up with
'/usr/sbin/resolveip'
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db


MSG:

non-zero return code

darenwelsh avatar May 27 '19 19:05 darenwelsh

For some reason I had my machine named localhost. So I changed it and that error did not return.

darenwelsh avatar May 27 '19 20:05 darenwelsh

TASK [database : Ensure MySQL is started and enabled on boot.] *******************************************************
Monday 27 May 2019  21:12:50 +0100 (0:00:00.373)       0:08:11.440 ************
fatal: [localhost]: FAILED! => {
    "changed": false
}

MSG:

Unable to start service mariadb: Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
pi@raspi:~ $ systemctl status mariadb.service
● mariadb.service - MariaDB 10.1.38 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-05-27 21:12:54 BST; 3min 15s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 11944 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, stat
  Process: 11809 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`
  Process: 11805 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCC
  Process: 11803 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCE
 Main PID: 11944 (code=exited, status=1/FAILURE)
   Status: "Starting Innodb crash recovery"

May 27 21:12:51 raspi systemd[1]: Starting MariaDB 10.1.38 database server...
May 27 21:12:53 raspi mysqld[11944]: 2019-05-27 21:12:53 1988525872 [Note] /usr/sbin/mysqld (mysqld 10.1.38-MariaDB-0+
May 27 21:12:54 raspi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 27 21:12:54 raspi systemd[1]: Failed to start MariaDB 10.1.38 database server.
May 27 21:12:54 raspi systemd[1]: mariadb.service: Unit entered failed state.
May 27 21:12:54 raspi systemd[1]: mariadb.service: Failed with result 'exit-code'.
lines 1-18/18 (END)
pi@raspi:~ $ journalctl -xe
May 27 21:12:47 raspi ansible-command[11728]: Invoked with creates=/var/log/mysql.err executable=None _uses_shell=True
May 27 21:12:47 raspi sudo[11723]: pam_unix(sudo:session): session closed for user root
May 27 21:12:47 raspi sudo[11737]: meza-ansible : TTY=unknown ; PWD=/opt/meza/src/playbooks ; USER=root ; COMMAND=/bin
May 27 21:12:47 raspi sudo[11737]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 27 21:12:48 raspi kernel: [UFW BLOCK] IN=wlan0 OUT= MAC=01:00:5e:00:00:fb:88:b4:a6:6b:87:cd:08:00 SRC=192.168.1.4
May 27 21:12:48 raspi ansible-file[11742]: Invoked with directory_mode=None force=False remote_src=None _original_base
May 27 21:12:48 raspi sudo[11737]: pam_unix(sudo:session): session closed for user root
May 27 21:12:48 raspi sudo[11758]: meza-ansible : TTY=unknown ; PWD=/opt/meza/src/playbooks ; USER=root ; COMMAND=/bin
May 27 21:12:48 raspi sudo[11758]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 27 21:12:49 raspi ansible-stat[11763]: Invoked with checksum_algorithm=sha1 get_checksum=True follow=False path=/e
May 27 21:12:49 raspi sudo[11758]: pam_unix(sudo:session): session closed for user root
May 27 21:12:49 raspi sudo[11772]: meza-ansible : TTY=unknown ; PWD=/opt/meza/src/playbooks ; USER=root ; COMMAND=/bin
May 27 21:12:49 raspi sudo[11772]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 27 21:12:50 raspi ansible-file[11777]: Invoked with directory_mode=None force=False remote_src=None _original_base
May 27 21:12:50 raspi sudo[11772]: pam_unix(sudo:session): session closed for user root
May 27 21:12:51 raspi sudo[11792]: meza-ansible : TTY=unknown ; PWD=/opt/meza/src/playbooks ; USER=root ; COMMAND=/bin
May 27 21:12:51 raspi sudo[11792]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 27 21:12:51 raspi ansible-systemd[11797]: Invoked with no_block=False force=None name=mariadb daemon_reexec=False
May 27 21:12:51 raspi systemd[1]: Starting MariaDB 10.1.38 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit mariadb.service has begun starting up.
May 27 21:12:53 raspi mysqld[11944]: 2019-05-27 21:12:53 1988525872 [Note] /usr/sbin/mysqld (mysqld 10.1.38-MariaDB-0+
May 27 21:12:54 raspi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 27 21:12:54 raspi systemd[1]: Failed to start MariaDB 10.1.38 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit mariadb.service has failed.
--
-- The result is failed.
May 27 21:12:54 raspi systemd[1]: mariadb.service: Unit entered failed state.
May 27 21:12:54 raspi systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 27 21:12:55 raspi sudo[11792]: pam_unix(sudo:session): session closed for user root
May 27 21:12:55 raspi su[1210]: pam_unix(su:session): session closed for user meza-ansible
May 27 21:12:55 raspi sudo[1202]: pam_unix(sudo:session): session closed for user root
May 27 21:14:50 raspi kernel: [UFW BLOCK] IN=wlan0 OUT= MAC=01:00:5e:00:00:01:2c:30:33:fd:ce:fe:08:00 SRC=0.0.0.0 DST=
May 27 21:14:54 raspi kernel: [UFW BLOCK] IN=wlan0 OUT= MAC=01:00:5e:00:00:fb:a4:77:33:51:66:0a:08:00 SRC=192.168.1.3
May 27 21:16:10 raspi sudo[11998]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/systemctl status mar
May 27 21:16:10 raspi sudo[11998]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
May 27 21:16:31 raspi sudo[11998]: pam_unix(sudo:session): session closed for user root
May 27 21:16:56 raspi kernel: [UFW BLOCK] IN=wlan0 OUT= MAC=01:00:5e:00:00:01:2c:30:33:fd:ce:fe:08:00 SRC=0.0.0.0 DST=
May 27 21:16:59 raspi kernel: [UFW BLOCK] IN=wlan0 OUT= MAC=01:00:5e:00:00:fb:88:b4:a6:6b:87:cd:08:00 SRC=192.168.1.4
May 27 21:17:01 raspi CRON[12007]: pam_unix(cron:session): session opened for user root by (uid=0)
May 27 21:17:01 raspi CRON[12011]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
May 27 21:17:01 raspi CRON[12007]: pam_unix(cron:session): session closed for user root

darenwelsh avatar May 27 '19 20:05 darenwelsh

I merged 32.x-ssh-service-name into 32.x after reading a few things that said Debian's SSH service is called ssh. Perhaps it also has an alias at sshd and that's why there weren't failures before. I should have tested it more first but I've got too many changes pending right now. I'll test more extensively on Debian later or @freephile or @cicalese can let me know if they see issues.

So @darenwelsh FYI the 32.x-ssh-service-name branch is gone and is part of 32.x now.

jamesmontalvo3 avatar May 27 '19 22:05 jamesmontalvo3

Any ideas on what's causing the MariaDB failure?

darenwelsh avatar May 28 '19 13:05 darenwelsh

m_install_netdata: False in config in order to skip installing netdata

darenwelsh avatar May 31 '19 01:05 darenwelsh

Try this for MariaDB

darenwelsh avatar May 31 '19 01:05 darenwelsh

Are you saying doing this part solves the problem?

sudo mysql (No need to specify root user when doing sudo in Meza)

use mysql;
update user set plugin='' where User='root';
flush privileges;
\q

jamesmontalvo3 avatar May 31 '19 04:05 jamesmontalvo3

m_install_netdata: False in config in order to skip installing netdata

Yes. Does that do what you want?

jamesmontalvo3 avatar May 31 '19 04:05 jamesmontalvo3

I have not tried either of these yet.

darenwelsh avatar May 31 '19 15:05 darenwelsh

Stephane (from Kiwix) checked into this and mentioned that Wikifundi uses SQLite. Does anyone know whether that would be compatible as an alternative db for meza in order to run on a pi?

darenwelsh avatar Jun 04 '19 15:06 darenwelsh

It seems to me to be outside the scope of Meza to support SQLite but if someone did the work to add it and would maintain it I have no issue.

jamesmontalvo3 avatar Jun 04 '19 16:06 jamesmontalvo3

Someone on reddit suggested that headless Ubuntu would work on a pi. I'll have to give this a try.

darenwelsh avatar Sep 06 '19 18:09 darenwelsh

ref add a clock to a pi (I think this is necessary for something, but can't remember what)

darenwelsh avatar Feb 07 '20 04:02 darenwelsh