decidim / decidim

The participatory democracy framework. A generator and multiple gems made with Ruby on Rails
https://decidim.org/
GNU Affero General Public License v3.0
1.48k stars 405 forks source link

Unexpected token k JS exception during Key Ceremony #9120

Closed andreslucena closed 1 year ago

andreslucena commented 2 years ago

Ref. V-SIM.05

Describe the bug

At the time of the Key Ceremony, some trustees have not been able to complete the Ceremony. Both in the component of the Administration Dashboard and in the Trustee Zone of 'My Account', the process is paralyzed for no apparent reason.

To Reproduce

Steps to reproduce the behavior:

  1. Setup BB, Decidim, a Process, an Election, start key ceremony
  2. Sign in as the two Trustees
  3. Click on Start button to start the key ceremony
  4. See that nothing happens.

Expected behavior

This has two problems:

  1. I want to be able to start the key ceremony (of course)
  2. On the cases where it doesn't finish the process because it's giving an error during the key generation, I need to see an error message with the traceback and the contact/support information, so I can report it.

Screenshots

Stacktrace

elections:1 Uncaught (in promise) SyntaxError: Unexpected token k in JSON at position 0 at JSON.parse () at JWKStore.value (keystore.js:291:1) at Object.push../node_modules/node-jose/lib/jwk/keystore.js.JWKStore.asKey (keystore.js:692:1) at MessageParser.loadKey (message-parser.js:95:1) at MessageParser.parseCreateElection (message-parser.js:76:1) at MessageParser.parse (message-parser.js:54:1) at async Trustee.processNextLogEntry (trustee.js:205:1) at async Trustee.setupKeyCeremony (trustee.js:79:1) at async HTMLButtonElement. (key-ceremony.component.js:83:1)

Extra data (please complete the following information):

ahukkanen commented 2 years ago

I tried this in Chrome along with https://github.com/decidim/decidim-bulletin-board/pull/251 so that each trustee ceremony was in their own Chrome window.

You can start a "blank" chrome with the following command:

$ google-chrome --user-data-dir=/tmp/user1

This way I did not receive any errors during the key ceremony but I'm not sure if there is something I'm doing differently.

andreslucena commented 2 years ago

Oh if it works in your machine then it's probably some misconfiguration in my environment.

I don't think it's something with the different profiles mixing up, in the original report I was using two different browsers for every trustee (Chrome and Chromium).

This is also happening with Firefox Multi-Account Containers or even with only one Trustee with only one browser in a clean profile (using the command $ google-chrome --user-data-dir=/tmp/user1). On this other cases, I still see this same JS exception.

andreslucena commented 1 year ago

As we've talked with @paarals and @microstudi, with the latest update of bulletin board ( #11711) this should be fixed, so I'm closing this issue.