Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Weird case user 1 got corrupted somehow

Hello,

I have a weird case off a emoncs running on ubuntu where for some reason the account got corrupted and I can’t get it back ok. This is on a friends Nuc I can only access remotely

when in “my account” all fields are blank

when I go in admin/users I get this

and this is the entry in MySQL

I haven’t the slightest idea how to solve this. Not sure where things broke nor why

Appreciate any help. thanks

Something similar was reported (and solved) fairly recently, but I simply cannot find the the thread.

From what I remember, it involves setting a flag to allow the local emonCMS to become multi-user, create a second user, then copy part of the (valid and working) database of the new user over the bad data for the original.

tried different things but we see this error now

Array to string conversion in /var/www/emoncms/Modules/user/user_model.php on line 164

need to go read what that line wants, it just blocks everything :thinking:

seems this is related to a cookie ??? :roll_eyes:

Hello @bidouilleur sorry about this error, this relates to the use of php functions only available in php version 7.3 or later. If you can update to php 7.4 that will fix the issue. I need to add a more gracious message to say that the requirements have changed and also document the php upgrade steps here.

1 Like

ok, I understand better, the system is on PHP5. I took the device home and will re install from scratch with latest PHP and re import the data. At least a clean nice system again.

Thanks for the clarification.

Ok great!, here are my notes for updating php7.2 to php7.4 and all emoncms related requirements in the event that it is useful:


sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php7.4 
sudo apt install php7.4-curl php7.4-mbstring php7.4-xml php7.4-igbinary php7.4-dev php7.4-mysql

sudo pecl -d php_suffix=7.4 install redis
printf "extension=redis.so" | sudo tee /etc/php/7.4/mods-available/redis.ini 1>&2
sudo phpenmod redis

sudo a2dismod php7.2
sudo a2enmod php7.4
sudo service apache2 restart
1 Like

I’ve put this in an issue on the emoncms github repository here as well Upgrading PHP version to 7.4 · Issue #1726 · emoncms/emoncms · GitHub

Last question regarding this, since I’m going to upgrade all, is PHP8 already supported/stable ??? While spending time on this might as well jump 7 :slight_smile: thanks

Not sure, good question! I’ve only personally tested on 7.4

will try to setup a test case on a server this week end and see if it works ok.

1 Like

Great thanks! We’re not generally using the leading edge of what php offers, but there were some important security related improvements that require 7.3 or above discussed here.

1 Like

For as much I could test/read mosquitto-php is NOT yet php8 ready. In my case on a clean ubuntu 20LTS VM with PHP8 that part fails during install . All the rest seemed ok though the lines flash by quickly

PHP Warning:  PHP Startup: Unable to load dynamic library 'mosquitto.so' (tried: /usr/lib/php/20200930/mosquitto.so (/usr/lib/php/20200930/mosquitto.so: cannot open shared object file: No such file or directory), /usr/lib/php/20200930/mosquitto.so.so (/usr/lib/php/20200930/mosquitto.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.0.10 (cli) (built: Aug 26 2021 15:50:07) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.10, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.10, Copyright (c), by Zend Technologies

not going to copy over the +/- hundred error lines from mosquitto install part …

guess I delete the VM and test with latest PHP7 branch :slight_smile: