tiredofit / docker-freescout

Dockerized web based help desk and shared inbox
MIT License
230 stars 94 forks source link

After Update: "rm: can't remove '/www/html/Modules': Resource busy" error #162

Open LoggaRythmus opened 10 months ago

LoggaRythmus commented 10 months ago

Summary

I am using Freescout for a week now and i had to update my environment for an update of a module, it needed the latest freescout version so i updated the docker image to the latest. After that the Website was accessible but not working correctly.

Steps to reproduce

I updated my docker image from 1.17.44 to 1.17.48 after that the website is not accessible "Whoops, looks like something went wrong — check logs in /storage/logs"

What is the expected correct behavior?

Website accessible and working environment.

Relevant logs and/or screenshots

2023-12-18.09:42:41 [NOTICE] ** [timezone] Timezone: Setting to 'Europe/Berlin' from 'Etc/GMT'
2023-12-18.10:42:41 [NOTICE] ** [monitoring] Container configured for monitoring with 'zabbix modern'
2023-12-18.10:42:42 [NOTICE] ** [scheduling] Container configured for scheduled tasks with 'cron'
2023-12-18.10:42:42 [NOTICE] ** [messaging] Container configured to route mail via SMTP to 'postfix-relay'
2023-12-18.10:42:44 [NOTICE] ** [php-fpm] Creating sample index.php
2023-12-18.10:42:46 [WARN] ** [freescout] Potential New Installation / Standalone Installation Detected - Copying Freescout Sourcecode
2023-12-18.10:42:46 [WARN] ** [freescout] Detected /data directory. Persistently saving settings/sessions/cache/uploads/modules
rm: can't remove '/www/html/Modules': Resource busy
2023-12-18.10:42:47 [INFO] ** [freescout] Auto Configuring based on Environment Variables
2023-12-18.10:42:47 [WARN] ** [freescout] Installing Modules into container
laravel.log
[2023-12-18 10:37:24] production.ERROR: Class "Modules\Checklists\Providers\ChecklistsServiceProvider" not found {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class \"Modules\\Checklists\\Providers\\ChecklistsServiceProvider\" not found at /www/html/overrides/laravel/framework/src/Illuminate/Founda>[stacktrace]
#0 /www/html/overrides/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(189): Illuminate\\Foundation\\ProviderRepository->createProvider('Modules\\\\Checkli...')
#1 /www/html/overrides/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(70): Illuminate\\Foundation\\ProviderRepository->compileManifest(Array)
#2 /www/html/vendor/nwidart/laravel-modules/src/Laravel/Module.php(27): Illuminate\\Foundation\\ProviderRepository->load(Array)
#3 /www/html/overrides/nwidart/laravel-modules/src/Module.php(279): Nwidart\\Modules\\Laravel\\Module->registerProviders()
#4 /www/html/overrides/nwidart/laravel-modules/src/Repository.php(366): Nwidart\\Modules\\Module->register()
#5 /www/html/vendor/nwidart/laravel-modules/src/Providers/BootstrapServiceProvider.php(22): Nwidart\\Modules\\Repository->register()
#6 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(586): Nwidart\\Modules\\Providers\\BootstrapServiceProvider->register()
#7 /www/html/vendor/nwidart/laravel-modules/src/ModulesServiceProvider.php(38): Illuminate\\Foundation\\Application->register(Object(Nwidart\\Modules\\Providers\\BootstrapServiceProvider))
#8 /www/html/vendor/nwidart/laravel-modules/src/LaravelModulesServiceProvider.php(15): Nwidart\\Modules\\ModulesServiceProvider->registerModules()
#9 [internal function]: Nwidart\\Modules\\LaravelModulesServiceProvider->boot()
#10 /www/html/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(28): call_user_func_array(Array, Array)
#11 /www/html/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#12 /www/html/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(27): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#13 /www/html/overrides/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#14 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(792): Illuminate\\Container\\Container->call(Array)
#15 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\\Foundation\\Application->bootProvider(Object(Nwidart\\Modules\\LaravelModulesServiceProvider))
#16 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}(Object(Nwidart\\Modules\\LaravelModulesServiceProvider), 23)
#17 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(774): array_walk(Array, Object(Closure))
#18 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot()
#19 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(213): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap(Object(Illuminate\\Foundation\\Application))
#20 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(296): Illuminate\\Foundation\\Application->bootstrapWith(Array)
#21 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(119): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#22 /www/html/artisan(60): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#23 {main}
"}

Environment

version: '2' services: freescout-app: image: tiredofit/freescout container_name: freescout-app ports: - 8282:80 links: - freescout-db volumes: ### If you want to perform customizations to the source and have access to it, then uncomment this line - This includes modules #- ./data:/www/html ### Or, if you just want to use Stock Freescout and hold onto persistent files like cache and session use this, one or the other. - ./data:/data ### If you want to just keep the original source and add additional modules uncomment this line - ./modules:/www/html/Modules - ./logs/:/www/logs environment: - CONTAINER_NAME=freescout-app - DB_HOST=freescout-db - DB_NAME= - DB_USER= - DB_PASS= - APP_NEW_FETCHING_LIBRARY=true - SITE_URL= - ADMIN_EMAIL= - ADMIN_PASS= - ENABLE_SSL_PROXY=FALSE - DISPLAY_ERRORS=FALSE - TIMEZONE=Europe/Berlin restart: always freescout-db: image: tiredofit/mariadb container_name: freescout-db volumes: - ./db:/var/lib/mysql environment: - ROOT_PASS= - DB_NAME= - DB_USER= - DB_PASS= - CONTAINER_NAME=freescout-db restart: always freescout-db-backup: container_name: freescout-db-backup image: tiredofit/db-backup links: - freescout-db volumes: - ./dbbackup:/backup environment: - CONTAINER_NAME=freescout-db-backup - DB_HOST=freescout-db - DB_TYPE=mariadb - DB_NAME= - DB_USER= - DB_PASS= - DB01_BACKUP_INTERVAL=1440 - DB01_BACKUP_BEGIN=0000 - DB_CLEANUP_TIME=8640 - COMPRESSION=BZ - MD5=TRUE restart: always

Possible fixes

tiredofit commented 10 months ago

Looks like you are exporting too many volumes. Try exporting only /data and /www/logs..

LoggaRythmus commented 10 months ago

The error in the first log disappeared but i still cant access the site

`[2023-12-19 11:18:44] production.ERROR: Class "Modules\Checklists\Providers\ChecklistsServiceProvider" not found {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Class \"Modules\Checklists\Providers\ChecklistsServiceProvider\" not found at /www/html/overrides/laravel/framework/src/Illuminate/Founda>[stacktrace]

0 /www/html/overrides/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(189): Illuminate\Foundation\ProviderRepository->createProvider('Modules\\Checkli...')

1 /www/html/overrides/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(70): Illuminate\Foundation\ProviderRepository->compileManifest(Array)

2 /www/html/vendor/nwidart/laravel-modules/src/Laravel/Module.php(27): Illuminate\Foundation\ProviderRepository->load(Array)

3 /www/html/overrides/nwidart/laravel-modules/src/Module.php(279): Nwidart\Modules\Laravel\Module->registerProviders()

4 /www/html/overrides/nwidart/laravel-modules/src/Repository.php(366): Nwidart\Modules\Module->register()

5 /www/html/vendor/nwidart/laravel-modules/src/Providers/BootstrapServiceProvider.php(22): Nwidart\Modules\Repository->register()

6 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(586): Nwidart\Modules\Providers\BootstrapServiceProvider->register()

7 /www/html/vendor/nwidart/laravel-modules/src/ModulesServiceProvider.php(38): Illuminate\Foundation\Application->register(Object(Nwidart\Modules\Providers\BootstrapServiceProvider))

8 /www/html/vendor/nwidart/laravel-modules/src/LaravelModulesServiceProvider.php(15): Nwidart\Modules\ModulesServiceProvider->registerModules()

9 [internal function]: Nwidart\Modules\LaravelModulesServiceProvider->boot()

10 /www/html/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(28): call_user_func_array(Array, Array)

11 /www/html/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

12 /www/html/overrides/laravel/framework/src/Illuminate/Container/BoundMethod.php(27): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))

13 /www/html/overrides/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)

14 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(792): Illuminate\Container\Container->call(Array)

15 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\Foundation\Application->bootProvider(Object(Nwidart\Modules\LaravelModulesServiceProvider))

16 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(Nwidart\Modules\LaravelModulesServiceProvider), 23)

17 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(774): array_walk(Array, Object(Closure))

18 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot()

19 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(213): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))

20 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(162): Illuminate\Foundation\Application->bootstrapWith(Array)

21 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(146): Illuminate\Foundation\Http\Kernel->bootstrap()

22 /www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))

23 /www/html/public/index.php(82): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))

24 {main}

"}`

After Clearing the Cache i had an error:

In ProviderRepository.php line 279:

Class "Modules\Checklists\Providers\ChecklistsServiceProvider" not found

jozefrebjak commented 9 months ago

@LoggaRythmus I have the same issue, have you found a solution ?

akaibukai commented 7 months ago

Hi there.. I just faced the same issue after I tried to update the docker compose stack ( running docker compose pull and then up).. Yet the previous version was 2 weeks old, so I don't think too much change occurred causing incompatibility. Until now I was running using the following volumes:

    volumes:
    ### If you want to perform customizations to the source and have access to it, then uncomment this line - This includes modules
    # - ./data:/www/html
    ### Or, if you just want to use Stock Freescout and hold onto persistent files like cache and session use this, one or the other.
    - /root/freescout/data:/data
    ### If you want to just keep the original source and add additional modules uncomment this line
    - /root/freescout/modules:/www/html/Modules
    - /root/freescout/logs/:/www/logs

Everything was working fine even between updates (just made a couple). But today I was getting 504 and freescout is not even starting. When looking at the logs it's about missing a module.

If I remove the volumes and only keeps the logs, I'm able to boot freescout again but I lost all my settings.

I still have my data around on the host, how can I fix it?

Update: Somehow the above was working but since I read the problem might be because of having too many volumes, I just commented the modules and just kept the following:

    volumes:
    - /root/freescout/data:/data
    - /root/freescout/logs/:/www/logs

Now I don't see the error message anymore.. But I'm still getting 504 error and I have no logs at all.. Don't know where to look..

Edit: After stopping/recreating the stack a bunch of times, it worked.. Really I don't know what I messed up but finally I was able to recover the state of my app. My current config is the one above (with only 2 volumes)