exceedone / exment

Exment is open source software for managing information assets on the Web. / Exmentは、情報資産をWeb上で管理するための、オープンソースソフトウェアです。
https://exment.net/docs/#
GNU General Public License v3.0
269 stars 67 forks source link

「更新手順 v6.0.0」に記載不足??があります #1440

Open a0z0 opened 7 months ago

a0z0 commented 7 months ago

Describe the bug / バグの説明

v5.0.11 から「更新手順 v6.0.0」に従いUpdateを進めていましたが、途中でエラーになりました。

エラーが出たのは次の2点でそれぞれ以下の対応を行いました。この対応であってますでしょうか?

  1. composer update
  2. ブラウザでアクセス

対応

  1. composer.json から fruitcake/laravel-cors の行を削除して update
  2. app/Http/Kernel.php 修正

    protected $middleware = [
        // \App\Http\Middleware\TrustHosts::class,
        \App\Http\Middleware\TrustProxies::class,
    -       \Fruitcake\Cors\HandleCors::class,
    +       \Illuminate\Http\Middleware\HandleCors::class,
        \App\Http\Middleware\PreventRequestsDuringMaintenance::class,

    composer updateのログ1

    Composer could not detect the root package (laravel/laravel) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version php-http/discovery contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins Do you trust "php-http/discovery" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y kylekatarnls/update-helper contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins Do you trust "kylekatarnls/update-helper" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.

    Problem 1

    • illuminate/contracts[v5.6.0, ..., 5.8.x-dev] require php ^7.1.3 -> your php version (8.2.18) does not satisfy that requirement.
    • illuminate/contracts[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.2.18) does not satisfy that requirement.
    • illuminate/contracts[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.2.18) does not satisfy that requirement.
    • illuminate/contracts[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.2.18) does not satisfy that requirement.
    • Root composer.json requires exceedone/exment ^6.0.0 -> satisfiable by exceedone/exment[v6.0.0, v6.0.1, v6.0.2].
    • fruitcake/laravel-cors v2.0.2 requires illuminate/contracts ^6|^7|^8 -> satisfiable by illuminate/contracts[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev].
    • fruitcake/laravel-cors[v2.0.0-beta1, ..., v2.0.1] require illuminate/contracts ^5.6|^6.0|^7.0|^8.0 -> satisfiable by illuminate/contracts[v5.6.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev].
    • illuminate/contracts[v6.20.0, ..., 6.x-dev, v7.29.0, ..., 7.x-dev, v8.12.0, ..., 8.x-dev] require psr/simple-cache ^1.0 -> satisfiable by psr/simple-cache[1.0.0, 1.0.1].
    • You can only install one version of a package, so only one of these can be installed: psr/simple-cache[1.0.0, 1.0.1, 2.0.0, 2.x-dev, 3.0.0, 3.0.x-dev].
    • exceedone/exment[v6.0.0, ..., v6.0.2] require psr/simple-cache ^2.0 -> satisfiable by psr/simple-cache[2.0.0, 2.x-dev].
    • fruitcake/laravel-cors[v2.0.3, ..., 2.2.x-dev] require illuminate/contracts ^6|^7|^8|^9 -> satisfiable by illuminate/contracts[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev].
    • Conclusion: don't install illuminate/contracts v9.52.16 (conflict analysis result)
    • Root composer.json requires fruitcake/laravel-cors ^2.0 -> satisfiable by fruitcake/laravel-cors[v2.0.0-beta1, ..., 2.2.x-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

webアクセス時のlaravel.log

[2024-04-11 13:42:59] local.ERROR: Target class [Fruitcake\Cors\HandleCors] does not exist. {"exception":"[object] (Illuminate\Contracts\Container\BindingResolutionException(code: 0): Target class [Fruitcake\Cors\HandleCors] does not exist. at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:914) [stacktrace]

0 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()

1 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(957): Illuminate\Container\Container->resolve()

2 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve()

3 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(942): Illuminate\Container\Container->make()

4 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(172): Illuminate\Foundation\Application->make()

5 /var/www/exment/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

6 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\TrustProxies->handle()

7 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

8 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\Pipeline\Pipeline->then()

9 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()

10 /var/www/exment/public/index.php(51): Illuminate\Foundation\Http\Kernel->handle()

11 {main}

[previous exception] [object] (ReflectionException(code: -1): Class \"Fruitcake\Cors\HandleCors\" does not exist at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:912) [stacktrace]

0 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(912): ReflectionClass->__construct()

1 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()

2 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(957): Illuminate\Container\Container->resolve()

3 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve()

4 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(942): Illuminate\Container\Container->make()

5 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(172): Illuminate\Foundation\Application->make()

6 /var/www/exment/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

7 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\TrustProxies->handle()

8 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

9 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\Pipeline\Pipeline->then()

10 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()

11 /var/www/exment/public/index.php(51): Illuminate\Foundation\Http\Kernel->handle()

12 {main}

"} [2024-04-11 13:42:59] local.ERROR: Target class [Fruitcake\Cors\HandleCors] does not exist. {"exception":"[object] (Illuminate\Contracts\Container\BindingResolutionException(code: 0): Target class [Fruitcake\Cors\HandleCors] does not exist. at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:914) [stacktrace]

0 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()

1 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(957): Illuminate\Container\Container->resolve()

2 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve()

3 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(942): Illuminate\Container\Container->make()

4 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(255): Illuminate\Foundation\Application->make()

5 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(213): Illuminate\Foundation\Http\Kernel->terminateMiddleware()

6 /var/www/exment/public/index.php(55): Illuminate\Foundation\Http\Kernel->terminate()

7 {main}

[previous exception] [object] (ReflectionException(code: -1): Class \"Fruitcake\Cors\HandleCors\" does not exist at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:912) [stacktrace]

0 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(912): ReflectionClass->__construct()

1 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()

2 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(957): Illuminate\Container\Container->resolve()

3 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve()

4 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(942): Illuminate\Container\Container->make()

5 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(255): Illuminate\Foundation\Application->make()

6 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(213): Illuminate\Foundation\Http\Kernel->terminateMiddleware()

7 /var/www/exment/public/index.php(55): Illuminate\Foundation\Http\Kernel->terminate()

8 {main}

"}

Additional context / その他

参考にしたページ https://www.bit-hive.com/articles/20230329