The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
users/admin.php ERROR 500 // SOLVED
#1
Suddenly users/admin.php page is not reachable. I get ERROR 500.

Everytime I try to access /users/admin.php I get mail in /var/mail/

Code:
From jakob@server.oblak.ersim.si Tue Nov 13 18:03:01 2018
Return-path: <jakob@server.oblak.ersim.si>
Envelope-to: jakob@server.oblak.ersim.si
Delivery-date: Tue, 13 Nov 2018 18:03:01 +0100
Received: from jakob by server with local (Exim 4.84_2)
        (envelope-from <jakob@server.oblak.ersim.si>)
        id 1gMc5d-0000W9-Gp
        for jakob@server.oblak.ersim.si; Tue, 13 Nov 2018 18:03:01 +0100
From: root@server.oblak.ersim.si (Cron Daemon)
To: jakob@server.oblak.ersim.si
Subject: Cron <jakob@server> oblak.ersim.si/admin.php
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/jakob>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=jakob>
Message-Id: <E1gMc5d-0000W9-Gp@server>
Date: Tue, 13 Nov 2018 18:03:01 +0100

/bin/sh: 1: oblak.ersim.si/admin.php: not found


Last line of this mail I do not understand. I know that oblak.ersim.si/admin.php cannot be found because it does not exist. But why the server wants to load oblak.ersim.si/admin.php instead of oblak.ersim.si/users/admin.php?

Userspice is running on debian with apache2. I get no PHP errors in apache2/error.logwhen accessing users/admin.php. Other pages are working correctly like users/admin_pages.php or users/admin_users.php.

I did not change any file in users/ folder. I already tried to replace users folder with backup image.

Is this some redirection mistake or where should I look to solve this problem.

EDIT 1: I deleted admin.php from server and got Not found (which is expected). Now I make a copy of admin_users.php and rename it to admin.php. Browser now shows users/admin.php so I believe there must be some error in the admin.php file or sth?

EDIT2: Looks like that I had error.logs from apache disabled. I dont know why. So now I got some errors. 
Code:
PHP Notice:  Undefined property: stdClass::$is_read in /var/www/html/users/classes/Notification.php on line 40
PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 32 bytes) in /var/www/html/users/classes/DB.php on line 76
now I tried to resolve these issues. First error is userspice bug. Since I have no rights to change users/classes/Notification.php file (or any file in users folder) I cannot resolve this issue. But issue nr.2 (Fatal error) is real problem. If you look closely you can see that there is memory limit set to 1024MB in admin.php page (line21). This limit was reached when line 76 from DB.php was called. This is:
Code:
$this->_results = $this->_query->fetchALL(PDO::FETCH_OBJ);

So I went reserching my DB. I have found that I had similar number of lines written to audit table (somewhere in the neighbourhood of 1050x10E6). So I tried to delete some lines (about 1k) with no success. Then I truncated whole table and boom. It works like it should. users/admin.php is again reachable.

I believe this is a bug in userspice. I believe that audit inserts should be automaticaly deleted when there is more then, lets say, 100k lines. Also bug from Notification.php should be addressed.

EDIT:3 oh and by the way, error with Notification.php is not present just on admin.php page but on all pages.
  Reply
#2
The notification error would be an issue with your database, more than likely being outdated. What Version of UserSpice are you running? What updates are applied in the migrations/updates table? And as a whole, UserSpice will never implement a function to automatically truncate or remove data from any table, especially the logs table. If you wish to do this, please do it on your own.
  Reply
#3
(11-14-2018, 05:48 PM)Brandin Wrote: The notification error would be an issue with your database, more than likely being outdated. What Version of UserSpice are you running? What updates are applied in the migrations/updates table? And as a whole, UserSpice will never implement a function to automatically truncate or remove data from any table, especially the logs table. If you wish to do this, please do it on your own.

In this case, admin could be warned that DB is reaching memory limit set by the userspice.

I'm using latest userspice with all updates. I also did not change database except my own tables.

[Image: updates-migration.png]

Regards,
Jakob
  Reply
#4
Does your notifications table have an is_read column?
  Reply
#5
Amm I dont have notification table.
  Reply
#6
That would be your problem...
  Reply
#7
Shoud I manualy create one? What columns do I need?
  Reply
#8
I would download a fresh copy of UserSpice, install it, and export the Notifications table from there, or review the .SQL file within the install directory and steal the notifications table creation script from there.
  Reply
#9
Ok Brandin, thank you!
  Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)