Generate API key via SnipeIT GUI
I am unable to generate a new token under the Personal API Keys page (https://snipeit.myserver/snipeit/account/api)
When I press create toke after entering the user I get the following error "Whoops! Something went wrong! Please try again."
"An Error has occured! Trying to get property of non-object"
I did the same through command line by php artisan passport:client --personal and again, I get an error.
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'snipeit.oauth_clients' doesn't exist (SQL: insert intooauth_clients(user_id,name,secret,re
direct,personal_access_client,password_client,revoked,updated_at,created_at) values (, test, tPAYeM2o0WeW7ZXLQHwc4ZFcT4Nn4zsnDSjfYIjU, http://local
host, 1, 0, 0, 2018-02-16 12:31:14, 2018-02-16 12:31:14))
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'snipeit.oauth_clients' doesn't exist
Any errors that appear in your browser's error console.
api:1 The SSL certificate used to load resources from https://snipeit.myserver will be distrusted in M70. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.
/snipeit/oauth/personal-access-tokens Failed to load resource: the server responded with a status of 500 (Internal Server Error)
api:1 Uncaught (in promise
Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
No, it is not as the API generation is not available in the demo
storage/logs and your webserver's logs.https://snipe-it.readme.io/docs/installation-issues#section-base-table-or-view-not-found-1146-table-oauth_clients-doesnt-exist
Thanks. But I have already created assets in the DB. The php artisan migrate command will destroy and re create everything or just the missing tables?
Thanks Again
Just missed tables.
`************
Do you really wish to run this command? (yes/no) [no]:
yes
Nothing to migrate.
`
Does that table exist?
Here you have the list of tables. oauth_clients is present. Something that I haven't mentioned is that the DB is located in a different server.
MariaDB [snipeit]> show tables;
+-------------------------------+
| Tables_in_snipeit |
+-------------------------------+
| accessories |
| accessories_users |
| action_logs |
| asset_logs |
| asset_maintenances |
| asset_uploads |
| assets |
| categories |
| checkout_requests |
| companies |
| components |
| components_assets |
| consumables |
| consumables_users |
| custom_field_custom_fieldset |
| custom_fields |
| custom_fieldsets |
| departments |
| depreciations |
| groups |
| imports |
| license_seats |
| licenses |
| locations |
| manufacturers |
| migrations |
| models |
| oauth_access_tokens |
| oauth_auth_codes |
| oauth_clients |
| oauth_personal_access_clients |
| oauth_refresh_tokens |
| password_resets |
| requested_assets |
| requests |
| settings |
| status_labels |
| suppliers |
| throttle |
| users |
| users_groups |
+-------------------------------+
I'm now able to generate API keys.
Thank you!
What did you do to resolve this?
To be honest, nothing in particular. I can't understand why, but now I am able to generate APi keys from both command line and GUI.
Sorry that I can't provide you with a better understanding of the situation. I will let you know if I discover something.
Thanks again.
Just wanted to say that I've experienced the exact same issue. The only thing I did was to log on to the database server and queried the _oauth_ tables (I could only find the personal client with the _secret_ not being in the proper token format).
Afterwards I was able to use the GUI to create the token.
Most helpful comment
To be honest, nothing in particular. I can't understand why, but now I am able to generate APi keys from both command line and GUI.
Sorry that I can't provide you with a better understanding of the situation. I will let you know if I discover something.
Thanks again.