/reports/activity should display a report of all activities.
Currently getting a generic "Whoops something went wrong" page. Laravel shows this:
[2017-01-09 09:58:16] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'App\Http\Controllers\License' not found' in /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php:218
Stack trace:
If a stacktrace is provided in the error, include that too.
[2017-01-09 09:58:16] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'App\Http\Controllers\License' not found' in /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php:218
Stack trace:
Any errors that appear in your browser's error console.
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
app/storage/logs and your webserver's logs.Side note: Thank you for producing and maintaining this product!!! It has been a HUGE relief for my asset management needs. I'm hoping this is a quick fix from something I derped on.
Can you give me a little more of that stack trace? Specifically anything that mentioned the ReportsController or License model.
Currently, the log only shows that one line. Going back to October does have a stack trace with the word ReportsController.
Server history (in case it's useful): I first setup Snipe in May-ish on Ubuntu 14.04. In late August I did a backup/restore to a CentOS 7 VM. I used the asset and license importer tools to bring in a lot of my data. Server gets update within two weeks of a new release. I did have an issue where models and users fields would not populate, this was due to me have http:// in my .env file for "APP_URL" and not https:// (httpd has a rewrite rule to redirect all the things to https). There was an issue with an update to the httpd daemon, I ended up having to reinstall httpd, mod_ssl, and phpu56_common.
[2017-01-10 07:43:16] production.DEBUG: LDAP is enabled.
[2017-01-10 07:43:16] production.DEBUG: Binding user to LDAP.
[2017-01-10 07:43:16] production.DEBUG: LDAP user my.name successfully bound to LDAP
[2017-01-10 07:43:16] production.DEBUG: Local auth lookup complete
[2017-01-10 07:43:16] production.DEBUG: Local user my.name exists in database. Updating existing user against LDAP.
[2017-01-10 07:43:22] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'App\Http\Controllers\License' not found' in /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php:218
Stack trace:
Edit: Now that I'm reading that log file I see it says "Permission denied". I did just do a 'setenforce 0' for testing and verified the owner of everything in my web directory is owned by apache:apache (CentOS 7/httpd).
Have you tried clearing your composer cache? That's a weird error, as it shouldn't be looking in the controllers directory for a model.
php composer.phar install --no-dev --prefer-source
php artisan config:clear
php composer.phar dump-autoload
php artisan migrate
php artisan view:clear
I have tried clearing the cache. I just ran those commands and going off my head, they look similar to what I run upgrade after every release. Still having the issue
Verified my adblockers were off. Tried different browsers in different OS's. Tried default admin account and my LDAP account that has Global Admin. I do use LDAP over SSL with an internally signed cert.
I did add about 10 assets when I had my APP_URL set to HTTP instead of HTTPS. Do you think that could've mucked something up in the database? Would it be sensible to move everything out of my current SnipeIT installation, pull from master, restore my .env file, and run those same commands?
No, the APP_URL is a setting we use to make sure your URLs are all loading from the right place, but it's not stored anywhere permanent in the database or anything.
I don't really understand why there's no more in your laravel log tho.
Try removing your vendor directory and re-running composer install --no-dev maybe?
Note: Homepage does display recent activity.
Is there license activity there? It's truncated, so I'm wondering if it's hitting a bit of weird data somewhere further down the line in the reports page.
Do you get that Whoops page on the reports page itself, or just in the log? IIRC, we switched to an ajax loading method for that activity report a while back, so nothing on that page should even be looking for licenses specifically, just the ajax JSON call.
Executed the following commands. Same error.
$ mv vendor vendor.old
$ composer.phar install --no-dev
$ php artisan view:clear
There is license activity, about 1/3 to 1/2 of the items in recent activity are licenses. The rest are assets (no consumables).
Okay this might be a thing. What should my reports url be? If I go to "/reports" or "/reports/" I get a 404. If I click my reports icon on the left side of the page, it reloads the menu for other reporting links.
Edit: output from laraval.log. Looks the same to me. Posting in case my eyes are derping. I did auth as admin with no problem.
[2017-01-10 17:54:13] production.DEBUG: LDAP is enabled.
[2017-01-10 17:54:13] production.DEBUG: Binding user to LDAP.
[2017-01-10 17:54:13] production.DEBUG: LDAP user admin not found in LDAP or could not bind
[2017-01-10 17:54:13] production.ERROR: There was an error authenticating the LDAP user: Could not find user in LDAP directory
[2017-01-10 17:54:13] production.DEBUG: Authenticating user against database.
[2017-01-10 17:54:18] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'App\Http\Controllers\License' not found' in /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php:218
Stack trace:
[2017-01-10 18:10:08] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'App\Http\Controllers\License' not found' in /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php:218
Stack trace:
Okay this might be a thing. What should my reports url be? If I go to "/reports" or "/reports/" I get a 404. If I click my reports icon on the left side of the page, it reloads the menu for other reporting links.
There is no reports index page. The hover triggers the dropdown menu, which is where you pick your report. The URL of there activity report should be: /reports/activity
Gotcha. /reports/activity is the only problematic page and does display the "Whoops something went wrong" error. All other report pages work fine, including License Activity.
Edit: Stupid question, do I need to do anything to get more verbose output from Laraval other than setting "APP_DEBUG=true" in .env?
With debug enabled, can you load that page so we get a full stack trace on screen?
I'm afraid that's really it. URL is like https://inventory.my-domain.net/reports/activity

Doing a passive look on the License Report page. Some interesting values I see is a date for 1969, I don't see this but I know some licenses are checked out to a user and asset, and one license key is 337 characters long.
Dates for 1969 usually just indicate a badly formed date was imported/added so mySQL didn't know how to store it correctly. They shouldn't cause an error like this.
What's really puzzling me is what it's looking for anything with licenses at all on that activity report. I would expect that error to show up in the Ajax call that actually returns the data, not the page itself.
Also, can you check your action_logs table and tell me if you see anything weird in the target_type or item_type columns. Should look like App\Models\Blah.
@dmeltzer - can you take a look when you get a chance? All I've found is https://laracasts.com/discuss/channels/general-discussion/polymorphic-relations-gives-class-staff-not-found?page=1 which might be related.
You telling me I can't have an import date like -1? Not fair! I can't think of anything super geeky off the top of my head.
Does "App\Http\Controllers\License" count? I don't see any other groupings of values that contain "Http".
Yikes, yeah - that's no good.
Try this:
update action_logs set item_type='App\\Models\\License' where item_type='App\\Http\\Controllers\\License'
You should be able to have a null date, just not an invalid one.
IT'S ALIVE!!!
Thank you @snipeyhead!!!

I recently upgraded to 3.6.3 and managed to introduce the bug by checking in an asset checked out a while ago (perhaps while on 2.x version). The same fix worked for me to. Thanks!
I ran across this same issue on v. 3.6.4 after performing a user delete & checkin. The SQL solution fixed it! Thanks! +1
thank youuuu <3
Most helpful comment
Yikes, yeah - that's no good.
Try this:
update action_logs set item_type='App\\Models\\License' where item_type='App\\Http\\Controllers\\License'You should be able to have a null date, just not an invalid one.