iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
583 stars 211 forks source link

Connection from localhost to iModel is flacky #1540

Closed eap23 closed 3 years ago

eap23 commented 3 years ago

Describe the bug Successfully establishing a connection to the iModel from the online course https://itwinaccreditation.matrixlms.com/visitor_catalog_class/show/638695 is flacky. When not successful I am shown the error in the screenshot below.

To Reproduce Steps to reproduce the behavior:

  1. Running the React app from the online course using npm run start
  2. New browser window/tab opens using http://localhost:3000
  3. See error from screenshot attached below

Expected behavior Successfull connection to sample iModel as shown in screenshot below

Screenshots 210601Firefox_iTwin_ReactSample_iModelConnectionError 210528Firefox_iTwin_ReactSample_iModel

Desktop (please complete the applicable information):

pmconne commented 3 years ago

Thanks. If you see any network errors when this exception occurs, could you share them please? @williamkbentley @calebmshafer is this another case of needing to update RBAC permissions? https://github.com/imodeljs/imodeljs/discussions/1130 https://github.com/imodeljs/imodeljs/issues/1360

eap23 commented 3 years ago

This is the content of Firefox console after the error screen appears:

[HMR] Waiting for update signal from WDS... log.js:24 Download the React DevTools for a better development experience: https://fb.me/react-devtools react-dom.development.js:24994 ./node_modules/@bentley/ui-ninezone/lib/ui-ninezone/footer/Separator.scss (./node_modules/css-loader/dist/cjs.js??ref--7-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--7-oneOf-5-3!./node_modules/sass-loader/dist/cjs.js??ref--7-oneOf-5-4!./node_modules/@bentley/ui-ninezone/lib/ui-ninezone/footer/Separator.scss) Warning

(28:3) Replace fill-available to stretch, because spec had been changed webpackHotDevClient.js:138 Das Components-Objekt sollte nicht mehr verwendet werden. Es wird bald entfernt. localhost:3000 iModel.js initialized Initializer.ts:350 Error opening the iModel connection: Error: Too Many Requests IModelService.ts:75 Uncaught Error: iModels.connectionError iModels.synchronizerLink throwFatalError useErrorManager.ts:74 node_modules 0.chunk.js:265785 useErrorManager.ts:74 The above error occurred in one of your React components: in Unknown (created by IModelLoader) in IModelLoader (created by Viewer) in ErrorBoundary (created by Viewer) in Viewer (at App.tsx:109) in div (at App.tsx:99) in App (at src/index.tsx:9)

React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary. index.js:1 react-i18next:: You will need pass in an i18next instance by using initReactI18next utils.js:11 Das Components-Objekt sollte nicht mehr verwendet werden. Es wird bald entfernt. blank

Fiddler reports 429 returning response body:

{
  "statusCode": 429,
  "message": "Rate limit is exceeded. Try again in 27 seconds."
}

After closing the error message this is left in Firefox: grafik

pmconne commented 3 years ago

Error opening the iModel connection: Error: Too Many Requests IModelService.ts:75

Thanks. @laurynasr can you please provide a solution for this rate limiting?

laurynasr commented 3 years ago

This should be fixed now

eap23 commented 3 years ago

Seems working now, thanks!