Reset Password Script fails

I realize this is an old thread but I have the exact same problem and I can get as far as julian with the command prompt but I get this

Welcome, Bryan, to the OEM forum.

I’m afraid I can’t help you with this, @TrystanLea - can you help please?

Hello @Coulombz tried this here and it seems to be working. Have you got the latest version of usefulscripts?

Could you try:

cd /opt/emoncms/modules/usefulscripts/
git checkout master
git pull origin master
php resetpassword.php

Thank you for your response. I will let you know that I’m not at all good with code and through much reading and help from the generous people in this community have been able to solve some simple problems, but you have gone over my head with the code you posted. I will give you a description of my problem, the emonpi was working fine for a few years now until i recently changed my wifi router and could no longer connect to it, the lcd on the emonpi indicates that everything is working fine, showing that it was receiving data inputs from the ct’s and temp probes as well as voltage, it would also give me an IP address for wifi but i still could not connect to it. I thought that since I had changed the wifi router that maybe there was an issue with the wifi so I connected the emonpi to my ethernet, It gave me a new IP address for the ethernet connection but I still could not connect. When trying to connect through a browser I get a message can’t connect to database, please verify credentials/configuration in settins.ini . By reading several posts in this community I was able to find someone with a very similar problem and they were able to correct it by running the resetpassword script. this method did not work for me, which is how we got to this point. I do not have the latest version of usefulscripts.
I have tried a few other things connecting through SSH

pi@emonpi:~$ systemctl       in the list that was diplayed these lines were red

isc-dhcp-server.service   failed
mariadb.service      failed



pi@emonpi:~$ journalctl -xe            

rsyslogd[318]: file"7" write error: no space left on devise [v8.1901.0 try https://www,rsyskig,cin/e/2027]
rsyslogd[318]: action "action-2-builtin:omfile" (module "builtin:omafile") message lost, could not be processed. ceck for additional error messages before this one. [v8.1901.0 try https://www.ryslog.com/e/2027 ]

this was repeated several times

do you think my SD card is full or malfuntioning?

I’d guess /var/log/ is full.

Can you copy the output from

df -h

Please use CTL-E to format the bash output correctly when posting.

There are a number of threads on var log full on the forum and how to fix it.

pi@emonpi:~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       4.0G  1.8G  2.0G  48% /
devtmpfs        484M     0  484M   0% /dev
tmpfs           488M     0  488M   0% /dev/shm
tmpfs           488M   56M  433M  12% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           488M     0  488M   0% /sys/fs/cgroup
tmpfs            30M   20K   30M   1% /tmp
tmpfs           1.0M     0  1.0M   0% /var/lib/php/sessions
tmpfs           1.0M     0  1.0M   0% /var/tmp
/dev/mmcblk0p3   10G  1.2G  8.4G  13% /var/opt/emoncms
/dev/mmcblk0p1  253M   52M  201M  21% /boot
log2ram          50M   50M     0 100% /var/log
tmpfs            98M     0   98M   0% /run/user/1000

Sorry @Coulombz those lines I share above are command line commands. Could you login via SSH and enter these one line after the other:

1. Once logged in via SSH, move to the usefulscripts repository:

cd /opt/emoncms/modules/usefulscripts/

2. Change the branch of this directory to master:

git checkout master

3. Download any updates that might be available:

git pull origin master

4. Try running the password reset script again:

php resetpassword.php

Let us know how you get on!

pi@emonpi:~ $ cd /opt/emoncms/modules/usefulscripts/
pi@emonpi:/opt/emoncms/modules/usefulscripts $ git checout master
git: 'checout' is not a git command. See 'git --help'.

The most similar command is
        checkout
pi@emonpi:/opt/emoncms/modules/usefulscripts $ git checkout master
Branch 'master' set up to track remote branch 'master' from 'origin'.
Switched to a new branch 'master'
pi@emonpi:/opt/emoncms/modules/usefulscripts $ git pull origin master
remote: Enumerating objects: 186, done.
remote: Counting objects: 100% (186/186), done.
remote: Compressing objects: 100% (108/108), done.
remote: Total 186 (delta 89), reused 160 (delta 76), pack-reused 0
Receiving objects: 100% (186/186), 37.65 KiB | 1.18 MiB/s, done.
Resolving deltas: 100% (89/89), done.
From https://github.com/emoncms/usefulscripts
 * branch            master     -> FETCH_HEAD
   9700f78..9f54554  master     -> origin/master
Updating 9700f78..9f54554
Fast-forward
 .gitignore                                           |   2 ++
 backup/backup.php                                    |   4 ++--
 backup/lib/metadata.php                              |   6 +++---
 backup/lib/mysql.php                                 |   2 ++
 backup_py/convert_to_csv.py                          |  58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 backup_py/data_downloader.py                         | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 backup_py/readme.md                                  |  30 ++++++++++++++++++++++++++++++
 carbonintensity/carbonintensity.py                   |  69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 carbonintensity/default.carbonintensity.conf         |   5 +++++
 carbonintensity/readme.md                            |  25 +++++++++++++++++++++++++
 convertdata/archive/sql_to_phptimeseries_mv_fast.php | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 mbus/example.config.ini                              |   3 +++
 mbus/load_config.py                                  |  20 ++++++++++++++++++++
 mbus/mbus_app_reset.py                               |   9 +++++++++
 mbus/mbus_check_address.py                           |  24 ++++++++++++++++++++++++
 mbus/mbus_request_data_5b.py                         |  17 +++++++++++++++++
 mbus/mbus_request_data_7b.py                         |  17 +++++++++++++++++
 mbus/mbus_set_address.py                             |  54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 mbus/mbus_set_baud.py                                |  60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 mbus/mbus_set_page.py                                |  12 ++++++++++++
 module.json                                          |   7 +++++++
 octopus/agile.py                                     |  62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 octopus/default.agile.conf                           |  14 ++++++++++++++
 octopus/readme.md                                    |  24 ++++++++++++++++++++++++
 24 files changed, 742 insertions(+), 5 deletions(-)
 create mode 100644 .gitignore
 create mode 100644 backup_py/convert_to_csv.py
 create mode 100644 backup_py/data_downloader.py
 create mode 100644 backup_py/readme.md
 create mode 100644 carbonintensity/carbonintensity.py
 create mode 100644 carbonintensity/default.carbonintensity.conf
 create mode 100644 carbonintensity/readme.md
 create mode 100644 convertdata/archive/sql_to_phptimeseries_mv_fast.php
 create mode 100644 mbus/example.config.ini
 create mode 100644 mbus/load_config.py
 create mode 100644 mbus/mbus_app_reset.py
 create mode 100644 mbus/mbus_check_address.py
 create mode 100644 mbus/mbus_request_data_5b.py
 create mode 100644 mbus/mbus_request_data_7b.py
 create mode 100644 mbus/mbus_set_address.py
 create mode 100644 mbus/mbus_set_baud.py
 create mode 100644 mbus/mbus_set_page.py
 create mode 100644 module.json
 create mode 100644 octopus/agile.py
 create mode 100644 octopus/default.agile.conf
 create mode 100644 octopus/readme.md
pi@emonpi:/opt/emoncms/modules/usefulscripts $ php resetpassword.php
=======================================
EMONCMS PASSWORD RESET
=======================================
Can't connect to database, please verify credentials/configuration in settings.php<br />PHP Notice:  Undefined variable: display_errors in /opt/emoncms/modules/usefulscripts/resetpassword.php on line 21

Notice: Undefined variable: display_errors in /opt/emoncms/modules/usefulscripts/resetpassword.php on line 21
pi@emonpi:/opt/emoncms/modules/usefulscripts $

@TrystanLea - it is looking in the PHP settings file - should it not look in the INI file now?

@Coulombz

We moved (quite a while ago) from using a PHP file for the settings to an ini file. The ini files are setup such that there is a default settings file (all in /var/www/emoncms/) and a settings file that overrides the default settings.

This script appears to be looking in the PHP file (I’ve not got time to actually check). Have a look in the settings.php file and see if the details are the same as the ini file. Changing the PHP file should not make any difference (but keep the original as a bak :slight_smile:).

Im sorry, I do not have the skills to provide the information you are asking for. If you walk me through it I can get it for you.

I don’t think so, process_settings.php handles loading the correct settings file.

It looks like the settings in either /var/www/emoncms/settings.php or /var/www/emoncms/setting.ini are not correct.

Could you check these settings files @Coulombz, have you tried changing any settings in these?