snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.88k stars 3.14k forks source link

[Docker] Update from `6.2.3` to `6.3.1` #14303

Open enricobenedos opened 7 months ago

enricobenedos commented 7 months ago

Debug mode

Describe the bug

We are simply updating our snipe-it instance from 6.2.3 to 6.3.1 using docker image but after the update the app doesn't work anymore due to a 500 Internal Server error page.

This is the container log:

sudo docker logs -f -n 400 snipe-it

Module ssl disabled.
To activate the new configuration, you need to run:
  service apache2 restart
Changing upload limit to 100

   Illuminate\Database\QueryException

  SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = snipeit and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
    708▕         // If an exception occurs when attempting to run a query, we'll format the error
    709▕         // message to include the bindings with SQL, which will make this exception a
    710▕         // lot more helpful to the developer instead of just the database's errors.
    711▕         catch (Exception $e) {
  ➜ 712▕             throw new QueryException(
    713▕                 $query, $this->prepareBindings($bindings), $e
    714▕             );
    715▕         }
    716▕     }

      +36 vendor frames
  37  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()
Configuration cache cleared!
Configuration cache cleared!
Configuration cached successfully!
2024-02-20 15:14:03,055 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2024-02-20 15:14:03,056 INFO supervisord started with pid 1
2024-02-20 15:14:04,059 INFO spawned: 'exit_on_any_fatal' with pid 43
2024-02-20 15:14:04,061 INFO spawned: 'apache' with pid 44
2024-02-20 15:14:04,063 INFO spawned: 'run_schedule' with pid 45
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.24.0.3. Set the 'ServerName' directive globally to suppress this message
No scheduled commands are ready to run.
2024-02-20 15:14:05,255 INFO success: exit_on_any_fatal entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-02-20 15:14:05,255 INFO success: apache entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-02-20 15:14:05,255 INFO success: run_schedule entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
[2024-02-20T16:15:04+01:00] Running scheduled command: '/usr/bin/php8.1' 'artisan' auth:clear-resets > '/dev/null' 2>&1
No scheduled commands are ready to run.

At frontend level this is the error:

UnexpectedValueException
The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: UnexpectedValueException

It seems a permissions problem with a log file, but why? I know that simply changing permissions the problem should be solved but what have been changed between two docker images? Our internal apps are managed by an automatic docker pipeline CI/CD process and this issues force us to perform time consuming manual operations without any type of documentation.

Reproduction steps

  1. Simply move from Docker image 6.2.3 to 6.3.1

Expected behavior

We expect that the update works with no more issues except for migrations cases.

Screenshots

No response

Snipe-IT Version

6.3.1

Operating System

linux/amd64

Web Server

Apache

PHP Version

8.1.2

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

welcome[bot] commented 7 months ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

feuertim-tech commented 6 months ago

Hello the following files have root as owner:

if you change the owner in docker it works again I hope this helps

snipe commented 5 months ago

@uberbrady is currently reworking a lot of the docker setup

rajivvishwa commented 4 months ago

I'm facing the same issue. Currently downgraded to v6.2.3 to get it to work. I'm unclear what owner info as to be changed for the files listed by @feuertim-tech . It is not root currently for me, should it be root?