snipe / snipe-it

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

Snipe-IT blank screen after installation. #11402

Closed ZarxAarox closed 2 years ago

ZarxAarox commented 2 years ago

Debug mode

Describe the bug

I should be landing on the pre-flight checks page, however, instead I just get a blank white screen. No errors. Debugger doesn't bring anything up. Just Blank white.

I have double checked my httpd, env, config files Everything looks right.

I am using CENTOS 7, Apache, MariaDB, PHP v7.4.30

$ php -m

[PHP Modules] bcmath bz2 calendar Core ctype curl date dom exif fileinfo filter ftp gd gettext hash iconv json libxml mbstring mcrypt mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar posix readline Reflection session shmop SimpleXML sockets sodium SPL sqlite3 standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl zip zlib

[Zend Modules]

image

Reproduction steps

  1. go to http://myserver
  2. ...

Expected behavior

when I go to http://myserver to get the pre-flight check

Screenshots

No response

Snipe-IT Version

6.0.5

Operating System

CENTOS 7

Web Server

Apache

PHP Version

7.4

Operating System

CENTOS 7

Browser

FireFox

Version

91.10.0esr

Device

PC

Operating System

CENTOS

Browser

No response

Version

No response

Error messages

There isn't one

Additional context

Fresh install

CENTOS 7

install.sh

Only error I got along the way was my appache server wasn't setup right and my smtp information was wrong in the .env

I have not touched the database manually

welcome[bot] commented 2 years ago

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

mikeroq commented 2 years ago

Is this a fresh CENTOS 7 server? Did you have any errors during the install script?

Edit: Testing with the install script, seems to install php 7.1 on CentOS, mine failed saying it cannot find the packages...but your issue says your php is 7.4.

ZarxAarox commented 2 years ago

This is a fresh VM CENTOS 7 server.

I updated PHP because php-pdo and php-mysqlnd wasn't installed.

Here is a php -v for you.

$ php -v PHP 7.4.30 (cli) (built: Jun 7 2022 08:38:19) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.30, Copyright (c), by Zend Technologies

EDIT: I have taken snapshots the whole way. through this process. So I can zip back if we need to.

mikeroq commented 2 years ago

What steps did you take on installing? For me this was the end of my install.sh: `* Creating Snipe-IT user.

Further up it had output:

* Installing Apache httpd, PHP, MariaDB and other requirements.
  * Installing httpd
  * Installing mariadb-server
  * Installing git
  * Installing unzip
  * Installing php71u
  * Installing php71u-mysqlnd
  * Installing php71u-bcmath
  * Installing php71u-cli
  * Installing php71u-common
  * Installing php71u-embedded
  * Installing php71u-gd
  * Installing php71u-mbstring
  * Installing php71u-mcrypt
  * Installing php71u-ldap
  * Installing php71u-json
  * Installing php71u-simplexml
  * Installing php71u-process

Which clearly the php packages didn't install since my CentOS install says they were not found.

Can you post your /var/logs/snipeit-install.log?

mikeroq commented 2 years ago

Ok I see in another issue someone else had a problem with the install.sh and CentOS 7. https://github.com/snipe/snipe-it/issues/10581

Ideally I would use CentOS 8 at the least. Also since CentOS is EOL as of Dec 2021, maybe you should look into Rocky or another distro.

ZarxAarox commented 2 years ago

  / ___/____  (_)___  ___        /  _/_  __/
  \__ \/ __ \/ / __ \/ _ \______ / /  / /
 ___/ / / / / / /_/ /  __/_____// /  / /
/____/_/ /_/_/ .___/\___/     /___/ /_/
            /_/

Welcome to Snipe-IT Inventory Installer for CentOS, Rocky, Fedora, Debian and Ubuntu!

The installer has detected centos version 7. Q. What is the FQDN of your server? (localhost): Setting to PFS Assets

Q. Do you want to automatically create the database user password? (y/n) Q. What do you want your snipeit user password to be?

Dependencies Resolved

================================================================================ Package Arch Version Repository Size

Installing: git x86_64 1.8.3.1-23.el7_8 base 4.4 M Installing for dependencies: perl-Error noarch 1:0.17020-2.el7 base 32 k perl-Git noarch 1.8.3.1-23.el7_8 base 56 k perl-TermReadKey x86_64 2.30-20.el7 base 31 k

Transaction Summary

Install 1 Package (+3 Dependent packages)

Total download size: 4.5 M Installed size: 22 M Downloading packages:

Total 3.3 MB/s | 4.5 MB 00:01
Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : 1:perl-Error-0.17020-2.el7.noarch 1/4 Installing : perl-TermReadKey-2.30-20.el7.x86_64 2/4 Installing : perl-Git-1.8.3.1-23.el7_8.noarch 3/4 Installing : git-1.8.3.1-23.el7_8.x86_64 4/4 Verifying : git-1.8.3.1-23.el7_8.x86_64 1/4 Verifying : 1:perl-Error-0.17020-2.el7.noarch 2/4 Verifying : perl-Git-1.8.3.1-23.el7_8.noarch 3/4 Verifying : perl-TermReadKey-2.30-20.el7.x86_64 4/4

Installed: git.x86_64 0:1.8.3.1-23.el7_8

Dependency Installed: perl-Error.noarch 1:0.17020-2.el7 perl-Git.noarch 0:1.8.3.1-23.el7_8
perl-TermReadKey.x86_64 0:2.30-20.el7

Complete!

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here.

Enter current password for root (enter for none): OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation.

Set root password? [Y/n] New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.

Remove anonymous users? [Y/n] ... Success!

Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] ... Success!

By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.

Remove test database and access to it? [Y/n] - Dropping test database... ... Success!

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.

Reload privilege tables now? [Y/n] ... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB installation should now be secure.

Thanks for using MariaDB!

Composer (version 2.3.7) successfully installed to: /home/snipeitapp/composer.phar Use it: php composer.phar

To enable extensions, verify that they are enabled in your .ini files:

ZarxAarox commented 2 years ago

Above is my snipe-it install logs.

Let me know if you need anything else.

I had to change a few things from this in the httpd like my Server Name

ZarxAarox commented 2 years ago

Ok I see in another issue someone else had a problem with the install.sh and CentOS 7. #10581

Ideally I would use CentOS 8 at the least. Also since CentOS is EOL as of Dec 2021, maybe you should look into Rocky or another distro.

Any recommendations? I am not opposed to switching OS/Distros

mikeroq commented 2 years ago

I use ubuntu personally.

The install.sh script does not support CentOS Stream 9 apparently. Checking others.

ZarxAarox commented 2 years ago

Going with Ubuntu Server 22.04.

Let's see if that changes how this installation goes.

I should just throw the image on an VM: Then install SNIPEIT through the website and it should work? (In theory)

Let me know.

Thanks,

mikeroq commented 2 years ago

Yea any version of CentOS over 7 doesn't appear to be supported in the install script and if it was it would still install these packages that don't exist apprently.

I would fresh install Ubuntu, install updates, and then do the install script. OF course you can manually install apache/php/mysql and setup that way too.

ZarxAarox commented 2 years ago

I'll give it a whirl and let yall know. But it will more than likely be tomorrow before I have an update! Thanks for the ideas

ZarxAarox commented 2 years ago

Okay, I am back. But with a slightly different issue. Ubuntu 22.04 Ran through the server setup. I got through everything when I tried to get to PreFlight Check I got an Internal Server 500 error. Turned on De-Bugging And here is what it says. I gave permissions to the storage, reloaded apache2 and no change. Any thoughts?

The stream or file "/var/www/html/snipeit/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: UnexpectedValueException: The stream or file "/var/www/html/snipeit/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: UnexpectedValueException: The stream or file "/var/www/html/snipeit/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: Your APP_URL in your .env is misconfigured - it is: 192.168.136.132. Many things will work strangely unless you fix it. in /var/www/html/snipeit/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:146

Stack trace:

0 /var/www/html/snipeit/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(48): Monolog\Handler\StreamHandler->write()

1 /var/www/html/snipeit/vendor/monolog/monolog/src/Monolog/Logger.php(342): Monolog\Handler\AbstractProcessingHandler->handle()

2 /var/www/html/snipeit/vendor/monolog/monolog/src/Monolog/Logger.php(583): Monolog\Logger->addRecord()

3 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Log/Logger.php (183): Monolog\Logger->error()

4 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Log/Logger.php(94): Illuminate\Log\Logger->writeLog()

5 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(590): Illuminate\Log\Logger->error()

6 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Log\LogManager->error()

7 /var/www/html/snipeit/app/Providers/AppServiceProvider.php(53): Illuminate\Support\Facades\Facade::__callStatic()

8 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Providers\AppServiceProvider->boot()

9 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()

10 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()

11 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()

12 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call()

13 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(924): Illuminate\Container\Container->call()

14 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(905): Illuminate\Foundation\Application->bootProvider()

15 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation{closure}()

16 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(906): array_walk()

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

18 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap()

19 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(153): Illuminate\Foundation\Application->bootstrapWith()

20 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(137): Illuminate\Foundation\Http\Kernel->bootstrap()

21 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()

22 /var/www/html/snipeit/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle()

23 {main} in /var/www/html/snipeit/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:146

Stack trace:

0 /var/www/html/snipeit/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(48):Monolog\Handler\StreamHandler->write()

1 /var/www/html/snipeit/vendor/monolog/monolog/src/Monolog/Logger.php(342): Monolog\Handler\AbstractProcessingHandler->handle()

2 /var/www/html/snipeit/vendor/monolog/monolog/src/Monolog/Logger.php(583): Monolog\Logger->addRecord()

3 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Log/Logger.php(183): Monolog\Logger->error()

4 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Log/Logger.php(94): Illuminate\Log\Logger->writeLog()

5 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(590): Illuminate\Log\Logger->error()

6 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Log\LogManager->error()

7 /var/www/html/snipeit/app/Exceptions/Handler.php(44): Illuminate\Support\Facades\Facade::__callStatic()

8 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(415): App\Exceptions\Handler->report()

9 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(113): Illuminate\Foundation\Http\Kernel->reportException()

10 /var/www/html/snipeit/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle() #11 {main}

mikeroq commented 2 years ago

What is your APP_URL exactly in .env? What permissions did you set on the storage folder? This was the install script right?

ZarxAarox commented 2 years ago

APP_URL is: 192.168.136.132 I ran: sudo Chmod $775 /Path/ Yes I used the install.sh

mikeroq commented 2 years ago

APP_URL should be like APP_URL=http://192.168.136.132

ZarxAarox commented 2 years ago

I changed the APP_URL and it did take away the error for: _Permission denied The exception occurred while attempting to log: Your APPURL in your .env is misconfigured - it is: 192.168.136.132. Many things will work strangely unless you fix it. in /var/www/html/snipeit/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:146

However, everything else changes.

I am looking back at my logs and it looked like I didn't change the permissions on the path. I get an error that chown: cannot access the path.

How do I change the permissions to the path? EDIT: I can't even make this change with super user/Root.

image

mikeroq commented 2 years ago

I tested the installer on a fresh Ubuntu 22.04 and I have a permission issue as well.

try this: sudo chown -R www-data:www-data /var/www/html/snipeit

ZarxAarox commented 2 years ago

Looks like that worked!

This is the only/new error

Unsupported cipher or incorrect key length. Supported ciphers are: aes-128-cbc, aes-256-cbc, aes-128-gcm, aes-256-gcm.

EDIT: I found how to fix this on my own. I had to run: php artisan key:generate

THANK YOU FOR YOUR SUPPORT!

image

ZarxAarox commented 2 years ago

So just to make it very straight forward.

I installed Ubuntu 22.04 Created a user and gave it permissions to the sudo group configured the firewall (ufw) Installed Apache2 Configured the firewall more (ufw) Installed MySQL Installed PHP Ran the install.sh (This did all the work for me) Configured my apache file configured my .env Needed help with finer details: APP_URL Permissions to the Web Folder

That's all I had to do to get this installed! Hope it helps others.

snipe commented 2 years ago

Glad to hear you're all sorted! In the future, if you've resolved your issue, please try to remember to close your ticket - it helps us out a lot. (We have to manage a lot of tickets.)

tenant-tyvm

ZarxAarox commented 2 years ago

Glad to hear you're all sorted! In the future, if you've resolved your issue, please try to remember to close your ticket - it helps us out a lot. (We have to manage a lot of tickets.)

tenant-tyvm tenant-tyvm

First time using this platform. I will remember in the future!