log file permissions error locks me out of gui so I can't fix error

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
itsme
Posts: 8
Joined: Tue Feb 02, 2021 8:46 pm

log file permissions error locks me out of gui so I can't fix error

Post by itsme »

Greetings,

VERSION DETAILS:
zoneminder 1.34.23-buster1 on devuan beowulf

PROBLEM I'M HAVING:
I was trying different things in options > logging (I believe it was logging or logs, I'm locked out of my web gui now because of this error, so it makes it difficult to check exact names), anyway, I tried setting the debug log name from that page and as soon as I put a name in there (xdebug.log) and the page refreshed, I get taken to a page that is blank except for this error message.

ERROR MESSAGE:
"Warning: error_log(xdebug.log): failed to open stream: Permission denied in /usr/share/zoneminder/www/includes/logger.php on line 397

Fatal error: Can't write to log file 'xdebug.log': error_log(xdebug.log): failed to open stream: Permission denied @ /usr/share/zoneminder/www/includes/logger.php/397 in /usr/share/zoneminder/www/includes/logger.php on line 400"

BUG?
This seems to be a bug to me since it blocks you from doing anything in the website such as fixing the errored entry. I can create a bug report if wanted.

HELP?
Is there a config file somewhere where I can remove that xdebug.log entry that I entered in options > logging? Or is there any other way to revert that setting or all settings to default?

HERE'S WHAT I'VE TRIED SO FAR:

EDIT: First thing I tried was going to any other page in the gui. Every url including the landing page shows the same page with the error message and otherwise is blank.

I double-checked in /etc/zm/conf.d/01-system-paths.conf to make sure that ZM_PATH_LOGS=/var/log/zm and that is correct.

Permissions error seems pretty straightforward I thought, so, inside of /var/log/zm I created a file called xdebug.log, and I created xdebug.log.log in case zoneminder tries to append .log to what I entered into the options field. I also changed the owner:group to www-data:www-data, and set permissions to rw-rw-rw or 666 on both files. I did this to see if I could just get around the error but even though those files are there in /var/log/zm, I still get the same error and am locked out of the web gui.
I also copied those same files to just /var/log in case zoneminder was trying to work in there, and I did so also in / just in case zoneminder was trying to create them there, since I didn't put a path before xdebug.log. All that did nothing, I still get the same error.
I even went was far as creating those log files inside /usr/bin in case the executable was trying to create the logs inside it's own directory but made no difference.

Thanks for any assistance. I'm hoping to avoid having to reinstall and reconfigure everything.
itsme
Posts: 8
Joined: Tue Feb 02, 2021 8:46 pm

Re: log file permissions error locks me out of gui so I can't fix error

Post by itsme »

Update, I poked around in the database and found the relevant entry there. I'm going to try to change it there, I think I can do it. If so, that's a good workaround. Will update again with the update query if it's successful.
itsme
Posts: 8
Joined: Tue Feb 02, 2021 8:46 pm

Re: log file permissions error locks me out of gui so I can't fix error

Post by itsme »

New Update:

I now have a workaround that works. I found the entry in the zm database where I set the log file name (it's in the Config table under the Name ZM_LOG_DEBUG_FILE).

To set that field back to blank, which is the default, log into mariadb, use zm database, and run this query:

update Config set Value='' where Name='ZM_LOG_DEBUG_FILE';

This issue is fixed for me but as I mentioned in my initial report, it seems like a bug that if you put an entry in Options > Logging > LOG_DEBUG_FILE field, if there are permissions issues, it just loops in an error screen and never allows you to fix that field.
User avatar
iconnor
Posts: 2881
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: log file permissions error locks me out of gui so I can't fix error

Post by iconnor »

Thanks for reporting it.

I'll put a fix in 1.34.24
itsme
Posts: 8
Joined: Tue Feb 02, 2021 8:46 pm

Re: log file permissions error locks me out of gui so I can't fix error

Post by itsme »

No problem :)
drhiii
Posts: 10
Joined: Sat Sep 07, 2019 11:04 pm

Re: log file permissions error locks me out of gui so I can't fix error

Post by drhiii »

I got smacked by this same thing. Will try the fix....
Post Reply