This is a documentation of how I modified playbooks
tasks and manually applied changes to finally get ERPNext running on RPi 3. I expect it to work on RPi 2 as well, since I’m using RPi 2’s Ubuntu Server image (there’s no official RPi 3 Server image, only Ubuntu Core 16 is supported).
Please read the whole post first if you want to use my experience as reference.
playbooks
modification:
- add
armhf,arm64
or completely remove arch specification onnode 6.x
repo add
playbooks/roles/nodejs/tasks/main.yml
@@ -1,31 +1,31 @@
apt_repository:
- repo: "deb [arch=amd64,i386] https://deb.nodesource.com/node_6.x {{ ansible_distribution_release }} main"
+ repo: "deb https://deb.nodesource.com/node_6.x {{ ansible_distribution_release }} main"
state: present
register: node_repo
when: ansible_os_family == 'Debian' or ansible_distribution == 'Ubuntu'
Both, adding [arch=amd64,arm64,armhf,i386]
or completely removing arch
argument to let system decide works.
- remove
bench
argument frombench init
andbench get-app
commands
playbooks/roles/bench/tasks/main.yml
@@ -35,7 +35,7 @@
when: not bench_stat.stat.exists and not production
- name: python2 bench init for production
- command: bench init {{ bench_path }} --frappe-branch {{ branch }}
+ command: bench init {{ bench_path }}
args:
creates: "{{ bench_path }}"
when: not bench_stat.stat.exists and production
playbooks/roles/bench/tasks/setup_erpnext.yml
@@ -4,7 +4,7 @@
register: app
- name: Get the ERPNext app
- command: bench get-app erpnext https://github.com/frappe/erpnext --branch {{ branch }}
+ command: bench get-app erpnext https://github.com/frappe/erpnext
args:
creates: "{{ bench_path }}/apps/erpnext"
chdir: "{{ bench_path }}"
I’ve absolutely no idea why, but running those commands will always fail and exit with errors. I might have the error output somewhere on this forum of GitHub issues; I don’t have extra SD card, RPi or time to rerun just to record the errors again.
- if you forked and modified your own
bench
repo to apply these modifications, you need to pointinstall.py
to use it
playbooks/install.py
@@ -207,7 +207,7 @@ def clone_bench_repo(args):
clone_path = tmp_bench_repo
branch = args.bench_branch or 'master'
- repo_url = args.repo_url or 'https://github.com/frappe/bench'
+ repo_url = args.repo_url or 'https://github.com/oxwivi/bench'
success = run_os_command(
But these aren’t enough for bench
and erpnext
to get going.
MariaDB fuckery
The official MariaDB repo added by the easy install script doesn’t have either armhf
or arm64
repositories, so MariaDB 10.0 gets installed from official Ubuntu repo. The script installing it and trying to restart it fails, so it’s better to mauinally install it before running install.py
:
sudo apt install mariadb-server
I’ve no idea if the script’s MariaDB configuration gets applied or not, but there are two issues that needs solving:
- cannot access
mysql
withoutsudo
:
TASK [mariadb : Set root Password] *********************************************
failed: [localhost] (item=localhost) => {"changed": false, "item": "localhost", "msg": "unable to connect to database, check login_user and login_password are correct or /home/ubuntu/.my.cnf has the credentials. Exception message: (1********45, \"Access denied for user 'root'@'localhost' (using password: NO)\")"}
...ignoring
$ mysql -u root -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
$ sudo mysql -u root # I had to use "sudo" since is new installation
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 35
Server version: 10.0.34-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
This is caused by Ubuntu’s MariaDB packages shipped with unix_socket
authentication by default, according to this Stack Overflow answer. Probably MariaDB’s official packages don’t do that and running install.py
on arch supported by MariaDB repo don’t face it.
To solve this, I had to empty the plugin
column on mysql.user
table:
$ sudo mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 35
Server version: 10.0.34-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> UPDATE mysql.user SET plugin = '' WHERE plugin = 'unix_socket';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> exit;
Bye
This allowed me to access mysql
without sudo
:
$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.0.34-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> Ctrl-C -- exit!
Aborted
However, this wasn’t the end of it.
- solve
new-site site1.local failed because MariaDB is not properly configured to use the Barracuda storage engine.
$ bench new-site site1.local --admin-password 0 --mariadb-root-password 0
================================================================================
Creation of your site - site1.local failed because MariaDB is not properly
configured to use the Barracuda storage engine.
Please add the settings below to MariaDB's my.cnf, restart MariaDB then
run `bench new-site site1.local` again.
[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
================================================================================
To solve this, I tried , a solution from this forum itself, but it didn’t work.
This time, I copied the default /etc/mysql/conf.d/settings.cnf
to /etc/mysql/mariadb.conf.d/
, and it worked with a couple of warnings:
$ sudo cp /etc/mysql/conf.d/settings.cnf /etc/mysql/mariadb.conf.d/
$ sudo systemctl restart mysql
frappe@ubuntu:~/frappe-bench$ bench new-site site1.local --admin-password 0 --mariadb-root-password 0
Warning: skipping '!includedir /etc/mysql/mariadb.conf.d/' directive as maximum includerecursion level was reached in file /etc/mysql/mariadb.conf.d/settings.cnf at line 64
Warning: skipping '!includedir /etc/mysql/mariadb.conf.d/' directive as maximum includerecursion level was reached in file /etc/mysql/mariadb.conf.d/settings.cnf at line 64
Installing frappe...
Updating DocTypes for frappe : [========================================]
Updating country info : [========================================]
*** Scheduler is disabled ***
Conclusion
Please note, on the same Ubuntu 16.04 amd64
arch, everything worked with zero modification.
The node 6.x
case is obvious enough, but I don’t know why specifying branch
would fuck everything up during installation on armhf
arch.
Lastly, I’ve no idea if all three of the MariaDB changes I applied is necessary to get it to work. Perhaps only the last one is enough, and it can be further refined when the exact issue of why those configuration are not applied can be found.