snipe / snipe-it

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

Upgrade from v4.7.4 to v5.1.3 results in blank screen. #9442

Closed perezalvarezhi closed 3 years ago

perezalvarezhi commented 3 years ago

Short Description:

I followed the Moving instructions by installing a new instance of Snipeit via Git in a subfolder (old was www/snipe/public and new is www/snit/public). I did this because the old install was not a Git install but an install created automatically with Softaculous on CPanel.

Im getting a blank screen and cant do the migrate command.

Thank you all in advance for your help!

Expected Behavior (or desired behavior if a feature request)

After doing all the instructions for moving, I should run the migrate command php artisan migrate. I would expect some message shows confirming the migration was successful or maybe the migration was not successful.


Actual Behavior

I run php artisan migrate and don't get any response it just executes and returns to the prompt like if nothing happened.

When going to www/[newInstall]/public/ (5.1.3) it stays in a blank page, even when I activate debug mode(no trace of the debug menu). Old install still works(4.7.4)

Note: It might be wrong to do this but I'm not creating a new database, I'm just setting the .env file to point to the old database used in the old instance.


Please confirm you have done the following before posting your bug report:


Provide answers to these questions:

  • This is an upgrade / migration since it is a complete new installation using GIT
  • from v4.7.4 to v5.1.3

GEThttps://txamericancitrus.com/snit/public/ [HTTP/2 500 Internal Server Error 69ms]

GET https://txamericancitrus.com/snit/public/ Status500 Internal Server Error VersionHTTP/2 Transferred323 B (0 B size)

HTTP/2 500 Internal Server Error

x-powered-by: PHP/7.3.27

content-type: text/html; charset=UTF-8

content-length: 0

date: Thu, 15 Apr 2021 19:49:52 GMT

server: LiteSpeed

strict-transport-security: max-age=63072000; includeSubDomains

x-frame-options: SAMEORIGIN

x-content-type-options: nosniff

X-Firefox-Spdy: h2

Accept
    text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding
    gzip, deflate, br
Accept-Language
    en-US,en;q=0.5
Cache-Control
    max-age=0
Connection
    keep-alive
Cookie
    XSRF-TOKEN=eyJpdiI6IkpcL1wvRG1zc2d1a1dsYjJreG1JOFM0QT09IiwidmFsdWUiOiJBNU9laitvQjlzWjE2UW1RcWZWVlhucStnMVV0T0tVaFJwaXZmKzZHWkdSRXViZENqXC9BOXdYUDk4T2ZhWWVDT0M3c0ljTUMxZDd1R3RcL2tQWGdYZlBnPT0iLCJtYWMiOiJmOGIyZjZkYzQ4NzJhMjgzNjhhMTg1YzFhNjU3N2JlYTNhMjVhYTM3Y2RmOTJiYTc1MDFmYTZhNTExN2U0NTk4In0%3D; snipeit_session=HPMZ1Oy6WySGBTxRZZAfnXKvc7uOgat7t9NtIgiP; laravel_token=eyJpdiI6IlJ5ek84T0M5MjhZOWhsSkNsWFNzc1E9PSIsInZhbHVlIjoicUU5UkIwSFBLakJkamE0SkYxd21MekpyKzlWSHNMbDJKWmlVZXlmNk9mUUF1aTVQeWtJMXQxZ09DVStvYWRpMVFEcGhkS1QwMnVUNUdEdW82aGYrSFBoc2x4cnlYbVNrWENIWnVuSjFNcWpFMWFsRDVnTTNFU2lxS2JzS3RKSlwvV3FcL1R1bCtnKzdIelI4SHJpNlwveWQ0VXNnY3N4SXVsVTFmcGN4d1FQQU01YnhiSEl1a1QxK01cL1RQb3pEXC9wREZaaHFjZTl1RDB0TktOeWE0Zk9oZm9tTldYU0xFVTRETVlsbDVDVVlCNndqb1RIQnA5NEVuNnhWRnhCZ29pS1dQTUIxZVU3aDRzcEJUMUxFU3Z2czhvdz09IiwibWFjIjoiYTk1OGFlZGE4MDVlNzdiZTIxZTZmNzYzZmYxZWE5ZDA3MzI5NGVkMzE1Yzc2NDI1NzZkZTZjYzg0N2E0MDUxOCJ9
Host
    txamericancitrus.com
TE
    Trailers
Upgrade-Insecure-Requests
    1
User-Agent
    Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0

Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.

https://snipe-it.readme.io/docs/getting-help

snipe commented 3 years ago

Huh... So, it’s hard to tell from this whether this is a web server error, a php error, or an application level error.

You’re right to not have created a new DB. Can you look at your Litespeed logs? And your PHP error logs? I can’t see any reason why Snipe-IT wouldn’t work with LiteSpeed. If you run upgrade.php, what do you see as output? (It tries hard to look for missing libraries, etc.)

We unfortunately don’t have a lot of insight as to what Softaculous does, but assuming they’re respecting our AGPL license, they’re not charging anything actual code on the fly. What’s more likely is an odd environmental difference, it just may take us a bit to figure out which bit is borked.

perezalvarezhi commented 3 years ago

Note (i was writing right before the other answer by snipe): I noticed Issue # #9330 has a similar problem and also the Permission Section on Upgrading Issues talk about permission incorrectly set. I tried to follow this unfortunatelly I cant create users since the command useradd -g apache snipeit didnt work on my server it might be because im using a Shared hosting.

I did chown -R [my current linux user] storage public/uploads and chmod -R 755 storage chmod -R 755 public/uploads but I dont think this works. I still get the blank screen.

perezalvarezhi commented 3 years ago

Hello wow thank you for the super fast response and directly from the snipe-it creator :D. Here is what I got:

Can you look at your Litespeed logs?

I could not access the log files at /etc/apache2/logs because I didn't have permissions (im in a shared hosting) but there is a module in cPanel that shows the web server error logs, here is what it shows:


thrown in /home/txameric/public_html/snit/bootstrap/app.php on line 14

0 /home/txameric/public_html/snit/public/index.php(36): require_once()

2021-04-15 14:39:58.796582 [NOTICE] [16772] [187.213.65.107:59412:HTTP2-15#APVH_txamericancitrus.com:443] [STDERR] PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in /home/txameric/public_html/snit/bootstrap/app.php:14


And your PHP error logs? Note: I get the same error on my browser screen instead of the blank screen. I Didn't have them on log_errors=OFF but after turning that and "display_errors=ON" I got this when doing php artisan migrate:

PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in /home/txameric/public_html/snit/bootstrap/app.php:14 Stack trace:

0 /home/txameric/public_html/snit/artisan(18): require_once()

1 {main}

thrown in /home/txameric/public_html/snit/bootstrap/app.php on line 14

Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in /home/txameric/public_html/snit/bootstrap/app.php:14 Stack trace:

0 /home/txameric/public_html/snit/artisan(18): require_once()

1 {main}

thrown in /home/txameric/public_html/snit/bootstrap/app.php on line 14

If you run upgrade.php, what do you see as output? (It tries hard to look for missing libraries, etc.)

I tried php upgrade.php and it got stuck in the middle of it and it wont advance, it took too long(about 45 min) and when I pressed Ctrl+C it got me DC from the server here is the code:

txameric@az1-ls3 [~/www/snit]# php upgrade.php

WELCOME TO THE SNIPE-IT UPGRADER!

This script will attempt to:


STEP 1: Checking PHP requirements:

Current PHP version: (7.3.27) is at least 7.2.5 - continuing... FYI: The php.ini used by this PHP is: /opt/alt/php73/etc/php.ini

Checking Required PHP extensions...

√ bcmath is installed! √ curl is installed! √ fileinfo is installed! √ gd is installed! √ json is installed! √ ldap is installed! √ mbstring is installed! √ mysqli is installed! √ openssl is installed! √ PDO is installed! √ tokenizer is installed! √ xml is installed! √ zip is installed!


STEP 2: Backing up database:

--


STEP 3: Putting application into maintenance mode:

--

STEP 4: Pulling latest from Git (master branch):

Git is installed. Already on 'master' hint: Pulling without specifying how to reconcile divergent branches is hint: discouraged. You can squelch this message by running one of the following hint: commands sometime before your next pull: hint: hint: git config pull.rebase false # merge (the default strategy) hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation. -- Saved working directory and index state WIP on master: e8adf8d44 One more category fix -- M .htaccess M public/uploads/.gitignore M public/uploads/barcodes/invalid_barcode.gif M storage/private_uploads/signatures/.gitkeep Your branch is up to date with 'origin/master'. -- Already up to date.


Step 5: Cleaning up old cached files:

√ No bootstrap/cache/compiled.php, so nothing to delete. √ No bootsrap/cache/services.php, so nothing to delete. √ No bootstrap/cache/config.php, so nothing to delete.



Step 6: Updating composer dependencies: (This may take a moment.)

-- We couldn't find a local composer.phar. No worries, trying globally.

Class Illuminate\Foundation\ComposerScripts is not autoloadable, can not call post-autoload-dump script Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run composer update or composer update <package name>. Package operations: 133 installs, 0 updates, 0 removals


We unfortunately don’t have a lot of insight as to what Softaculous does, but assuming they’re respecting our AGPL license, they’re not charging anything actual code on the fly. What’s more likely is an odd environmental difference, it just may take us a bit to figure out which bit is borked.

Yeah years ago I didn't know much about Linux (still don't) and that was the easiest way for me to get this great program. Unfortunately in Softaculous they don't keep up with updates or when they do it is hard to update for example this time they have the newest version of snipe-it but migration was a nightmare :(. I finally want to get into the side of the light haha.

perezalvarezhi commented 3 years ago

Hello, after looking for more info on the error:

Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found

I found here in stackoverflow that this is a problem with corrupt Laravel environments, so they asked me to do: -composer update --no-scripts

After running this and repeating the migration commands and clear php artisan migrate and php artisan config:clear the system works completly fine.

I considre this problem solved.

@snipe thank you very much for your help, I was a little lost on where to find more info about the problem and your post got me in the right track.