Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RELAY-NETWORK]-errors in console after login as an SSO-user in a coral stream. #2639

Open
felixdro opened this issue Oct 15, 2019 · 4 comments
Labels
bug

Comments

@felixdro
Copy link

@felixdro felixdro commented Oct 15, 2019

Hi! We are looking forward to add coral to our articles but I wonder about this first, if we can do something about it or if it's fine to ignore maybe?

When integrating a coral v. 5 stream on our article pages with a logged in user via our member portal we get the same error messages in the console, and the messages keep on adding up after a while.

We have followed the recommended settings to integrate with coral SSO and can log in and write comments without any problems, but I wonder about the console messages?

[RELAY-NETWORK] The user aborted a request.                          retry.js:89 
[RELAY-NETWORK] will retry in 1600 milliseconds                         retry.js:90
[RELAY-NETWORK] Unexpected token u in JSON at position 0     retry.js:89 
[RELAY-NETWORK] will retry in 3200 milliseconds                          retry.js:90
[RELAY-NETWORK] Unexpected token u in JSON at position 0      retry.js:89 
[RELAY-NETWORK] will retry in 6400 milliseconds                          retry.js:90
[RELAY-NETWORK] Unexpected token u in JSON at position 0     retry.js:89 
.....

The retry.js points to this file in sources panel:
/assets/node_modules/react-relay-network-modern/es/middlewares/retry.js

async function makeRetriableRequest(o, delay = 0, attempt = 0, lastError = null) {
  const makeRetry = async prevError => {
    const retryDelay = o.retryAfterMs(attempt);

    if (retryDelay) {
      o.logger(prevError.message);    <--- Line 89
      o.logger(`will retry in ${retryDelay} milliseconds`);
      return makeRetriableRequest(o, retryDelay, attempt + 1, prevError);
    }

    throw prevError;
  };
 ......

I have tried to disable live updates and changed logging levels but the messages wont disappear. If I login with a regular coral email user the errors won't show, only with the SSO user.

Current SSO setup
Algorithm HS256
Signing secret contained from coral admin (and also set as env)
Payload structure

{
  "user": {
    "id": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "email": "my_email@gmail.com",
    "username": "My_Name"
  },
  "iat": 1570538497,
  "exp": 3141080594,
  "jti": "9b1bd2c0-8f01-4df4-9f5b-f172130aa469"
}

Example JWT:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoieHh4eHh4eC14eHh4LXh4eHgteHh4eC14eHh4eHh4eHh4eHgiLCJlbWFpbCI6Im15X2VtYWlsQGdtYWlsLmNvbSIsInVzZXJuYW1lIjoiTXlfTmFtZSJ9LCJpYXQiOjE1NzA1Mzg0OTcsImV4cCI6MzE0MTA4MDU5NCwianRpIjoiOWIxYmQyYzAtOGYwMS00ZGY0LTlmNWItZjE3MjEzMGFhNDY5In0.7EHc1XDjRUkU5mclkdpHRuQ2f0TBqohG_scX2q6bM04

Screenshot from 2019-10-15 17-09-02

Expected behavior:
When logging in as an SSO user it should not display these messages in the console.

Actual behavior:
When logging in as an SSO user the same error messages keep on showing.

Versions:

  • NodeJS: 10.16.3
  • NPM: 6.9
  • MongoDB: 4.2
  • Redis: 3.2
  • Browser: Google chrome
  • OS: Server Linux, client: different
@felixdro felixdro added the bug label Oct 15, 2019
@kgardnr kgardnr removed the hacktoberfest label Nov 7, 2019
@kgardnr

This comment has been minimized.

Copy link
Member

@kgardnr kgardnr commented Nov 7, 2019

Hey @felixdro are you still having this issue?

@felixdro

This comment has been minimized.

Copy link
Author

@felixdro felixdro commented Nov 8, 2019

Hi @kgardnr, yes every time a stream is opened on the article with a logged in user via SSO these errors occurs in the console. But if I log in as a regular coral user via email + password no errors occur.

We are running 5.2.0 of Coral now. I wanted to try 5.2.2 and have pulled the latest files from the master branch but this version won't build for me, I get typescript compilation errors. (Will post a separate bug issue on this now.)

@kgardnr

This comment has been minimized.

Copy link
Member

@kgardnr kgardnr commented Nov 8, 2019

Hey @felixdro it's hard to say because we don't have insight into your SSO setup. The problem would most certainly lie there.

In regards to using master, we'd recommend against that and advise only to use official releases, which have been tested for production use.

@felixdro

This comment has been minimized.

Copy link
Author

@felixdro felixdro commented Nov 14, 2019

Hi,

I updated our Coral instance to the 5.3.0 release today, the SSO-login still works but we still get the [Relay-network] errors unfortunately. We have followed the instructions on docs.coralproject.net/coral/v5/integrating/sso and signed the jwt token with the KEY from the admin page. Not sure what to do different or how to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.