Common Issues

🚧

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 be resolved if you remember to run the following commands when you encounter weird errors:

These commands should be run from your Snipe-IT project root, just like every other cli command we mention. They should not need to be run as root/sudo/admin.

composer dump-autoload
php artisan cache:clear 
php artisan config:clear
php artisan route:clear
php artisan debugbar:clear
php artisan event:clear
php artisan view:clear
php artisan optimize:clear
php artisan clear-compiled

Or to run them as a one-liner all at once:

composer dump-autoload; php artisan cache:clear; php artisan config:clear; php artisan route:clear; php artisan debugbar:clear; php artisan event:clear; php artisan view:clear; php artisan optimize:clear; php artisan clear-compiled

These commands clear out cached service files that help speed up modern PHP applications but can also very occasionally be out of date, resulting in odd errors. These caches will be regenerated normally, so they can be cleared without repercussion. (You can also run php update.php from the Snipe-IT project directory to run these commands and other helpful clean-up commands all at once.)

Also be sure to delete the following files if they exist:

  • bootstrap/cache/compiled.php
  • bootstrap/cache/services.php
  • bootstrap/cache/config.php

Deleting these files won't cause any harm.

Use Composer 2

Composer 2 has been out for some time now, and tends to be more stable than Composer 1. To upgrade composer, run composer self-update --2. If you should need to rollback to Composer v1, you can just run composer self-update --1.

Check your server dependencies and versions

To check that your system has all of the extensions required by composer, try running:

composer check-platform-reqs

You should see output like:

✨snipe@deepthought✨ snipe-it  (develop) $ composer check-platform-reqs
Checking platform requirements for packages in the vendor dir
ext-bcmath     7.4.12      success
ext-ctype      7.4.12      success
ext-curl       7.4.12      success
ext-date       7.4.12      success
ext-dom        20031129    success
ext-fileinfo   7.4.12      success
ext-filter     7.4.12      success
ext-gd         7.4.12      success
ext-iconv      7.4.12      success
ext-json       7.4.12      success
ext-ldap       7.4.12      success
ext-libxml     7.4.12      success
ext-mbstring   7.4.12      success
ext-openssl    7.4.12      success
ext-pcre       7.4.12      success
ext-pdo        7.4.12      success
ext-phar       7.4.12      success
ext-simplexml  7.4.12      success
ext-tokenizer  7.4.12      success
ext-xml        7.4.12      success
ext-xmlwriter  7.4.12      success
ext-zip        1.15.6      success
lib-pcre       10.35       success
php            7.4.12      success

(The above is just an example of potential output, and will change over time, but it should at least tell you if the basic libraries are installed and are in a compatible version.)

Error 500 when saving asset models or importing

If you check your logs, you're likely to find an error like

The /var/www/snipe-it/bootstrap/cache directory must be present and writable.

Check that the storage/cache directory exists and is writable by the web server.

Error 500 on saving assets with custom fields in v6

If you look in the logs, you'll likely see an error like "column not found" when you try to save an asset with custom fields. What we suspect happened is that PHP's transliteration changed slightly between PHP versions, and therefore the custom field column name it's expecting is not the same as the one on your assets table.

Call to undefined function Controllers\Admin\ldap_connect()

The PHP LDAP extension is not installed on your server. While this extension is not required for all Snipe-IT installations, it must be installed if you wish to use any of the LDAP functionality.

Error message: Error Output: PHP Fatal error: Call to undefined method IlluminateFoundationApplication::registerCoreContainerAliases() in ../src/Illuminate/Foundation/start.php on line 106

Remove bootstrap/compiled.php and your vendors dir, and try running php composer.phar update.

Error message: Image Source not readable

This usually means that the temporary directory is not writable by the web server. Check the permissions section of the documentation for your server OS and make sure you've granted the user the ability to write to the temp directory.

Error: Insufficient permissions! after upgrading

While older versions of Snipe can be updated rather painlessly by simply using php artisan migrate, when upgrading from ancient versions (i.e. v1.1) to newer versions you may experience issues with user deletion, viewing backups etc.

This is due to the fact that migrations will not automatically add "Admin" users to the new "Super User" permission group.

To resolve (without raw SQL/db queries) try the following:

  • login as an admin user
  • create a new (throw away) admin user with Super User permissions
  • log out and log back in as new user
  • elevate all the users who need Super User
  • log out and back into your regular admin account that has just been elevated
  • delete the throw away user you created earlier to ensure elevation worked

ErrorException thrown with message "Undefined index: fields"

This happens when the URL you've set in your configuration is not the actual URL your installation is using, for example if you had http://snipe.local as your URL in your configuration, but you are accessing the page from http://snipe-it.local.

🚧

IMPORTANT:

The URL in your configuration must be the exact URL you use to access the site, or else you'll run into a CORS/domain policy error or a 404 on critical pieces.

404 Errors on Javascript, CSS or Image Files

This happens when the URL you've set in your configuration is not the actual URL your installation is using, for example if you had http://snipe.local as your URL in your configuration, but you are accessing the page from http://snipe-it.local.

🚧

IMPORTANT:

The URL in your configuration must be the exact URL you use to access the site.

Error when LDAP syncing: ldap_control_paged_result_response(): No server controls in result

This unhelpful error happens when your connection didn't trigger any other errors, but it's not able to get any results. This can sometimes happen if your AD/LDAP server will only send results over TLS, and you don't have the "Use TLS" checkbox checked in Admin > LDAP.

Changes to my .env file don't seem to be updating

Some web servers requires that you restart the web server after making changes to the .env file, so try restarting Apache/IIS/etc.

Also, if you ran the artisan command to cache your environmental variables for faster performance, run:

php artisan config:clear

to clear out your old cached values.

Exception in BaseEncrypter.php on line 44 getJsonPayload() -> throw new DecryptException('The payload is invalid.')

Disable Xdebug.

401 Unauthorized Error on API calls

There are a few different reasons why you might see this.

API tokens default to being valid for 40 years. If you run into this issue, you are most likely running a 32-bit version of PHP (which, why?). To work around this, in your .env, set API_TOKEN_EXPIRATION_YEARS to a smaller number, like 10 years, and clear your config cache by running php artisan config:clear.

Also be sure you're sending both the Accept header and the Content-Type header along with your Bearer token in your request.

Additionally, if you're using Apache, make sure your htaccess file is readable via the web server by setting the AllowOverride None to AllowOverride All.

Broken Barcodes

If your barcodes are not showing up properly, either as broken images or with the words "invalid barcode" on them, there can be a few different explanations:

  • Check the permissions on your public/uploads/barcodes directory and make sure that directory is writable by the server.
  • Confirm that the barcode type you've selected is compatible with your asset tags. For example, if you have selected EAN5 barcodes need 5 characters, numbers only. If your asset tags are a combination of numbers and letters, that won't be compatible. That's just a limitation on the barcode specifications](https://github.com/tecnickcom/tc-lib-barcode), not something specific to Snipe-IT. We will generate a label with the "Invalid barcode" text on it to help you figure out what's going on.

"Whoops" error on checkin/checkout

If the item is correctly checked in or out in the database, but instead of returning you to the previous page, you see a "Whoops" error, the cause of this is usually that your email or your slack web hook is misconfigured. Check your settings and try again.

Permission Denied error when trying to send a test mail on CentOS or RHEL

If you are using CentOS, RHEL or some other SELinux enabled distribution, SELinux may be preventing Apache from opening any outgoing sockets.

In order to allow it, run the following command:

setsebool -P httpd_can_network_connect on

500 Error on Creating API Tokens

Run the following to create your personal access client:

php artisan passport:client --personal

Google Maps not loading

If your set your Google Maps API so you can display maps on locations and suppliers pages in v4.1.7+ and your maps aren't showing up, this usually means you haven't authorized your Google API key to use the Maps APIs. (It's a long, convoluted process that Google makes far more confusing than it should be.)

The easiest way to verify if this is what's happening is to view the map image url in a browser directly. You'll probably see something like The Google Maps API server rejected your request. This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console: https://console.developers.google.com/apis/api/static_maps_backend?project=_

In the Google Developers console, go to Library, search for Maps and enable the Maps APIs. (If you want to limit it to just the ones we need, I think it's the Maps Simple Embed API or Static Maps API.)

It can take a minute or two after enabling those APIs for google to recognize that it’s authorized now.

Error creating API token: Trying to get property of non-object ClientRepository.php#81

Run php artisan passport:install.

Unable to send email using Gmail

If you you encounter errors like ErrorException in StreamBuffer.php line 94: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed when trying to send mail (via forgotten password, asset checkout confirmation, etc) and you're using email, there are a few possibilities. First, make sure you've followed all of the steps outlined in the Gmail configuration section.

If you're still having trouble, this most often happens when you have an invalid or missing SSL root bundle with a self-signed SSL certificate.

First, make sure your php.ini has curl.cainfo, openssl.cafile and openssl.capath point to the right cacert.pem file.

If you don't have it. you can download it from https://curl.haxx.se/ca/cacert.pem and place it anywhere you want.

More information available here, here and here.

If none of those things work, you can try using mail as your MAIL_DRIVER in your .env to send emails locally from the server without dealing with an SMTP server.

Swift_TransportException Connection could not be established with host [Permission denied #13]

On Linux systems, we usually see this with servers that have SELinux enabled, but have not enabled the networking protocols for the web server.

To allow the web server to make Network Socket connections:

setsebool -P httpd_can_network_connect on

To allow for the web server to send out mail:

setsebool -P httpd_can_sendmail on

See the documentation on sending email with SELInux enabled for more information.

SVG images will not upload

If the upload of a SVG files fails, make sure that the following two lines are include on top of the SVG file, before the <svg> section starts:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

Two-Factor Authentication Codes Won't Work

Check your server's time. The most common reason for this is that your server's time is out of sync or off by a few moments.

Can't find images uploaded during audit/Asset Audit Image Location

Images uploaded during an asset audit can be found by adding the "Download" hidden column on the Asset History tab.

Column not found

Whenever you see a "Column not found" error, it means that database migrations need to be run, or did not run successfully. Try running php artisan migrate.

400 Error: Header too large

This generally happens with systems that have a very large number of custom fields. The issue is caused because the listing pages use a browser cookie to store your table preferences - what columns you have shown/hidden, search input on list pages, etc - and if you have quite a lot of custom fields, that cookie can get too large and the browser won't handle it well. (This is a browser limitation, not a limitation in Snipe-IT.)

If you end up seeing this error more than once after clearing your cookies, change the following value in your .env from:

BS_TABLE_STORAGE="cookie"

to:

BS_TABLE_STORAGE="localStorage"

You will lose your last stored column/table preferences, but once you've selected them again, you should not have any issues, since that information will no longer be stored in a cookie, but instead in your browser's local storage, which has a much higher data capacity. (It can often speed things up quite a bit as well.)