snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Installation

Open firozhaneef opened this issue 12 years ago • 36 comments

I have installed snipe-it, but i am getting this error message:Error in exception handler. Please help..

firozhaneef avatar Aug 11 '14 13:08 firozhaneef

Please provide more information. What is the OS you're running, what are the contents of the error log, what did you do to trigger the error, etc

snipe avatar Aug 11 '14 13:08 snipe

Is Apache running properly? i.e. if you remove your SNIPE-IT settings from the apache conf files does the Apache welcome/example page come up? If so, then re-enable your SNIPE-IT conf and then edit this application config file, and also restart apache (service httpd restart):

app/config/production/app.php (ex. /var/www/snipeit/app/config/production/app.php) set the "debug" line = true

Reconnect and post the results.

technogenus avatar Aug 12 '14 01:08 technogenus

I am using Ubuntu 12.04.5 LTS. My apache is running properly because i can access index.html files from apache root directory (/var/www). I have edited app/config/production/app.php file and set the deug=true. but still i am getting the same error message: Error in exception handler.

No more logs under storage/logs folder

Please see the config files

app.php

true, /* |-------------------------------------------------------------------------- | Application URL |-------------------------------------------------------------------------- | | This URL is used by the console to properly generate URLs when using | the Artisan command line tool. You should set this to the root of | your application so that it is used when running Artisan tasks. | */ 'url' => 'http://www.snipe-it-fta.com', /* |-------------------------------------------------------------------------- | Encryption Key |-------------------------------------------------------------------------- | | This key is used by the Illuminate encrypter service and should be set | to a random, 32 character string, otherwise these encrypted strings | will not be safe. Please do this before deploying an application! | | Run a php artisand key:generate --env=staging to create a random one */ 'key' => 'Change_this_key_or_snipe_will_get_ya', ``` ); start.php detectEnvironment(array( ``` 'local' => array('IT-1','IT-1'), 'staging' => array('staging.snipe-it.fta.com'), 'production' => array('www.snipe-it.fta.com') ``` )); /* |-------------------------------------------------------------------------- | Bind Paths |-------------------------------------------------------------------------- | | Here we are binding the paths configured in paths.php to the app. You | should not be changing these here. If you need to change these you | may do so within the paths.php file and they will be bound here. | */ $app->bindInstallPaths(require **DIR**.'/paths.php'); /* |-------------------------------------------------------------------------- | Load The Application |-------------------------------------------------------------------------- | | Here we will load the Illuminate application. We'll keep this is in a | separate location so we can isolate the creation of an application | from the actual running of the application with a given request. | */ $framework = $app['path.base'].'/vendor/laravel/framework/src'; require $framework.'/Illuminate/Foundation/start.php'; /* |-------------------------------------------------------------------------- | Return The Application |-------------------------------------------------------------------------- | | This script returns the application instance. The instance is given to | the calling script so we can separate the building of the instances | from the actual running of the application and sending responses. | */ return $app;

firozhaneef avatar Aug 12 '14 14:08 firozhaneef

I have tried to re-install snipe-it, but i am getting this error message while i am running "php artisan app:install" command

Step: 2

Preparing your Application

Application key [IpKYNUf6yaOOhOT7KjM3xG5XbqmticgN] set successfully.

[InvalidArgumentException]
Database [] not configured.

app:install

firozhaneef avatar Aug 12 '14 14:08 firozhaneef

You have not completed all the installation instructions. You need to setup/configure MySQL (or another supported db), create database within MySQL, add a database user 'travis' with password, give the 'travis' user permissions on the newly created database, then finally edit your database.php file with the correct password and database name. Username 'travis' and database name 'snipeit_laravel' are the example defaults, but these can be anything you wish to setup. (NOTE - for developers, you should use the example default db name and username for your development environment to ensure compatibility)

here is an example using MySQL5.6 on CentOS (redhat) using root account (if, smartly, not using root then you should issue 'sudo' at the beginning of the shell command 'mysql'

[root@machine /]# mysql -u root -p
Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1923
Server version: 5.6.20 MySQL Community Server (GPL)

mysql>create database snipeit;
mysql>create user 'travis'@'localhost' IDENTIFIED BY 'somepassword';
mysql>grant all privileges on snipeit_laravel.* to 'travis'@'localhost';
mysql>flush privileges;
mysql>exit;

technogenus avatar Aug 12 '14 17:08 technogenus

Hi @firozhaneef - sorry you're having trouble. This problem has been covered a few times before.

https://github.com/snipe/snipe-it/issues/192

Your problem is caused by one of two things:

  1. There is no app/config/production/database.php

OR

  1. For some reason, in certain installs, the app/config/production/database.php isn't recognized (assuming you created one), and instead it seems to be looking for the database.php in app/config (without the environmental sub-directory). If you move app/config/production/database.php to app/config/database.php and try it again, it should work.

snipe avatar Aug 12 '14 17:08 snipe

I have already installed mysql, created a database name as 'snipeit_laravel', edited the database.php file and change the username and password with mysql username and password. I had successfully installed snipe-it once, but i was getting 'unhandled exception error, while i was trying to access through webbrowser. I hadn't specify any complete url address in the config file at the time of installation. So i removed that directory and setup files completly from apache, i created another folder as snipe-it-fta.com and copied all the snipe-it files to this directory. I have created database again and run the setup, then it got triggered this database error.

Snipe: i think, database.php file recognition might be the issue, i changed the database.php file with even wrong parameters, it showed the same error. so some how installer couldn't find the database.php file. let me try as you said, will update you tomorow. because i am from saudi arabia, gonna sleep now.

firozhaneef avatar Aug 12 '14 17:08 firozhaneef

You could also check your apache access_log and error_log (usually in /var/log/httpd), then check the Laravel framework log (app/storage/log) it might provide details on what is not working. This error also happens if your Apache does not have 'execute' permissions on the snipe diretory and/or does not have write permissions in the app/storage directory.

chgrp -R apache /var/www/snipeit/
chmod -R 754 /var/www/snipeit/
chmod -R 774 /var/www/snipeit/app/storage/

technogenus avatar Aug 12 '14 17:08 technogenus

Pretty sure my solution will fix this for @firozhaneef. It's come up a few times, and moving the DB file almost always works.

snipe avatar Aug 12 '14 18:08 snipe

Moving the database.php file from the environment folder to the config root? Is there anything common about the distro, Apache, PHP or Laravel versions to go on? We can try and reproduce it and isolate the scenario.

In theory... if PHP and Laravel even start execution, it really should be throwing the exception error into app/storage/logs file. If there are NO logs in the app/storage location for a missing database config file, and no unhandled exception error recorded by Laravel we might want to see if this is an issue to ask Laravel about.

firozhaneef, it would be helpful if you could report back on your progress and any errors that appear in the following log files:

/var/log/httpd/access_log
/var/log/httpd/error_log
snipeitDIR/app/storage/logs/ (either apachehandler or cli)

technogenus avatar Aug 12 '14 18:08 technogenus

Sorry all... its late and i am clearly missing the point here! ;) the error is actually thrown during artisan install - not loading the web app.

Please disregard the above stuff...

but would still like to find out if there is any common distro php or laravel that causes this issue.

technogenus avatar Aug 12 '14 18:08 technogenus

Thanks for your support @snipe and @technogenus. I have successfully installed snipe-it and started using it. I copied database.php to config directory and ran php artisan app:install command. Thats it.

Once i installed snipe-it, i couldn't login to the web interface with registered username and password. So i have manually checked the user details in mysql database and i found that emailid filed was holding only 20 character and my email id's character length was more than 20. So i have edited email id manually, then it rocks..

Once again, thanks for such a wonderful software.

firozhaneef avatar Aug 13 '14 06:08 firozhaneef

Great! glad its working. Which code version did you pull, and did you run php artisan migrate? You might want to pull the 'develop' branch for full testing... and run php artisan migrate. There are a lot of unhandled exception fixes in this develop version.

In the latest develop versions the database, email column is 255 characters long.

technogenus avatar Aug 13 '14 06:08 technogenus

Sorry - scratch that! Snipe has already pulled the develop branch into master... the two branches are currently equal so either will have all the same fixes.

technogenus avatar Aug 13 '14 06:08 technogenus

Yes, that is a true statement :(

snipe avatar Aug 13 '14 08:08 snipe

I have seen supplier list in online demo of snipe-it. but i couldn't find this feature with what i have installed in my pc. I am using snipe-it-v.0.3.6-alpha.

firozhaneef avatar Aug 13 '14 09:08 firozhaneef

Do you maybe mean manufacturer? 

snipe avatar Aug 13 '14 09:08 snipe

In the current version (0.4.3) supplier is available in the asset create screen, manufacturer is also available, but in the asset models create screen.

image

technogenus avatar Aug 13 '14 10:08 technogenus

I am using snipe-it-v.0.3.6-alpha. i have downloaded this 3 days ago from the snipe-it website. Where i can find the lastest virsion 0.4.3?

I have seen manufacturer list but not suppliers.

Let me ask you about one more feature that is asset tracking history. ex: to know who all were used a particular asset before. Do you have any plan to implement this feature?

screenshot from 2014-08-13 13 26 42

firozhaneef avatar Aug 13 '14 10:08 firozhaneef

Sorry. Please ignore my question regarding the asset history. This feature is already available with snipe-it. Great Job.

firozhaneef avatar Aug 13 '14 12:08 firozhaneef