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

500 Internal Server Error when Upgrading to 7 #14878

Closed
2 tasks done
bstamand opened this issue Jun 17, 2024 · 14 comments
Closed
2 tasks done

500 Internal Server Error when Upgrading to 7 #14878

bstamand opened this issue Jun 17, 2024 · 14 comments
Labels

Comments

@bstamand
Copy link

Debug mode

Describe the bug

After upgrading to v7 from 6.4.2, the main page gets a 500 internal server error.

Reproduction steps

1.Perform upgrade
2.
3.
...

Expected behavior

Snipe-IT version 7 functions normally.

Screenshots

No response

Snipe-IT Version

Current 6.4.2

Operating System

Windows

Web Server

Apache

PHP Version

8.1

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

Copy link

welcome bot commented Jun 17, 2024

👋 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.

@uberbrady
Copy link
Collaborator

You should see some useful stuff in storage/logs/laravel.log - please show us the bottom of that file please. It might give you some pointers on what went wrong.

@krosseyed
Copy link

krosseyed commented Jun 17, 2024

I just fixed the 500 server error by following this guide:

https://stackoverflow.com/a/60635087

However, I am now getting a panda saying "The service is temporarily unavailable for system updates. Please check back later."

Edit: I have figured out the issue. I forgot to do php artisan up. After that, this was fixed.

Reference: #7242

Stack Overflow
I got some weird error code after I pulled a project out of my github. My first things I do is composer dumpautoload, composer update, and php artisan migrate:fresh --seed whenver I get to a new te...

@snipe
Copy link
Owner

snipe commented Jun 17, 2024

Glad you got it sorted :)

@snipe snipe closed this as completed Jun 17, 2024
@krosseyed
Copy link

@snipe I am not sure if this should be closed, as my fix may or may not be the one that works for @bstamand. Hopefully they come back and confirm that my fix worked for them.

@bstamand
Copy link
Author

Hey all. Unfortunately that fix did not work. I get a blank page when trying to open snipe. I'll get the contents of that log file here shortly.

@snipe snipe reopened this Jun 17, 2024
@snipe
Copy link
Owner

snipe commented Jun 17, 2024

@bstamand Unfortunately, without the logs we asked for in the issue template, it makes it really difficult for us to debug anything for you.

@bstamand
Copy link
Author

@bstamand Unfortunately, without the logs we asked for in the issue template, it makes it really difficult for us to debug anything for you.

Hello. Thank you, just haven't had a chance to get the log. Here is the last section:

[previous exception] [object] (ReflectionException(code: -1): Class "Illuminate\Http\Middleware\HandleCors" does not exist at /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/Contain>
[stacktrace]
#0 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/Container.php(877): ReflectionClass->__construct()
#1 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->build()
#2 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(851): Illuminate\Container\Container->resolve()
#3 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\Foundation\Application->resolve()
#4 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(836): Illuminate\Container\Container->make()
#5 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(206): Illuminate\Foundation\Application->make()
#6 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(180): Illuminate\Foundation\Http\Kernel->terminateMiddleware()
#7 /var/www/snipe-it/public/index.php(55): Illuminate\Foundation\Http\Kernel->terminate()
#8 {main}
"}

@krosseyed
Copy link

krosseyed commented Jun 17, 2024

@bstamand, What happens when you run composer dump-autoload while under /var/www/snipe-it?

Also, follow the guide below to fix common issues, as your error is exactly what I got earlier.

https://snipe-it.readme.io/docs/common-issues

Snipe-IT Documentation
🚧Problem Installing/Upgrading?We've moved the the most common installation/upgrade issues to their own page. If you're having an issue installing or upgrading Snipe-IT, please check the Installation/Upgrading Issues page before opening a ticket on Github. Quick Tip: Handy Commands 👍Many issues can...

@prboyer
Copy link

prboyer commented Jun 17, 2024

@snipe seeing this behavior on cbb5b6e (v7.0.2 tag) with the Docker image as well.

Anything different between the Git install and the dockerized image? v6.4.2 from Docker Hub works in my env, but upgrading to v7.0.2 image is a breaking change.

@snipe
Copy link
Owner

snipe commented Jun 18, 2024

@bstamand Generally when we see that, it's because composer install was not run or could not be completed because of PHP requirements.

@bstamand
Copy link
Author

@bstamand Generally when we see that, it's because composer install was not run or could not be completed because of PHP requirements.

Thank you. Here are my php modules installed. Is there anything missing?

php.x86_64
php-bcmath.x86_64
php-cli.x86_64
php-common.x86_64
php-fpm.x86_64
php-gd.x86_64
php-intl.x86_64
php-ldap.x86_64
php-mbstring.x86_64
php-mysqlnd.x86_64
php-opcache.x86_64
php-pdo.x86_64
php-pecl-mcrypt.x86_64
php-pecl-mysql.x86_64
php-pecl-zip.x86_64
php-process.x86_64
php-sodium.x86_64
php-xml.x86_64

@toann-g
Copy link

toann-g commented Jun 18, 2024

First of all, thanks @snipe and your team for an excellent product. Much appreciated.

Got the same error as @bstamand today.

My system: xampp php 8.1.7, windows, current ver 6.2.3 - upgrade to 7.0.3, apache

What I did to fix was

backup (done) --> php upgrade.php (all good) --> restart apache and mysql --> open the site and got the 500 error msg
--> composer update
--> composer install --no-dev --prefer-source
--> composer dump-autoload
--> php artisan migrate
--> php artisan config:clear
--> php artisan config:cache
--> php artisan up (big thanks to @krosseyed on this)

Hope this helps!

@snipe snipe added the docker label Jun 19, 2024
@bstamand
Copy link
Author

First of all, thanks @snipe and your team for an excellent product. Much appreciated.

Got the same error as @bstamand today.

My system: xampp php 8.1.7, windows, current ver 6.2.3 - upgrade to 7.0.3, apache

What I did to fix was

backup (done) --> php upgrade.php (all good) --> restart apache and mysql --> open the site and got the 500 error msg --> composer update --> composer install --no-dev --prefer-source --> composer dump-autoload --> php artisan migrate --> php artisan config:clear --> php artisan config:cache --> php artisan up (big thanks to @krosseyed on this)

Hope this helps!

@toann-g genius! that fixed it thank you!

@snipe snipe closed this as completed Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants