zelon88 / HRConvert2

A self-hosted, drag-and-drop & nosql file conversion server & share tool that supports 445 file formats in 13 languages.
https://github.com/zelon88/HRConvert2
GNU General Public License v3.0
961 stars 60 forks source link

Error: Could not verify logging environment! #76

Open SoCuul opened 1 month ago

SoCuul commented 1 month ago

I'm running the official docker-compose image, with the config.php file mounted as a volume. Whenever I try to access the webserver, it gives me this error.

Warning: file_put_contents(/var/www/html/HRProprietary/HRConvert2/Logs/HRConvert2_0_05_30_24_87e0a673345fb343669a77b84f81713967da1988_fa36f00ce710.txt): Failed to open stream: Permission denied in /var/www/html/HRProprietary/HRConvert2/convertCore.php on line 192
ERROR!!! May 30, 2024, 2:34 am, HRConvert2-9, fa36f00ce710/e1d9bd9464e9: Could not verify logging environment!
SoCuul commented 1 month ago

@zelon88

zelon88 commented 1 month ago

I cannot duplicate this with a Docker repo, but by all appearances this is a permissions issue.

From the docs...

ERROR MESSAGE ERROR!!! , -9, : Could not verify logging environment!

FILE convertCore.php

FATAL YES

LOGGED NO

ERROR DESCRIPTION The path to the Logs directory specified in the --Log Storage Directory-- section of the config.php file does not exist or cannot be accessed. This may be the result of incorrect file permission levels on the directory where Logs are being stored. This may be the result of incorrect user or group associations for the www-data user or group. The www-data:www-data user:group needs to have read & write access to the Logs directory. The device where data is stored has an insufficient amount of storage space available. Because this error takes place before the logging environment is initialized; this error will not be logged.

The interesting part that I think it important for your issue is...

This may be the result of incorrect file permission levels on the directory where Logs are being stored. This may be the result of incorrect user or group associations for the www-data user or group. The www-data:www-data user:group needs to have read & write access to the Logs directory. The device where data is stored has an insufficient amount of storage space available.

Can you elaborate on your Docker setup? I'm a Docker beginner. I'm looking at the following URL's and wondering if they are related...... https://stackoverflow.com/questions/42248198/how-to-mount-a-single-file-in-a-volume https://stackoverflow.com/questions/54657370/mount-single-file-from-volume-using-docker-compose

SoCuul commented 1 month ago

After upgrading to the latest docker image, I got the following error when trying to load the page:

 Fatal error: Uncaught TypeError: array_merge(): Argument #2 must be of type array, null given in /var/www/html/HRProprietary/HRConvert2/convertCore.php:524 Stack trace: #0 /var/www/html/HRProprietary/HRConvert2/convertCore.php(524): array_merge(Array, NULL) #1 /var/www/html/HRProprietary/HRConvert2/convertCore.php(2135): verifyGlobals() #2 {main} thrown in /var/www/html/HRProprietary/HRConvert2/convertCore.php on line 524

My docker-compose.yml is as follows:

services:
  hrconvert2:
    container_name: hrconvert2-server
    image: zelon88/hrconvert2:latest
    entrypoint: 'sh -c apache2-foreground && python3 /usr/bin/unoconv -l'
    restart: unless-stopped
    ports:
      - 7000:80
    volumes:
      - ./config.php:/var/www/html/HRProprietary/HRConvert2/Resources/config.php
SoCuul commented 4 weeks ago

@zelon88 have you been able to reproduce it with this docker compose config?

Cillu commented 3 weeks ago

I don't know if this will be of any help, but I was having the same initial error as you and it turned out to be from mounting the log directory. I just commented it out and it worked. I'm aware that this is not a solution, but a workaround:

    volumes:
      - ./config.php:/var/www/html/HRProprietary/HRConvert2/config.php
        #- ./logs:/var/www/html/HRProprietary/HRConvert2/Logs