provenant-dev / origin-community

Creative Commons Attribution 4.0 International
1 stars 0 forks source link

Account cannot connect to agents due to dots `.` in the Names/Surnames/OrgNames #11

Open nkongsuwan opened 3 weeks ago

nkongsuwan commented 3 weeks ago

EDIT: I changed this issue to non-critical since the cause has been identified, and there is a simple way to avoid the issue. In summary, the input to a account registration including the name, surname, and organization name must be checked or sanitized before the account is created.

==================================== Describe the bug Multiple accounts in Origin Asia that I have created and tested became unable to connect to their agents. As a result, these accounts are locked out completely.

I believe this is related to the update on 4th October to clear the databases in Origin Asia since I had never seen this kind of error before the update.

I could not figure out the cause of these errors as they seem to appear at random. @dhh1128 hypothesized that this error occurs when too many browser windows (6 windows) are opened simultaneously. It turns out not to be the case since the same error still occurs to more of my newly created accounts even though I wasn't using them.

Here are the list of affected accounts:

*** Edit: Now all accounts that I have created are affected.

To Reproduce Unknown

Expected behavior The accounts should be able to connect to KERIA agents

Screenshots If applicable, add screenshots to help explain your problem. Screenshot 2567-11-02 at 16 08 38

Desktop (please complete the following information):

Error messages from Chrome Dev Tool

CognitoUserPool.js:1 [zustand devtools middleware] Please install/enable Redux devtools extension
(anonymous) @ CognitoUserPool.js:1
Show 1 more frame
Show less
CognitoUserPool.js:1 Processing auto-todo of type notification.auto-todo-user-onboarding-complete  {"id":"e83507db-1d00-49f5-8eef-fbdd47ada67e","description":"notification.auto-todo-user-onboarding-complete","title":"","createdAt":1730509599526,"userId":"7dc2d5f6-aa81-4cb5-8e37-6a02a934d301","channel":"AUTO_TODO","read":false}
CognitoUserPool.js:1 AUTO_TODO_HANDLER_ERROR ::  TypeError: Cannot read properties of null (reading 'identifiers')
    at d (CognitoUserPool.js:1:1)
    at P (CognitoUserPool.js:1:1)
    at Q.handleAutoTodoNotification (CognitoUserPool.js:1:1)
(anonymous) @ CognitoUserPool.js:1
Show 1 more frame
Show less
identifiers:1 [DOM] Found 2 elements with non-unique id #alias: (More info: https://goo.gl/9p2vKq) <input class=​"block w-full h-[44px]​ border px-3 py-2.5 rounded-md font-light text-sm hover:​border-neutralsAdditional800 visited:​border-neutralsAdditional800 focus-visible:​outline-none focus-visible:​border-royalBlue disabled:​text-neutralsAdditional500 disabled:​border-neutralsAdditional400 disabled:​bg-grey200 border-neutralsAdditional400 rounded-lg p-2.5 text-sm" id=​"alias" name=​"alias">​ <input class=​"block w-full h-[44px]​ border px-3 py-2.5 rounded-md font-light text-sm hover:​border-neutralsAdditional800 visited:​border-neutralsAdditional800 focus-visible:​outline-none focus-visible:​border-royalBlue disabled:​text-neutralsAdditional500 disabled:​border-neutralsAdditional400 disabled:​bg-grey200 border-neutralsAdditional400 rounded-lg p-2.5 text-sm" id=​"alias" name=​"alias">​
CognitoUserPool.js:1 

       GET https://dev.asia.origincloud.net/v1/keria/admin/agent/EL7c23esz-u6ARvfUlhbQXWYcTFJKlaFUDq9cebKuMFr 500 (Internal Server Error)
(anonymous) @ CognitoUserPool.js:1
state @ index.mjs:38
connect @ index.mjs:38
f @ CognitoUserPool.js:1
await in f
connectToAgent @ CognitoUserPool.js:1
v @ CognitoUserPool.js:1
await in v
onClick @ CognitoUserPool.js:1
eV @ react-dom.production.min.js:54
eW @ react-dom.production.min.js:54
(anonymous) @ react-dom.production.min.js:55
rn @ react-dom.production.min.js:55
rt @ react-dom.production.min.js:106
(anonymous) @ react-dom.production.min.js:117
oN @ react-dom.production.min.js:274
eF @ react-dom.production.min.js:52
ri @ react-dom.production.min.js:109
nV @ react-dom.production.min.js:74
nI @ react-dom.production.min.js:73
a @ CognitoUserPool.js:1
Show 19 more frames
Show less
CognitoUserPool.js:1 INIT_CLIENT_ERROR::: TypeError: Cannot read properties of undefined (reading 's')
(anonymous) @ CognitoUserPool.js:1
f @ CognitoUserPool.js:1
await in f
connectToAgent @ CognitoUserPool.js:1
v @ CognitoUserPool.js:1
await in v
onClick @ CognitoUserPool.js:1
eV @ react-dom.production.min.js:54
eW @ react-dom.production.min.js:54
(anonymous) @ react-dom.production.min.js:55
rn @ react-dom.production.min.js:55
rt @ react-dom.production.min.js:106
(anonymous) @ react-dom.production.min.js:117
oN @ react-dom.production.min.js:274
eF @ react-dom.production.min.js:52
ri @ react-dom.production.min.js:109
nV @ react-dom.production.min.js:74
nI @ react-dom.production.min.js:73
a @ CognitoUserPool.js:1
Show 17 more frames
Show less
connections:1 [DOM] Found 3 elements with non-unique id #alias: (More info: https://goo.gl/9p2vKq) <input class=​"block w-full h-[44px]​ border px-3 py-2.5 rounded-md font-light text-sm hover:​border-neutralsAdditional800 visited:​border-neutralsAdditional800 focus-visible:​outline-none focus-visible:​border-royalBlue disabled:​text-neutralsAdditional500 disabled:​border-neutralsAdditional400 disabled:​bg-grey200 border-neutralsAdditional400 rounded-lg p-2.5 text-sm" id=​"alias" name=​"alias">​ <select class=​"block w-full border disabled:​cursor-not-allowed disabled:​opacity-50 bg-gray-50 border-gray-300 text-gray-900 focus:​border-blue-500 focus:​ring-blue-500 dark:​border-gray-600 dark:​bg-gray-700 dark:​text-white dark:​placeholder-gray-400 dark:​focus:​border-blue-500 dark:​focus:​ring-blue-500 rounded-lg p-2.5 text-sm" id=​"alias" name=​"alias">​…​</select>​ <select class=​"block w-full border disabled:​cursor-not-allowed disabled:​opacity-50 bg-gray-50 border-gray-300 text-gray-900 focus:​border-blue-500 focus:​ring-blue-500 dark:​border-gray-600 dark:​bg-gray-700 dark:​text-white dark:​placeholder-gray-400 dark:​focus:​border-blue-500 dark:​focus:​ring-blue-500 rounded-lg p-2.5 text-sm" id=​"alias" name=​"alias">​…​</select>​
identifiers:1 [DOM] Found 2 elements with non-unique id #alias: (More info: https://goo.gl/9p2vKq) <input class=​"block w-full h-[44px]​ border px-3 py-2.5 rounded-md font-light text-sm hover:​border-neutralsAdditional800 visited:​border-neutralsAdditional800 focus-visible:​outline-none focus-visible:​border-royalBlue disabled:​text-neutralsAdditional500 disabled:​border-neutralsAdditional400 disabled:​bg-grey200 border-neutralsAdditional400 rounded-lg p-2.5 text-sm" id=​"alias" name=​"alias">​ <input class=​"block w-full h-[44px]​ border px-3 py-2.5 rounded-md font-light text-sm hover:​border-neutralsAdditional800 visited:​border-neutralsAdditional800 focus-visible:​outline-none focus-visible:​border-royalBlue disabled:​text-neutralsAdditional500 disabled:​border-neutralsAdditional400 disabled:​bg-grey200 border-neutralsAdditional400 rounded-lg p-2.5 text-sm" id=​"alias" name=​"alias">​
connections:1 [DOM] Found 3 elements with non-unique id #alias: (More info: https://goo.gl/9p2vKq) <input class=​"block w-full h-[44px]​ border px-3 py-2.5 rounded-md font-light text-sm hover:​border-neutralsAdditional800 visited:​border-neutralsAdditional800 focus-visible:​outline-none focus-visible:​border-royalBlue disabled:​text-neutralsAdditional500 disabled:​border-neutralsAdditional400 disabled:​bg-grey200 border-neutralsAdditional400 rounded-lg p-2.5 text-sm" id=​"alias" name=​"alias">​ <select class=​"block w-full border disabled:​cursor-not-allowed disabled:​opacity-50 bg-gray-50 border-gray-300 text-gray-900 focus:​border-blue-500 focus:​ring-blue-500 dark:​border-gray-600 dark:​bg-gray-700 dark:​text-white dark:​placeholder-gray-400 dark:​focus:​border-blue-500 dark:​focus:​ring-blue-500 rounded-lg p-2.5 text-sm" id=​"alias" name=​"alias">​<option value>​Identifier​</option>​slot</select>​ <select class=​"block w-full border disabled:​cursor-not-allowed disabled:​opacity-50 bg-gray-50 border-gray-300 text-gray-900 focus:​border-blue-500 focus:​ring-blue-500 dark:​border-gray-600 dark:​bg-gray-700 dark:​text-white dark:​placeholder-gray-400 dark:​focus:​border-blue-500 dark:​focus:​ring-blue-500 rounded-lg p-2.5 text-sm" id=​"alias" name=​"alias">​…​</select>​<option value>​Identifier​</option>​slot</select>​
nkongsuwan commented 3 weeks ago

I noticed another issue that may be related. When I created a new account, generate a passcode, and paste it on the "Confirm your passcode" box, I encounter An error has occurred, please try again later.

Screenshot 2567-11-03 at 17 21 46

The error of the Chrome dev tool is below.

CognitoUserPool.js:1 [zustand devtools middleware] Please install/enable Redux devtools extension
(anonymous) @ CognitoUserPool.js:1
Show 1 more frame
Show less
/v1/user-mgmt/auth/onboard:1 

       Failed to load resource: the server responded with a status of 400 ()
/v1/keria/admin/identifiers:1 

       Failed to load resource: the server responded with a status of 400 ()
CognitoUserPool.js:1 INIT_CLIENT_ERROR::: Error: HTTP POST /identifiers - 400  - {"title": "400 Bad Request", "description": "unknown witness BG6aVhGdmp-XtyvWE566MxTwAca3877ru0ni1TgBTv7c"}
(anonymous) @ CognitoUserPool.js:1
Show 1 more frame
Show less
/v1/keria/admin/identifiers/-as-user-at-origin:1 

       Failed to load resource: the server responded with a status of 404 ()
/v1/keria/admin/identifiers/-as-user-at-origin/oobis?role=agent:1 

       Failed to load resource: the server responded with a status of 404 ()
dhh1128 commented 3 weeks ago

[from twin in jira] This issue is being tracked in jira at https://eipi.atlassian.net/browse/DF-2566. To send new comments there, start them with 'Tell jira:'. The issue is assigned in jira to Cal Warshaw. As of 2024-11-04T07:23Z, the status of the issue in jira is 'to do'.

dhh1128 commented 3 weeks ago

[from twin in jira] The issue is assigned in jira to Arshdeep Singh. At 2024-11-05T09:02Z, Daniel Hardman said: Arsh has observed an interesting event in the logs that is almost certainly related to the root cause. He is investigating.

dhh1128 commented 2 weeks ago

[from twin in jira] As of 2024-11-05T16:51Z, the status of the issue in jira is 'doing'. At 2024-11-05T16:51Z, Arshdeep Singh said: This issue is occurring for these accounts because there is a {{dot}} in the org name, for example, {{enauthn.id}}, {{enauthn.dev}} The reason is that registry records stored in the {{regs}} table are keyed by the Registry Name like for the first account, one of the keys is {{enauthn.id-as-qvi-reg}}. The {{regs}} table is of type {{Komer}}, and in this type, the {{dot}} is used as a separator for combining a tuple of string keys into key bytes. When retrieving values from the database, the keys tuple is separated by splitting at this separator. Therefore, the db key for {{enauthn.id-as-qvi-reg}} becomes {{('enauthn', 'id-as-qvi-reg')}}. This causes an exception with the error {{ValueError: too many values to unpack (expected 1)}}.

We should avoid using {{dot}} in the org name or in the user’s first and last names. We will also add a validation check during onboarding to prevent the use of {{dot}} in names.

nkongsuwan commented 2 weeks ago

Tell Jira: @Arsh-Sandhu the error also occurs if either name or surname has a {{dot}}.