cancel
Showing results for 
Search instead for 
Did you mean: 

third party integrations and oauth table

SOLVED

third party integrations and oauth table

I've tried to connection my installation of Magento CE 2.2.4 to several services like ShipStation or Zapier. I keep getting the following error (this one is provided by zapier) or something like it. I'm not sure where to start with this. I'm very new to magento and am mostly learning as I go. 

 

authentication failed: The app returned "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'palousefrombackup.oauth_token_request_log' doesn't exist, query was: SELECT `oauth_token_request_log`.`failures_count` FROM `oauth_token_request_log` WHERE (user_name = :user_name AND user_ty...". It looks like the server for your connected app is down or currently experiencing problems. Please check the app's status page or contact support if there are no reported issues. We made a request to palouseherbs.com and received (500) Internal Server Error. SQLSTATE[42S02]: Base table or view not found: 1146 Table 'palousefrombackup.oauth_token_request_log' doesn't exist, query was: SELECT `oauth_token_request_log`.`failures_count` FROM `oauth_token_request_log` WHERE (user_name = :user_name AND user_type = :user_type)

 

If I can get pointed in a general direction I would appreciate it. I can't seem to find anyone else facing the same problem. 

 

Thanks

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: third party integrations and oauth table

Hi @laurarose 

 

It seems 'palousefrombackup.oauth_token_request_log'  this table is not existed in your database that is why it's throwing this error. So to resolve this you need to import this table in your database. If this table is created by custom module then you need to check why it's not created this is the only way to resolve this issue.

 

If my answer is useful, please Accept as Solution & give Kudos
Shubham Khandelwal 

View solution in original post

Re: third party integrations and oauth table

Hi @laurarose 

 

By default in Magento 2 this table should be there in Database. But if it is not there you can create table by running below query.

 

CREATE TABLE IF NOT EXISTS `oauth_token_request_log` (
  `log_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Log Id',
  `user_name` varchar(255) NOT NULL COMMENT 'Customer email or admin login',
  `user_type` smallint(5) UNSIGNED NOT NULL COMMENT 'User type (admin or customer)',
  `failures_count` smallint(5) UNSIGNED DEFAULT '0' COMMENT 'Number of failed authentication attempts in a row',
  `lock_expires_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Lock expiration time',
  PRIMARY KEY (`log_id`),
  UNIQUE KEY `OAUTH_TOKEN_REQUEST_LOG_USER_NAME_USER_TYPE` (`user_name`,`user_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Log of token request authentication failures.';

And also you can check the oauth based authentication guide for validate your code. Here is the study guide link.

 

Thanks

--
If my answer is useful, please Accept as Solution & give Kudos

View solution in original post

3 REPLIES 3

Re: third party integrations and oauth table

Hi @laurarose 

 

It seems 'palousefrombackup.oauth_token_request_log'  this table is not existed in your database that is why it's throwing this error. So to resolve this you need to import this table in your database. If this table is created by custom module then you need to check why it's not created this is the only way to resolve this issue.

 

If my answer is useful, please Accept as Solution & give Kudos
Shubham Khandelwal 

Re: third party integrations and oauth table

Hi @laurarose 

 

By default in Magento 2 this table should be there in Database. But if it is not there you can create table by running below query.

 

CREATE TABLE IF NOT EXISTS `oauth_token_request_log` (
  `log_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Log Id',
  `user_name` varchar(255) NOT NULL COMMENT 'Customer email or admin login',
  `user_type` smallint(5) UNSIGNED NOT NULL COMMENT 'User type (admin or customer)',
  `failures_count` smallint(5) UNSIGNED DEFAULT '0' COMMENT 'Number of failed authentication attempts in a row',
  `lock_expires_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Lock expiration time',
  PRIMARY KEY (`log_id`),
  UNIQUE KEY `OAUTH_TOKEN_REQUEST_LOG_USER_NAME_USER_TYPE` (`user_name`,`user_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Log of token request authentication failures.';

And also you can check the oauth based authentication guide for validate your code. Here is the study guide link.

 

Thanks

--
If my answer is useful, please Accept as Solution & give Kudos

Re: third party integrations and oauth table

Thank you very much. I was able to fix the issue with both your answers. I greatly appreciate it. I will certainly save this query in case a similar issue comes up again. 

 

I hired a developer previously and I've been cleaning up some issues since. Thank you.