問題描述
我們已經(jīng)在分布式架構(gòu)中實(shí)現(xiàn)了 WSO2 API Manager (v1.10.0),如在線文檔中所述
我試過谷歌搜索這個(gè),但找不到最新的答案.
我尚未將密鑰管理器配置為具有主節(jié)點(diǎn)和工作節(jié)點(diǎn)(如此處),因?yàn)槲臋n似乎表明不需要這樣做.
如有任何幫助,將不勝感激!
我使用 mysql 并面臨同樣的問題.更改池大小也不是一個(gè)完整的解決方案.然后我注意到 idn_oauth2_access_token 表有些奇怪.有一列time_created,但內(nèi)容不是創(chuàng)建的時(shí)間.這是最后一次更新時(shí)間戳.我在 time_created 列中的幾列上讀到了系統(tǒng)命令.我檢查了我的 sql 腳本,看到數(shù)據(jù)庫(kù)在觸發(fā)更新時(shí)更新了此列.我刪除了這個(gè)規(guī)則,我沒有更多的錯(cuò)誤.
We have implemented WSO2 API Manager (v1.10.0) in a distributed architecture as outlined in the online documentation here.
This consists of the following (on 5 separate servers):
- Gateway (x2)
- Publisher & Store (on a single server)
- Key Manager (x2)
These are wired-up to the 3 normal API Manager databases (Registry, User Manager & API Manager), which are on a SQL Server 2014 instance.
We are using the Key Managers for the authentication (login, forgotten password, etc.) of the website users, as well as for authenticating API calls.
However, when trying to log in to the site I'm seeing the following (Violation of UNIQUE KEY constraint) error on the Key Manager:
TID: [-1] [] [2016-10-06 00:36:47,842] ERROR {org.wso2.carbon.identity.oauth2.dao.TokenPersistenceTask} - Error occurred while persisting access token :c5a0a11e63388dCHANGEDea34b0533445 {org.wso2.carbon.identity.oauth2.dao.TokenPersistenceTask} org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception: Error when storing the access token for consumer key : fpA6AhOfbVCHANGEDgH0WzBDOga at org.wso2.carbon.identity.oauth2.dao.TokenMgtDAO.storeAccessToken(TokenMgtDAO.java:246) at org.wso2.carbon.identity.oauth2.dao.TokenMgtDAO.persistAccessToken(TokenMgtDAO.java:284) at org.wso2.carbon.identity.oauth2.dao.TokenPersistenceTask.run(TokenPersistenceTask.java:52) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of UNIQUE KEY constraint 'CON_APP_KEY'. Cannot insert duplicate key in object 'dbo.IDN_OAUTH2_ACCESS_TOKEN'. The duplicate key value is (15, williams.j2@CHANGED.org.uk, -1234, , APPLICATION_USER, 369db21a386ae4CHANGED0ff34d35708d, ACTIVE, NONE). at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(SQLServerPreparedStatement.java:332) at org.wso2.carbon.identity.oauth2.dao.TokenMgtDAO.storeAccessToken(TokenMgtDAO.java:224) ... 5 more
This is resulting in the following .NET error on the website:
I've tried Googling this, but cannot find an up-to-date answer.
I have not configured the Key Managers to have master and worked nodes (as outlined here) as the documentation seems to suggest that this isn't needed.
Any help would be much appreciated please!
I use mysql and was facing the same problem. Changing the poolsize was also not a full solution. Then I noticed something strange about the idn_oauth2_access_token table. There is a column time_created, but the contents was not the time created. It was the last update timestamp. I read somewhere the systems orders on several columns among the time_created column. I inspected my sql script and saw that the database updated this column when a update was fired. I removed this rule and I have no more errors.
這篇關(guān)于WSO2 API Manager 身份驗(yàn)證違反 UNIQUE KEY 約束錯(cuò)誤的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!