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

Create Admin User in Pre-flight reloads blank and doesn't create database user

Open lcudmore opened this issue 7 years ago • 9 comments

Please confirm you have done the following before posting your bug report:

Describe the bug

Pre-flight - Create Admin User - After I fill in the form and it the [Next: Save User] button the form reloads blank. I've Looked at #7446 and also #5128

My storage/logs/laravel.log is blank. Permission set to 777 on this file.

Steps to reproduce the behavior:

  1. Deleting the Database Schema
  2. Create a blank database schema
  3. run artisan config:clear & cache:clear & view:clear & route:clear
  4. Go through pre-flight 1. configuration check and 2. Create Database Tables
  5. check database tables are created. (They are)
  6. run artisan migrate -- creates the oauth_ tables and I've confirmed they are also written into database schema
  7. Re-run pre-flight and get to create database user form. Fill it out and hit next....
  8. form reloads blank. Clear ALL browser history and cookies and re-try all steps again.

Expected behavior

I would expect that the users table in the database should have one user after this set. I've Checked the database. No items in user table. No items in setting table. No data anywhere.

Server (please complete the following information):

  • Snipe-IT Version - Newest Install from Git hub today
  • OS: Redhat 7.5
  • Web Server: Apache 2.4
  • PHP Version 7.1.8 Mysql database is running on Secondary Server. mariadb.x86_64 version 1:5.5.60

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser : chrome, Firefox and EI

Error Messages I'm getting No errors. Log files are blank. Debug is turned ON. SELinux is Disabled.

checked apache error_log - I only see the error that I got when I testing garbage in the public/.htaccess file

  • WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
  • If a stacktrace is provided in the error, include that too.
  • Any errors that appear in your browser's error console.

Additional context

  • Yes - run Git pull as myuserID
  • Changed group chgrp to be apache user on all files
  • change mode 775 -R to storage and public/uploads
  • change mode 775 -R on vendor file folder too for kicks.
  • Granted snipe_user full control to database will full DBA and all rights

I am on a private network going through a proxy server for http(s) access. I've setup my git clone to use the proxy and server host to user proxy. Git and composer installed without error.

Only Web console (firebug) messages are Warnings about insecure active content on:
/js/plugins/select2/select2.min.css /css/dist/all.css?id=98db4e9b7650453c8b00” /js/dist/all.js?id=bf1b244d8cc9096e4a18” /js/plugins/select2/select2.min.css” /css/dist/all.css?id=98db4e9b7650453c8b00” /js/dist/all.js?id=bf1b244d8cc9096e4a18” /js/plugins/select2/select2.min.css” css/dist/all.css?id=98db4e9b7650453c8b00

My .env (The only file I've changed or modified --without my passwords and account info)

--------------------------------------------

REQUIRED: BASIC APP SETTINGS

--------------------------------------------

APP_ENV=production APP_DEBUG=true APP_KEY=keywasinsertedhere= APP_URL=http://snipeit.mydomain.ca APP_TIMEZONE='America/Vancouver' APP_LOCALE=en MAX_RESULTS=500

--------------------------------------------

REQUIRED: DATABASE SETTINGS

--------------------------------------------

DB_CONNECTION=mysql DB_HOST=cs-surreydb1.dc.mydomain.ca DB_DATABASE=snipeit DB_USERNAME=snipe_user DB_PASSWORD=Thepassword DB_PREFIX=null DB_DUMP_PATH='/usr/bin' DB_CHARSET=utf8mb4 DB_COLLATION=utf8mb4_unicode_ci

--------------------------------------------

OPTIONAL: SSL DATABASE SETTINGS

--------------------------------------------

DB_SSL=false DB_SSL_KEY_PATH=null DB_SSL_CERT_PATH=null DB_SSL_CA_PATH=null DB_SSL_CIPHER=null

--------------------------------------------

REQUIRED: OUTGOING MAIL SERVER SETTINGS

--------------------------------------------

MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=mygmailaccountid MAIL_PASSWORD=thepassword MAIL_ENCRYPTION=tls [email protected] MAIL_FROM_NAME='Help Surrey Snipe-IT' [email protected] MAIL_REPLYTO_NAME='Help Surrey' [email protected]

--------------------------------------------

OPTIONAL: SESSION SETTINGS

--------------------------------------------

SESSION_LIFETIME=12000 EXPIRE_ON_CLOSE=true ENCRYPT=true COOKIE_NAME=snipeit_session COOKIE_DOMAIN=snipeit.mydomain.ca SECURE_COOKIES=false

--------------------------------------------

OPTIONAL: SECURITY HEADER SETTINGS

--------------------------------------------

APP_TRUSTED_PROXIES=192.168.1.1,10.1.1.0 ALLOW_IFRAMING=false REFERRER_POLICY=same-origin ENABLE_CSP=false CORS_ALLOWED_ORIGINS=null

--------------------------------------------

OPTIONAL: CACHE SETTINGS

--------------------------------------------

CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync CACHE_PREFIX=snipeit

--------------------------------------------

OPTIONAL: REDIS SETTINGS

--------------------------------------------

REDIS_HOST=null REDIS_PASSWORD=null REDIS_PORT=null

--------------------------------------------

OPTIONAL: MEMCACHED SETTINGS

--------------------------------------------

MEMCACHED_HOST=null MEMCACHED_PORT=null

--------------------------------------------

OPTIONAL: AWS S3 SETTINGS

--------------------------------------------

AWS_SECRET=null AWS_KEY=null AWS_REGION=null AWS_BUCKET=null

--------------------------------------------

OPTIONAL: LOGIN THROTTLING

--------------------------------------------

LOGIN_MAX_ATTEMPTS=5 LOGIN_LOCKOUT_DURATION=60

--------------------------------------------

OPTIONAL: MISC

--------------------------------------------

APP_LOG=single APP_LOG_MAX_FILES=10 APP_LOCKED=false FILESYSTEM_DISK=local APP_CIPHER=AES-256-CBC GOOGLE_MAPS_API= BACKUP_ENV=true

lcudmore avatar Sep 24 '19 23:09 lcudmore

Just adding my voice to this, I've hit the exact same issue

GeekJosh avatar Oct 08 '19 14:10 GeekJosh

Just managed to fix this on my instance - in my case, the issue was I had a typo in .env on COOKIE_DOMAIN, once I corrected that I could complete the setup no problems.

GeekJosh avatar Oct 09 '19 09:10 GeekJosh

My problem is I'm on a private network. Which has one hostname/IP that is private and then there is the public IP which has a public hostname that is an alias to the private going over a load balancer. I've put in the public URL for the APP_URL in the .env and i've used the same for the COOKIES_DOMAIN and it will not work.

At this point I'm thinking to just get rid of this server and start over with a computer that is on our public network.

lcudmore avatar Oct 09 '19 23:10 lcudmore

That's not going to work because your auth cookie will be tied to a domain, so you can't have a different domain for public and internal users.

I'm in a similar position, we're trialling the software internally right now. Easiest fix is to simply add a record to your internal DNS server for your domain pointing to the local/internal IP. Then your public DNS for the same domain points to the public IP. That way, the domain remains unchanged (so your cookie works) but your internal users go straight to the server on your private network, whereas public visitors are routed through your firewall.

GeekJosh avatar Oct 10 '19 12:10 GeekJosh

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Dec 09 '19 12:12 stale[bot]

I gave up getting it to work on my network in our private IP space and moved it to a public IP. Now it works fine. Not sure what the problem was.

lcudmore avatar Dec 09 '19 17:12 lcudmore

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

stale[bot] avatar Dec 09 '19 17:12 stale[bot]

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Feb 07 '20 17:02 stale[bot]

This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.

stale[bot] avatar Feb 14 '20 17:02 stale[bot]