Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 'Table 'snipeit.oauth_clients' doesn't exist' on creating Database Entries #4439

Closed
2 tasks done
TheLux83 opened this issue Nov 14, 2017 · 11 comments
Closed
2 tasks done

Comments

@TheLux83
Copy link

TheLux83 commented Nov 14, 2017

Expected Behavior (or desired behavior if a feature request)

Going to the next page after Pre-Flight created all Database Entrys


Actual Behavior

Getting the following Error Messages:

(3/3) QueryException
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'snipeit.oauth_clients' doesn't exist (SQL: insert into `oauth_clients` (`user_id`, `name`, `secret`, `redirect`, `personal_access_client`, `password_client`, `revoked`, `updated_at`, `created_at`) values (, Snipe-IT Personal Access Client, yaOQTCf8Jr0xUMrvGSiAWpstJifxZV6CoCVkXYWt, http://localhost, 1, 0, 0, 2017-11-14 14:08:55, 2017-11-14 14:08:55))

(2/3) PDOException
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'snipeit.oauth_clients' doesn't exist

(1/3) PDOException
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'snipeit.oauth_clients' doesn't exist

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


Provide answers to these questions:

  • Is this a fresh install or an upgrade?
    -> Fresh
  • Version of Snipe-IT you're running
    -> Latest Docker Image
  • Version of PHP you're running
    -> The One inside the latest Docker Image
  • Version of MySQL/MariaDB you're running
    -> 5.7.20-1debian8
  • What OS and web server you're running Snipe-IT on
    -> Ubuntu Server - Docker Version 17.09.0-ce
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
    -> Docker
  • WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
    -> https://pastebin.com/dwe7KMZA (I hope it's okay to post a pastebin log, since it is a very long error message)
  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error
    -> Pre Flight Check, clicking on Create Database Tables
  • If a stacktrace is provided in the error, include that too.
  • Any errors that appear in your browser's error console.
    -> None
  • Confirm whether the error is reproduceable on the demo: https://snipeitapp.com/demo.
    -> Since the error is occuring before installation has finished, it's not possible to check this
  • Include any additional information you can find in app/storage/logs and your webserver's logs.
  • Include what you've done so far in the installation, and if you got any error messages along the way.
    -> Tried to install the Database on MariaDB and MySQLDB. Both Docker Images, but without success
  • Indicate whether or not you've manually edited any data directly in the database
    -> I didn't edit any data in the database

Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.

https://snipe-it.readme.io/docs/getting-help

@snipe
Copy link
Owner

snipe commented Nov 14, 2017

Run php artisan migrate via command line

@TheLux83
Copy link
Author

Hey @snipe
Many thanks! That did the trick. I didn't thought, that this has to be done in a freshly new installation.

@snipe
Copy link
Owner

snipe commented Nov 15, 2017

@TheLux83 the quick start should be doing that for you but we might have gotten a few things out of order. The oauth stuff is weird and a little different. We'll take a look at the quick start and make sure there's nothing something we can optimize there.

@nhatdv
Copy link

nhatdv commented Feb 26, 2018

Install snipe-IT is so bug, missing many things

@snipe
Copy link
Owner

snipe commented Feb 26, 2018

@nhatdv I assure you it's not "so bug". We deploy this every day for customers using the same code base here. If you have an specific issue, feel free to open a ticket, but the system is stable.

@arretx
Copy link

arretx commented Sep 18, 2019

Just ran into this problem as well, and running php artisan migrate inserted the tables into the database correctly.

@isjamesalive
Copy link

isjamesalive commented Nov 23, 2019

php artisan migrate fixed this particular error for me too, but I also had to run php artisan passport:install --force to get token generation going.

I was getting this exception:

2019-11-23 11:57:22] production.ERROR: ErrorException: Trying to get property of non-object in /opt/snipe-it/vendor/laravel/passport/src/ClientRepository.php:81
Stack trace:
#0 /opt/snipe-it/vendor/laravel/passport/src/ClientRepository.php(81): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Trying to get p...', '/opt/snipe-it/v...', 81, Array)
#1 /opt/snipe-it/vendor/laravel/passport/src/PersonalAccessTokenFactory.php(71): Laravel\Passport\ClientRepository->personalAccessClient()
#2 /opt/snipe-it/vendor/laravel/passport/src/HasApiTokens.php(67): Laravel\Passport\PersonalAccessTokenFactory->make(1, 'TestToken', Array)
#3 /opt/snipe-it/vendor/laravel/passport/src/Http/Controllers/PersonalAccessTokenController.php(70): App\Models\User->createToken('TestToken', Array)
#4 /opt/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(48): Laravel\Passport\Http\Controllers\PersonalAccessTokenController->store(Object(Illuminate\Http\Request))
#5 /opt/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Route.php(212): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Laravel\Passport\Http\Controllers\PersonalAccessTokenControl
ler), 'store')

This was on CentOS 7.6, Zabbix v4.7.8 - build 4170 (master) and a manual install (IIRC).

@pbrink231
Copy link

I ran into this issue on a fresh install following the directions.

Version v4.8.0 - build 4186 (master)
APP_ENV = development

Had to drop the database before running the command because it said the tables already existed when I ran php artisan migrate after getting the error on the web gui.

@MrMontesa
Copy link

Same here. Fresh install 4.9.2 on debian 10 with nginx/mariadb.
Had to run commands to make API token creation. First create the missing tables and second command generated the "Personal access client" & "Password grant client". Then I was able to create my own one.

php artisan migrate
php artisan passport:install --force

@realwuffi
Copy link

Same problem here, fresh install on 4.9.3.
When preessing the "Create database tables" button on the pre flight, I got a "Whoops, looks like something went wrong. "
After running
php artisan migrate
php artisan passport:install --force
I could setup a user.

@orientalsniper
Copy link

Same problem here, fresh install on 4.9.3.
When preessing the "Create database tables" button on the pre flight, I got a "Whoops, looks like something went wrong. "
After running
php artisan migrate
php artisan passport:install --force
I could setup a user.

I had to run those commands as well in my fresh install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants