Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade via GIT results in Server Error #16334

Closed
swift2512 opened this issue Feb 25, 2025 · 11 comments
Closed

Upgrade via GIT results in Server Error #16334

swift2512 opened this issue Feb 25, 2025 · 11 comments

Comments

@swift2512
Copy link

Upgrade from v7.1.16 (build from last week.)

  1. Git pull
  2. php upgrade.php

STEP 4: Backing up database:

--
BadMethodCallException

Method Illuminate\Routing\Route::breadcrumbs does not exist.

at vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:112
108▕ */
109▕ public function __call($method, $parameters)
110▕ {
111▕ if (! static::hasMacro($method)) {
➜ 112▕ throw new BadMethodCallException(sprintf(
113▕ 'Method %s::%s does not exist.', static::class, $method
114▕ ));
115▕ }
116▕

1 routes/web/hardware.php:32
Illuminate\Routing\Route::__call()
+3 vendor frames

5 routes/web/hardware.php:22
Illuminate\Support\Facades\Facade::__callStatic()

Something went wrong with your backup. Aborting!

Same with php artisan config:clear
BadMethodCallException

Method Illuminate\Routing\Route::breadcrumbs does not exist.

at vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:112
108▕ */
109▕ public function __call($method, $parameters)
110▕ {
111▕ if (! static::hasMacro($method)) {
➜ 112▕ throw new BadMethodCallException(sprintf(
113▕ 'Method %s::%s does not exist.', static::class, $method
114▕ ));
115▕ }
116▕

1 routes/web/hardware.php:32
Illuminate\Routing\Route::__call()
+3 vendor frames

5 routes/web/hardware.php:22
Illuminate\Support\Facades\Facade::__callStatic()

@uberbrady
Copy link
Collaborator

Yup, we're working on fixing that - in the meantime, if you run composer install or php composer.phar install, then re-retry, it should work.

@uberbrady
Copy link
Collaborator

If you run upgrade.php without the git pull first, it should go cleanly. I just double-checked the script and it seems like it does do stuff in the right order.

@swift2512
Copy link
Author

swift2512 commented Feb 25, 2025

If you run upgrade.php without the git pull first, it should go cleanly. I just double-checked the script and it seems like it does do stuff in the right order.

From the user manual:

In Snipe-IT v4.1.3 and higher, you can try the one-step upgrade by running:

git pull
php upgrade.php

https://snipe-it.readme.io/docs/upgrading

Snipe-IT Documentation
🚧 If you run into any issues upgrading...: Please check the Common Issues > Installation/Upgrading Issues section which provides solutions for commonly encountered installation / upgrading problems. Always backup your database and .env file before upgrading. We try very hard to make sure that al...

@snipe
Copy link
Owner

snipe commented Feb 25, 2025

Doing the git pull first was to make sure you have the updated version of the upgrade.php. I think the problem is running the backup before the composer install, since the backup is done via a package, and will pull from the autoloader.

@snipe
Copy link
Owner

snipe commented Feb 25, 2025

@swift2512 I've just changed the order of things in the upgrade script - can you give it a try now (after a git pull so you have the latest version of the upgrader)?

@swift2512
Copy link
Author

swift2512 commented Feb 26, 2025

@snipe upgrade went OK this time, not resulting in Server error, but I got errors on step 5. Here's the log of upgrade script. I clicked through various parts of Snipe-IT install, everything seems to work normally after this upgrade. (Even breadcrumbs) Upgraded from v7.1.15 to v8.0.1.

--------------------------------------------------------
STEP 5: Cleaning up old cached files:
--------------------------------------------------------

√ No bootstrap/cache/compiled.php, so nothing to delete.
√ Deleting bootstrap/cache/services.php. It is no longer used.
√ No bootstrap/cache/config.php, so nothing to delete.
√ No vendor/symfony/translation/TranslatorInterface.php, so nothing to delete.

√ BadMethodCallException

  Method Illuminate\Routing\Route::breadcrumbs does not exist.

  at vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:112
    108▕      */
    109▕     public function __call($method, $parameters)
    110▕     {
    111▕         if (! static::hasMacro($method)) {
  ➜ 112▕             throw new BadMethodCallException(sprintf(
    113▕                 'Method %s::%s does not exist.', static::class, $method
    114▕             ));
    115▕         }
    116▕

  1   routes/web/hardware.php:32
      Illuminate\Routing\Route::__call()
      +3 vendor frames

  5   routes/web/hardware.php:22
      Illuminate\Support\Facades\Facade::__callStatic()
√ BadMethodCallException

  Method Illuminate\Routing\Route::breadcrumbs does not exist.

  at vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:112
    108▕      */
    109▕     public function __call($method, $parameters)
    110▕     {
    111▕         if (! static::hasMacro($method)) {
  ➜ 112▕             throw new BadMethodCallException(sprintf(
    113▕                 'Method %s::%s does not exist.', static::class, $method
    114▕             ));
    115▕         }
    116▕

  1   routes/web/hardware.php:32
      Illuminate\Routing\Route::__call()
      +3 vendor frames

  5   routes/web/hardware.php:22
      Illuminate\Support\Facades\Facade::__callStatic()
√ BadMethodCallException

  Method Illuminate\Routing\Route::breadcrumbs does not exist.

  at vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:112
    108▕      */
    109▕     public function __call($method, $parameters)
    110▕     {
    111▕         if (! static::hasMacro($method)) {
  ➜ 112▕             throw new BadMethodCallException(sprintf(
    113▕                 'Method %s::%s does not exist.', static::class, $method
    114▕             ));
    115▕         }
    116▕

  1   routes/web/hardware.php:32
      Illuminate\Routing\Route::__call()
      +3 vendor frames

  5   routes/web/hardware.php:22
      Illuminate\Support\Facades\Facade::__callStatic()
√ BadMethodCallException

  Method Illuminate\Routing\Route::breadcrumbs does not exist.

  at vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:112
    108▕      */
    109▕     public function __call($method, $parameters)
    110▕     {
    111▕         if (! static::hasMacro($method)) {
  ➜ 112▕             throw new BadMethodCallException(sprintf(
    113▕                 'Method %s::%s does not exist.', static::class, $method
    114▕             ));
    115▕         }
    116▕

  1   routes/web/hardware.php:32
      Illuminate\Routing\Route::__call()
      +3 vendor frames

  5   routes/web/hardware.php:22
      Illuminate\Support\Facades\Facade::__callStatic()

@snipe
Copy link
Owner

snipe commented Feb 26, 2025

Thank you - this is super helpful. What I think we're seeing here is a problem with the order of operations. :(

The script is calling php artisan config:clear before composer has installed the new libraries, so it's farting out there. If you re-run the upgrade script, do you still see the same error? (I'd expect you wouldn't, since you have the new dependencies at that point.)

@swift2512
Copy link
Author

@snipe upgrade script went flawlessly, no errors shown in any of steps.

@snipe
Copy link
Owner

snipe commented Feb 26, 2025

Excellent, thank you for letting me know. I think I've rearranged the order of things now so you shouldn't run into this again. (I haven't pushed the changes to the upgrade script to develop/master yet, but I think it should work.)

@cpietras-PVA
Copy link

odd, updated to php version 8.4.5. Then running in repository "composer install" then "sudo php upgrade.php" update it said it went through all good but server still has 500 error.
attached is showing snipe updating successfully and Laravel.log:
Image
Image
Image

Not sure where else to look at issue, any assistance would be great!

@cpietras-PVA
Copy link

so doing same commands in snipe repository, "composer install" then "sudo php upgrade.php" got my server back up and running. really odd, but I suppose going from version 7 to 8 is the reason for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants