[Guide] Setting up Snipe-IT on Unraid


25 posts in this topic Last Reply

Recommended Posts

Snipe-IT is an Asset Management System. This guide will help you to install it and get it running.

 

Database Backend

Installing MariaDB

Snipe-IT requires MySQL or MariaDB as its database backend. We’ll be using MariaDB.

Head over to Community Applications and pull MariaDB.

 

I left the Host Port as 3306, but ensure it doesn’t conflict with any existing containers. If you change it you will need to use the custom value in the Snipe-IT configuration later. You’ll need to setup a root password in Key 3, and it must be at least 4 characters long.

 

Now Apply to install the container.

 

Creating a Database and User

Snipe-IT requires that we setup a Database and User in preperation for the installation, so let’s do that.

 

In the Docker tab, click on mariadb and select the Console option, which will open a Bash shell into the container.

 

To login to the database, you’ll need to execute the following command:

mysql -u root -p

It will now ask for the password. This is the root password that we just configured in the template.

 

To create a database, user and password for Snipe-IT, execute the following commands:

CREATE DATABASE databasename;
CREATE USER username IDENTIFIED BY 'password';
GRANT ALL ON databasename.* TO 'username';

 

Disabling Strict Mode

Snipe-IT requires that Strict Mode is disabled for installation and setup.

To ensure we put it back correctly after installation, we’ll be collecting the current values first.

 

Execute the following command in the Bash shell to select all values.

SELECT @@SQL_MODE;

Copy all of the modes. Mine were;

STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

 

Repeat this process for @@GLOBAL.SQL_MODE using the below command:

 

SELECT @@GLOBAL.SQL_MODE;

 

Now to disable Strict Mode, execute the following two commands:

SET @@SQL_MODE = '';
SET @@GLOBAL.SQL_MODE = '';

 

Installing Snipe-IT

I’ve put together a template for Snipe-IT in Community Applications, so it should just be a process of filling out the required values.

 

Head over to Community Applications and search for snipe-it, and install it.

 

There are quite a lot of options that need filling out, but they are all required. My configuration looks like this (fill out your own details where applicable)

MySQL Database Name: databasename
MySQL Username:      username
MySQL Password:      password
MySQL Database Host: 192.168.0.3
MySQL Database Port: 3306

SMTP Address:        smtp.mail.yahoo.com
SMTP Port:           465
SMTP From Address:   youremail@domain.com
SMTP From Name:      john doe
SMTP Encryption:     tls
SMTP Username:       youremail@domain.com
SMTP Password:       your email password

App Key:             LEAVE THIS BLANK FOR NOW
App URL:             http://192.168.0.3:8087
App Timezone:        Europe/London
App Locale:          en-GB

Port:                8087

Ensure that Port and App URL use the same port number in the event that you change it.

Ensure that MySQL Database Port is correct.

 

Before hitting apply, we need to generate the App Key!

 

Open the Unraid Terminal and run the following command:

openssl rand -base64 32

This should produce something along the lines of:

cbWIMLG/JSqLhEvZsRh7v37KfKL2CAwApn64oEEOTjI=

Copy the value, and in the App Key field, enter base64:yourappkeyhere.

Your App Key field should look like the following:

base64:cbWIMLG/JSqLhEvZsRh7v37KfKL2CAwApn64oEEOTjI=

Hit Apply to install the container.

 

Setup Snipe-IT

Once installed, go to the Docker tab and open the Web-UI for Snipe-IT.

 

UPDATE: Whoops, looks like something went wrong.

If you see the error "Whoops, looks like something went wrong.", this is likely an issue with your App Key (As experienced by myself and another member). Unfortunately, the Container log file won't say that the App Key is the problem. Go back in this guide, and ensure that your App Key is setup and valid. If the problem persists, check the Container log file for anything else, hopefully it will indicate why it's not loading properly.

 

If everything went well, you should be presented with the Snipe-IT Pre-Flight page.

image.thumb.png.a440ca48ab778213f18fe7eff08e3a47.png

 

Unfortunately, SMTP isn’t working for me, I’m not sure why, as I’ve setup SMTP using the same settings elsewhere. UPDATE: I've had confirmation that other email's are working, so it's likely just something to do with Yahoo accounts.

 

Assuming all is green (except for Email), hit the Next: Create Database Tables button – BE PATIENT! I’m running this container on an SSD and it took nearly 2 minutes for this step to complete.

 

Once complete, hit the Next: Create User button. At this point, fill out your details as appropriate, and then you should be presented with the User Interface.

 

Re-Enabling Strict Mode

We want to ensure that MariaDB maintains its integrity, especially if you currently / will use it for other uses.

Open up a Bash shell for MariaDB again, and log in using the command from earlier.

 

Once in, execute the following command, substituing your SQL_MODES save from earlier where applicable. My command looked like:

SET @@SQL_MODE = 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

Again, perform this command for @@GLOBAL.SQL_MODE.

 

And that’s it, you should be all up and running! Now to spend hours inputting all my data…

Edited by Progeny42
Update to SMTP, and App Key problems
Link to post

I just spent all day Friday pounding my head trying to make this work and failing. Thank you. I suspect I was failing due to trying to use the beta release but I can't confirm that.

FYI apparently there is now TWO Snipe-IT templates in the app store so you may want to edit to update which one is yours. I used the first one and it worked like a charm.

Link to post

 

12 hours ago, argash said:

FYI apparently there is now TWO Snipe-IT templates in the app store so you may want to edit to update which one is yours. I used the first one and it worked like a charm.

You wanna show me a screenshot?  AFAICT there have never been 2 appearing.

Link to post

Hi all.

 

I am trying to set this up but if I open the webui via the unRaid docker manager i get a page saying "Whoops, looks like something went wrong."

 

In the container log I see this:

Module ssl disabled.
To activate the new configuration, you need to run:
service apache2 restart
2020-09-07 11:58:27,028 CRIT Supervisor running as root (no user in config file)
2020-09-07 11:58:27,030 INFO supervisord started with pid 1
2020-09-07 11:58:28,031 INFO spawned: 'exit_on_any_fatal' with pid 20
2020-09-07 11:58:28,033 INFO spawned: 'apache' with pid 21
2020-09-07 11:58:28,034 INFO spawned: 'run_schedule' with pid 22
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.10. Set the 'ServerName' directive globally to suppress this message
No scheduled commands are ready to run.
2020-09-07 11:58:29,326 INFO success: exit_on_any_fatal entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-07 11:58:29,326 INFO success: apache entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-07 11:58:29,326 INFO success: run_schedule entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Haven't even reached the setup page yet.

 

EDIT: I hadn't done the app key right. Thats fixed now and I could proceed, just incase someone else has the same issue.

Edited by Dimtar
Link to post

@Dimtar Hey glad you figured it out. Yes, you will experience an error if the App Key is not valid as far as the Container is concerned. There's also nothing the log file to indicate that the App Key is the cause of the problem, so it's mostly just a trial an error thing. I'll add it to the original post as an update to warn people.

Link to post
13 hours ago, Dimtar said:

Hi all.

 

I am trying to set this up but if I open the webui via the unRaid docker manager i get a page saying "Whoops, looks like something went wrong."

 

In the container log I see this:


Module ssl disabled.
To activate the new configuration, you need to run:
service apache2 restart
2020-09-07 11:58:27,028 CRIT Supervisor running as root (no user in config file)
2020-09-07 11:58:27,030 INFO supervisord started with pid 1
2020-09-07 11:58:28,031 INFO spawned: 'exit_on_any_fatal' with pid 20
2020-09-07 11:58:28,033 INFO spawned: 'apache' with pid 21
2020-09-07 11:58:28,034 INFO spawned: 'run_schedule' with pid 22
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.10. Set the 'ServerName' directive globally to suppress this message
No scheduled commands are ready to run.
2020-09-07 11:58:29,326 INFO success: exit_on_any_fatal entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-07 11:58:29,326 INFO success: apache entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-07 11:58:29,326 INFO success: run_schedule entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Haven't even reached the setup page yet.

 

EDIT: I hadn't done the app key right. Thats fixed now and I could proceed, just incase someone else has the same issue.

I'm having the exact same issue, i tried copying the provided app key and i tried generating it myself. i still get this issue. i used mysql and all provided commands ran perfectly. 

 

edit: Not sure why but i assume i had to delete the appdata folder when changing the appkey, the pre-flight page now popped up.

Edited by StevenB789
Link to post
22 hours ago, Korshakov said:

This one:

6c510455e05c7a86522d7856de1ec8c2f7f635ef54d60b730ca3ebddd6d79034

That'll likely be your problem. That App Key is too long.

 

Make sure you use this command to generate a key in the Unraid terminal: 

openssl rand -base64 32

Then in the Container Edit menu, put:

base64:yourappkeyhere

 

Link to post
4 hours ago, Progeny42 said:

That'll likely be your problem. That App Key is too long.

 

Make sure you use this command to generate a key in the Unraid terminal: 


openssl rand -base64 32

Then in the Container Edit menu, put:


base64:yourappkeyhere

 

god, so sorry about that i didnt think twice i didnt add the base64: before my key.... sorry again!

 

Link to post

So here's an interesting one. I setup reverse proxy with the LE/SWAG container and everything is working fine. However, when I go to generate new labels the QR codes are still pointing to the internal IP address. I've updated the App URL variable with the external URL and restarted the container but new codes still point to the internal IP not the URL.

Link to post
  • 3 weeks later...

My unraid docker log is below. I'm not even getting to the "Whoops, looks like something went wrong" page.  I get the standard "This page isn’t working" HTTP ERROR 500

 

Any ideas? 

Module ssl disabled.
To activate the new configuration, you need to run:
service apache2 restart
2020-10-02 15:55:23,650 CRIT Supervisor running as root (no user in config file)
2020-10-02 15:55:23,651 INFO supervisord started with pid 1
2020-10-02 15:55:24,653 INFO spawned: 'exit_on_any_fatal' with pid 35
2020-10-02 15:55:24,654 INFO spawned: 'apache' with pid 36
2020-10-02 15:55:24,655 INFO spawned: 'run_schedule' with pid 37
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.11. Set the 'ServerName' directive globally to suppress this message
No scheduled commands are ready to run.
2020-10-02 15:55:25,838 INFO success: exit_on_any_fatal entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-10-02 15:55:25,838 INFO success: apache entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-10-02 15:55:25,838 INFO success: run_schedule entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

 

 

 

Edited by santiman717
Link to post
  • 5 weeks later...
On 9/11/2020 at 11:10 PM, argash said:

So here's an interesting one. I setup reverse proxy with the LE/SWAG container and everything is working fine. However, when I go to generate new labels the QR codes are still pointing to the internal IP address. I've updated the App URL variable with the external URL and restarted the container but new codes still point to the internal IP not the URL.

Do you mind sharing your proxy conf file? :)

Link to post

Been getting this error for the past couple days, not sure if it was from the snipe-it or mariabd update.

 

D'oh! Looks like we can't connect to your database. Please update your database settings in your .env file. Your database says: SQLSTATE[HY000]: General error: 1835 Malformed communication packet (SQL: select 2 + 2)

 

Any suggestions? 

Edited by 5252525111
Link to post
4 hours ago, 5252525111 said:

Been getting this error for the past couple days, not sure if it was from the snipe-it or mariabd update.

 


D'oh! Looks like we can't connect to your database. Please update your database settings in your .env file. Your database says: SQLSTATE[HY000]: General error: 1835 Malformed communication packet (SQL: select 2 + 2)

 

Any suggestions? 

For anyone else getting this, seems to be mariadb. https://jira.mariadb.org/browse/MDEV-24121 

 

Looks like they resolved the issue but the version with the solution has not been pushed to docker hub yet. 

Link to post
  • 4 weeks later...

It seems the changes to strict mode are no longer required (I didn't have to do them with a new setup) and the "whoops something went wrong" issue just shows 500 server error now instead.

 

Also on the initial page preflight check, e-mails fail to send with gmail configured, but work fine after getting things up and running. 

 

PS - the /config/ volume mapping no longer seems needed, only your "data" one does. 

 

https://snipe-it.readme.io/docs/docker

 

According to them they are mapping --mount source=snipe-vol,dst=/var/lib/snipeit and that's it :)

Link to post
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.