andreaskou / PHPBB_IUM

PhpBB Inactive User Management/Reminder
GNU General Public License v2.0
4 stars 7 forks source link

HTTP 500 Error when selecting the list of inactives #24

Open bipolarmorgan opened 2 years ago

bipolarmorgan commented 2 years ago

Please advise, when clicking on the list, it gives a server error 500. Not sure where to look or why this is happening. Couldn't find an error_log.....

andreaskou commented 2 years ago

Have you tried reinstalling the ext again?

bipolarmorgan commented 2 years ago

Yes, I have tried removing and reinstalling. Note I'm attempting this with version 1.1.10-RC (in case that applies somehow)

Should I try downgrading? I'm on phpBB version 3.3.5

andreaskou commented 2 years ago

I have not tried the ext on phpbb 3.3.5 So I can't really know if it's compatible. Could you try using the ext from here? https://www.phpbb.com/customise/db/extension/phpbb_inactive_user_manager_reminder/ It should have minor to none differences. But you never know!

bipolarmorgan commented 2 years ago

Ok, also FYI - it does appear to work on 3.3.5 (i have 3 forums using it). However, only on this one board, which leads me to think a corrupt install or conflict with another extension, but i haven't found the cause yet. Thanks for any help or thoughts regarding the issue.

bipolarmorgan commented 2 years ago

I'm curious the SQL statement could be culprit if it's hanging on it, right?

andreaskou commented 2 years ago

Is this happening on both lists? Or only on one of them? Does it take time to give you the error or is it immediately after pressing on the link?

bipolarmorgan commented 2 years ago

It takes time, trying to process, then errors. It only happens on the one list, the other two links in the config load fine. Also the standard inactive list loads as well. Super curious, not super stressed, but love the extension!

andreaskou commented 2 years ago

OK, in that case I might have a solution though not 100%... Does the forum has many groups (beside the default ones)?

bipolarmorgan commented 2 years ago

not many no, it has a lot of users and a lot of forums though....

andreaskou commented 2 years ago

Well by meny I mean more than 2 custom groups. :/ The ext has an issue with custom groups. But it also depend on the host it seems.

bipolarmorgan commented 2 years ago

Ahh yes, i see we have 3 custom groups.... does that mean its because of the SQL query? can you pull that list without factoring groups?

EDIT: I removed 1 custom group (it only had 1 person anyway) and still get the 500 error. FYI.

andreaskou commented 2 years ago

Well it is and it is not... The query need to know who has admin and mods permissions in order to exclude those users. To do this I use a phpbb function. This function for some reason is making the whole query slow down dramatically. For some reason this is taxing when there are more than the default groups in phpbb. I've done some changes (not implemented yet) and it has cut of the delay a lot. But there is still some delay. So I am not satisfied with it. I don't want delay at all.

Let me see and I'll update you asap.

andreaskou commented 2 years ago

Alright now I'm confused... So the story goes like this...

I had to have a fresh copy of my forum locally, it's where I do my tests and updates to see if everything goes smoothly. So I deleted my old db and files locally and downloaded a fresh copy from the live server.

Locally but also on the server I face(d) almost the same problem with you. It took way to long time to load the lists and some times it would time outs to error 500.

Now, with the fresh copy on my local server everything is lightning fast. But on the live server it's still slow. It's driving me crazy. Of course I use the stable version of the ext and not the modified with the "fix".

But I guess this makes me conclude, that it's a database issue. Perhaps I need to dump and reupload the db to the live server as well. :/

bipolarmorgan commented 2 years ago

unfortunately, no difference, maybe if I remove my custom groups?

andreaskou commented 2 years ago

Well in that case I don't know. You could try. But Im not sure any more if this will work... Because in my case I did not change anything but deleting the "old" dB and reuploading it. How did you do the dump and load of the db?

andreaskou commented 2 years ago

@bipolarmorgan Hello, could you please show me what is in file classes/ignore_user.php between line 150 to 170? I think I've found a solution.

bipolarmorgan commented 2 years ago
*/
    public function ignore_groups()
    {
        // Get administrator user_ids
        $administrators = $this->auth->acl_get_list(false, 'a_', false);
        $admin_ary = (!empty($administrators[0]['a_'])) ? $administrators[0]['a_'] : array();

        // Get moderator user_ids
        $moderators = $this->auth->acl_get_list(false, 'm_', false);
        $mod_ary = (!empty($moderators[0]['m_'])) ? $moderators[0]['m_'] : array();

        // Merge them together
        $admin_mod_array = array_unique(array_merge($admin_ary, $mod_ary));

        // Ignored group_ids
        $ignore = $this->config_text->get('andreask_ium_ignored_groups', '');
        $ignore = json_decode($ignore);
        if (!empty($ignore))
        {
            $sql_ary = array(
                'SELECT'    =>  'user_id',
bipolarmorgan commented 2 years ago

does that help?

andreaskou commented 2 years ago

@bipolarmorgan Hi,

I know it was a long time ago, but I've have done some major changes. If you would like to test the the develop branch. You would really help. https://github.com/andreaskou/PHPBB_IUM/tree/develop

Let me know! Many thanks!