Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

White page - Error 500 #157

Open
rlambert27 opened this issue Jul 14, 2017 · 31 comments
Open

White page - Error 500 #157

rlambert27 opened this issue Jul 14, 2017 · 31 comments
Labels

Comments

@rlambert27
Copy link

Hello,

I installed Muximux quite easily yesterday, all of a sudden though I started getting a white page and a 500 error. Although all my sub-domains work. I checked the nginx error log and found

2017/07/13 22:50:47 [error] 7599#7599: *15 FastCGI sent in stderr: "PHP message: PHP Warning:  syntax error, unexpected '=' in settings.ini.php on line 3
 in /var/www/muximux/vendor/pear-pear.php.net/Config_Lite/Config/Lite.php on line 134
PHP message: PHP Fatal error:  Uncaught Config_Lite_Exception_Runtime: failure, can not parse the file: settings.ini.php in /var/www/muximux/vendor/pear-pear.php.net/Config_Lite/Config/Lite.php:136
Stack trace:
#0 /var/www/muximux/vendor/pear-pear.php.net/Config_Lite/Config/Lite.php(894): Config_Lite->read('settings.ini.ph...', 0)
#1 /var/www/muximux/muximux.php(63): Config_Lite->__construct('settings.ini.ph...')
#2 /var/www/muximux/muximux.php(29): write_ini()
#3 /var/www/muximux/index.php(3): require('/var/www/muximu...')
#4 {main}
  thrown in /var/www/muximux/vendor/pear-pear.php.net/Config_Lite/Config/Lite.php on line 136" while reading response header from upstream, client: 184.91.134.60, server: rlplex.ca, request: "POST$

Any ideas? I tried:

  1. Erasing the complete Muximux install
  2. Cloning again
  3. It works fine, right up until I edit the settings and save. Then when I reload, boom, white page with 500 error again.
@rlambert27
Copy link
Author

In case it helps, my reverse nginx file contains:

server {
    listen 80;
    server_name rlplex.ca 192.168.86.75;
    root /var/www/muximux;
    index index.php;

    location / {
      try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
      try_files $uri =404;
      include fastcgi_params;
      fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

@mescon
Copy link
Owner

mescon commented Jul 14, 2017

What version of PHP are you running and what addons are there? (php gd, zlib and so on).

@rlambert27
Copy link
Author

rlambert27 commented Jul 14, 2017

I followed this guide :
NGINX first : https://www.htpcguides.com/configure-plex-media-server-reverse-proxy-nginx-linux/
Muximux after : https://thisisforsomething.com/guide/guide-to-plex-media-server-on-ubuntu-server-16-04/

Other than that I have not installed anything else out of the box unless it was in PlexMediaServer, Deluge, CouchPotato, PlexRequests.Net, SickRage or PlexPY.

What's weird is that it worked fine for a full day, then suddenly it stopped. I didn't do any updates.

@mescon
Copy link
Owner

mescon commented Jul 14, 2017

Hm...
syntax error, unexpected '=' in your error makes me think that maybe there is some = in there that isn't being parsed the way it should be. Open up settings.ini.php and have a look at it and see if it's in there somewhere. Maybe the password encryption function is messing something up, so try an easy password such as test instead. You can just delete the username/password parts of settings.ini.php and it will be reset.

@rlambert27
Copy link
Author

Hmmmm, my settings.ini.php file contained:

; <?php die('Access denied'); ?>
[QPAMxojMMGR6Gp_0C_Suif6hhPu3TNyGU4Kd0DD1NOqy6cx3PE9EC6ShxyQiaGHYyRRZoyu_ygQhBu$
 = "="

Obviously that is not correct. I deleted all the files and re-installed and now seems to work fine. Not sure that I did anything different from last time but it's working now.

I'll update in a day or two once i've confirmed that it's working for more than 24 hours since it worked fine last time for 24 hours and then it stopped working.

@rlambert27
Copy link
Author

Happened again! I didn't change anything and suddenly stopped working, i'll check out the logs tonight and see what happened to my settings.ini.php file.

@rlambert27
Copy link
Author

Same things in my settings.ini.php file:

; <?php die('Access denied'); ?>
[RaBXkImeZQ4kr6S9kdO8Vpdi8EN1DKdxvJY1bIVLDsGUmSJoLKWMDgGU4bv4rcJtLOWXxh_Ula8ltI$
 = ""

I checked owner and it's

-rw-r--r-- 1 www-data www-data 406 Jul 19 11:49 settings.ini.php

I wonder how i could audit the file to be see who is changing it!!!

@rlambert27
Copy link
Author

rlambert27 commented Jul 20, 2017

I thought i'd be smart and do a chattr +i on the file but now Muximux won't load. Any thoughts?

@kube1984
Copy link

I just started to get this same error out of no were for some reason.

Im using the docker version with unraid
https://hub.docker.com/r/linuxserver/muximux/

@RafaelSchridi
Copy link

RafaelSchridi commented Aug 11, 2017

I've been having the exact same problem every few weeks, First issue I found about it.
I'm setting my setting.ini.php to mod 400 to see if it helps.

EDIT: Muximux does not like that. Set it to 600.

@savage93
Copy link

I also experience the very same issue on Debian Jessie 8.9 x64 with Apache 2.4.10 and PHP 5.6.30.
I've made a backup of my settings.php.ini file, so that I don't have to reconfigure everything when this happens, I recommend others to do this as well.

@rlambert27
Copy link
Author

I had to switch away, it was happening too frequently for me to have to overwrite my settings file each time. Maybe if the root issue is found i'll come back :-(

@savage93
Copy link

I've got some interesting news regarding this issue. It appears to me that this problem happens because of someone using an unknown exploit on the login page, because every time I replace the settings with the backed up version, it works for half a minute or so, and after that this issue happens, and I always see the same IP accessing my site logged in my apache2 logs in this period. I also tried to block this IP, and after that the issue magically stopped. Currently I'm trying to figure out what the POST content could be that causes the problem to happen, using mod_security, but the content logged looks gibberish to me: log

@savage93
Copy link

savage93 commented Aug 13, 2017

I think I've found the "exploit" too: the POST parameters aren't verified on the server-side correctly, e.g. I could achieve a similar result by simply modifying the input fields' names to something else like "sha" and then input some random text, click on submit, and the settings file got rewritten again: image.

@d8ahazard
Copy link
Collaborator

@savage93 - Well, this isn't cool at all. Maybe it's time I get off my a$$ and take a look at improving things a bit with some of the tricks I've learned since I've been working on other things.

Updates should be forthcoming...

@mescon
Copy link
Owner

mescon commented Aug 14, 2017

Good to see you again @d8ahazard :-)

savage93 pushed a commit to savage93/Muximux that referenced this issue Aug 14, 2017
@d8ahazard
Copy link
Collaborator

@savage93 - Why don't you check out the commit I've pushed to the develop branch. This should properly wrap all post data with a secret, so that random data can't just be blasted at the server.

This is a temporary fix, note that I'll be doing away with the necessity for the "save" button entirely in the final update I'm cooking - once you change a value in the UI, it will automagically get saved to config. :D

@savage93
Copy link

@d8ahazard - Your solution definitely won't let random malicious POST requests messing up the settings, however, while highly unlikely, someone who knows the source of Muximux could still could cause trouble by sending the correct requests needed (see issue #158, the secret.txt can be read by anyone without any authentication!). I think my quick and dirty modification would be somewhat safer by using the SESSION variable created by the login script, since that can't just be set from the client-side.

The settings code change you mentioned should definitely fix all these issues - while also making the UX a lot better - so I'm really looking forward to it. :)

@d8ahazard
Copy link
Collaborator

d8ahazard commented Aug 18, 2017 via email

@savage93
Copy link

Oh, my bad then, I've missed that comment. :)

@d8ahazard
Copy link
Collaborator

Fixed in the developer branch, will close when rewrite code is merged. Labeling for my own reference.

@FuckThisAlias
Copy link

ive been having this issue for a while and i just seen this thread i posted orginaly here #162 i have just reinstalled muximux is the issue fixed now or am i going to have to reinstall everyday

@RafaelSchridi
Copy link

You can wait for the changes to be pushed to master or use the dev branch for a bit.

@FuckThisAlias
Copy link

Are there any other issues i should be aware of in the dev branch

@RafaelSchridi
Copy link

Not that I know of

@mescon
Copy link
Owner

mescon commented Sep 13, 2017

@d8ahazard is working on fixing a bunch of these bugs as well as re-writing heaps of the codebase... the experimental branch is where he's working, and currently I am not able to use that one. This will be fixed sooner or later, as soon as @d8ahazard has had some time for himself :-)

@d8ahazard
Copy link
Collaborator

d8ahazard commented Sep 15, 2017 via email

@RyanEwen
Copy link

Still appears to still be an issue. I had a fresh install using docker go bad after a day or so

@Suertzz
Copy link

Suertzz commented Jun 21, 2019

I still have the same issue here, got a 500 every 3-4day

@mstormo
Copy link

mstormo commented Mar 22, 2020

This is still happening. Got the following in my settings.ini.php today

; <?php die('Access denied'); ?>
[<methodCall>_<methodName>system_listMethods</methodName>_<params></params>_</methodCall>]
 = ""

@mstormo
Copy link

mstormo commented Mar 22, 2020

I see now. No one is actually working on Muximux anymore, so it's never fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants