ssh_jail & other errors in keyhelp/www/keyhelp php log  [SOLVED]

Locked
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

ssh_jail & other errors in keyhelp/www/keyhelp php log

Post by lmarcos »

Hi,

I was looking into my server logs because I got an spike in CPU usage today and this is what I found. Btw, I tried to increase memory allocation to php (that is what caused the spike today, too little memory), but since I can't modify it through keyhelp and init.php can't be modified, I'm not sure I can modify php.ini safely at this stage.

Code: Select all

[24-Dec-2020 18:07:18 Europe/Berlin] MySQL - Query Error: Unknown column 'ssh_jail' in 'field list' (1054)
[24-Dec-2020 18:09:04 Europe/Berlin] PHP Notice:  Undefined index: ssh_jail in /home/keyhelp/www/keyhelp/pages/admin_accounts_user.php on line 591
[24-Dec-2020 18:09:04 Europe/Berlin] PHP Notice:  Undefined index: applications in /home/keyhelp/www/keyhelp/pages/admin_accounts_user.php on line 594
[24-Dec-2020 18:11:07 Europe/Berlin] PHP Notice:  Undefined index: ssh_jail in /home/keyhelp/www/keyhelp/functions/functions.main.php on line 633
[24-Dec-2020 18:11:07 Europe/Berlin] PHP Notice:  Undefined index: applications in /home/keyhelp/www/keyhelp/functions/functions.main.php on line 647
[24-Dec-2020 18:11:26 Europe/Berlin] PHP Fatal error:  <br>The encoded file <b>/home/keyhelp/www/keyhelp/core/UI/Template/TwigRenderer.php</b> is corrupt. in Unknown on line 0
[29-Dec-2020 19:21:46 Europe/Berlin] PHP Notice: Undefined index: ssh_jail in /home/keyhelp/www/keyhelp/pages/admin_accounts_user.php on line 1120
[29-Dec-2020 19:21:46 Europe/Berlin] MySQL - Query Error: Unknown column 'ssh_jail' in 'field list' (1054)
[29-Dec-2020 19:24:44 Europe/Berlin] PHP Notice: Undefined index: ssh_jail in /home/keyhelp/www/keyhelp/pages/admin_accounts_user.php on line 591
[29-Dec-2020 19:24:44 Europe/Berlin] PHP Notice: Undefined index: applications in /home/keyhelp/www/keyhelp/pages/admin_accounts_user.php on line 594
[29-Dec-2020 19:25:12 Europe/Berlin] PHP Notice: Undefined index: ssh_jail in /home/keyhelp/www/keyhelp/functions/functions.main.php on line 633
[29-Dec-2020 19:25:12 Europe/Berlin] PHP Notice: Undefined index: applications in /home/keyhelp/www/keyhelp/functions/functions.main.php on line 647
[29-Dec-2020 19:37:18 Europe/Berlin] PHP Notice: Undefined index: ssh_jail in /home/keyhelp/www/keyhelp/pages/user_file_manager.php on line 218
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: ssh_jail & other errors in keyhelp/www/keyhelp php log

Post by Alexander »

Have you reset your KeyHelp database / installation by restoring a backup etc.?

- Your database seams not up to date, these two missing database fields have been introduced long ago (19 May 2020, 18 February 2020)
- Corrupt files are nearly impossible to produce by a KeyHelp update, because multiple checks during update routine would prevent such cases.

=> So my guess, you restored a backup.

One could simply create those fields and replace the file but there is no guaranties that there are more such surprises.

---

To fix your issue:

You may want to compare the default database structure in /home/keyhelp/www/keyhelp/install/templates/keyhelp/keyhelp.sql with an export of your current database and add the fields which are missing.

Replace the corrupt file by the file from the archive:
For Ubuntu 18 / 20, Debian 10: https://install.keyhelp.de/files/releas ... p71.tar.gz
For Ubuntu 16, Debian 9: https://install.keyhelp.de/files/releas ... hp7.tar.gz
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

Re: ssh_jail & other errors in keyhelp/www/keyhelp php log

Post by lmarcos »

Thanks for your hint Alexander.

The keyhelp.sql file in that folder dates from 12/10/2020 and is the same as the one in the tar. The table with the missing field in the dump is the users one. I'll try to add the missing field thorugh the command line since the database won't allow me to log through adminer.

Not sure if you want me to replace keyhelp.sql with the one in the tar or something else or that was only intended in case they were different.

It's worked. I manually added the fields and the default values to the users tables and it's allowed me to change the php.ini value without showing the error. :D :D
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: ssh_jail & other errors in keyhelp/www/keyhelp php log  [SOLVED]

Post by Alexander »

Hey,

hope this helps you to understand what you should do next:

Concerning your database issues:

First, you should be able to log into Adminer / phpMyAdmin via the login credentials in /root/keyhelp_login_data_*
Alternatively with the keyhelp / keyhelp_root database account login credentials which can be found here: /etc/keyhelp/config/config.json
Of course you can use the console, if you like.

Now, you should create an export of your KeyHelp database. The most simple command is probably:

Code: Select all

mysqldump keyhelp > export.sql
But you can of cause use Adminer / phpMyAdmin for that too.

Now compare the database structure of your export.sql for each table, with the one from /home/keyhelp/www/keyhelp/install/templates/keyhelp/keyhelp.sql
You have to create all missing fields in your database.


Concerning your corrupt File issue:

You posted this:

Code: Select all

[24-Dec-2020 18:11:26 Europe/Berlin] PHP Fatal error:  <br>The encoded file <b>/home/keyhelp/www/keyhelp/core/UI/Template/TwigRenderer.php</b> is corrupt. in Unknown on line 0
Replace the corrupt file by the file from the archive:
For Ubuntu 18 / 20, Debian 10: https://install.keyhelp.de/files/releas ... p71.tar.gz
For Ubuntu 16, Debian 9: https://install.keyhelp.de/files/releas ... hp7.tar.gz
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
OlliTheDarkness
Posts: 1854
Joined: Tue 14. Aug 2018, 16:41
Location: Essen (NRW)

Re: ssh_jail & other errors in keyhelp/www/keyhelp php log

Post by OlliTheDarkness »

Alexander wrote: Mon 18. Jan 2021, 13:49 Hey,

hope this helps you to understand what you should do next:

Concerning your database issues:

First, you should be able to log into Adminer / phpMyAdmin via the login credentials in /root/keyhelp_login_data_*
Alternatively with the keyhelp / keyhelp_root database account login credentials which can be found here: /etc/keyhelp/config/config.json
Of course you can use the console, if you like.

Now, you should create an export of your KeyHelp database. The most simple command is probably:

Code: Select all

mysqldump keyhelp > export.sql
But you can of cause use Adminer / phpMyAdmin for that too.

Now compare the database structure of your export.sql for each table, with the one from /home/keyhelp/www/keyhelp/install/templates/keyhelp/keyhelp.sql
You have to create all missing fields in your database.


Concerning your corrupt File issue:

You posted this:

Code: Select all

[24-Dec-2020 18:11:26 Europe/Berlin] PHP Fatal error:  <br>The encoded file <b>/home/keyhelp/www/keyhelp/core/UI/Template/TwigRenderer.php</b> is corrupt. in Unknown on line 0
Replace the corrupt file by the file from the archive:
For Ubuntu 18 / 20, Debian 10: https://install.keyhelp.de/files/releas ... p71.tar.gz
For Ubuntu 16, Debian 9: https://install.keyhelp.de/files/releas ... hp7.tar.gz
Links defekt da die Forensoftware sie ungünstig getrennt hat :!:
Mit freundlichen Grüßen
OlliTheDarkness

**************************************************************
Helden leben lange, Legenden sterben nie

:!: World Hack Organization :!:
**************************************************************
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: ssh_jail & other errors in keyhelp/www/keyhelp php log

Post by Alexander »

OlliTheDarkness wrote: Mon 18. Jan 2021, 14:40 Links defekt da die Forensoftware sie ungünstig getrennt hat :!:
Thank you, fixed ;)!
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Locked