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

Error: Failed to wait for "webview:tutanota" service provider initialization #77

Closed
nil0x42 opened this issue Nov 29, 2018 · 18 comments
Closed

Comments

@nil0x42
Copy link

nil0x42 commented Nov 29, 2018

version: v2.0.0-beta.7
os: debian-9

Issue:

None of my e-mails (protonmail & tutanota) are automatically logged-in, the homepage of each e-mail opens and stays at the login page.

NOTE: if i restart the app enough times, it ends-up working (logging-in) on most e-mails.
I suspect something related to socket or request timeouts, as my network is slow, and i have many e-mails configured.

I don't even know if the error log i am reporting is directly related to this.


[2018-11-29 13:23:18.207] [error] [WEB] [reducers/errors] <[account.component][9]> Error: Failed to wait for "webview:tutanota" service provider initialization
    at n.from.a.pipe.r.retryWhen.e (file:///opt/email-securely-app/resources/app.asar/app/web/app.js?97414c93f748c6dbb6db:1:7640)
    at i (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1034:448)
    at e.error (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1289:28741)
    at file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1381:82688
    at t.invoke (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1388:7001)
    at Object.onInvoke (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:625:1087)
    at t.invoke (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1388:6941)
    at e.run (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1388:2171)
    at file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1381:82666
    at t.invokeTask (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1388:7685)
@nil0x42
Copy link
Author

nil0x42 commented Nov 29, 2018

Just to test, i tried to remove all tutanota accounts and keep only the protonmails, as a result, i have now a protonmail related error:
Error: Failed to wait for "webview:protonmail" service provider initialization


[2018-11-29 13:13:35.497] [error] [WEB] [reducers/errors] <[account.component][4]> Error: Failed to wait for "webview:protonmail" service provider initialization
    at n.from.a.pipe.r.retryWhen.e (file:///opt/email-securely-app/resources/app.asar/app/web/app.js?97414c93f748c6dbb6db:1:7640)
    at i (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1034:448)
    at e.error (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1289:28741)
    at file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1381:82688
    at t.invoke (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1388:7001)
    at Object.onInvoke (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:625:1087)
    at t.invoke (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1388:6941)
    at e.run (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1388:2171)
    at file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1381:82666
    at t.invokeTask (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?97414c93f748c6dbb6db:1388:7685)

@vladimiry
Copy link
Owner

Is there an error if you run the app with just one account added? I think if you add the account, wait for web stuff loading, then remove it and add again it might start working (sinc web stuff will be cached already), but only until app restart (due to the cache reset, see below) 😄

I just tried to run the app with 5 accounts added. No issues even having enabled local store feature for all of them. But my network doesn't suck much. So it's highly likely due to the slow network and relatively small timeout.

The current timeout for this action is set to 10 seconds. So I think I just need to make this timeout configurable like I recently did with messages fetching action. Besides, it won't hurt to set the default timeout to 20-30 seconds.

Worth mentioning that app resets all the caches before start and after the logout which means it loads the webclient code from the internet every time you start it and this can be a relatively huge portion of data (3MB for protonmail).

Also in your case issue might be gone without any fixes when app will get the webclient built-in as there will be no need to load web stuff from the internet.

@vladimiry
Copy link
Owner

@nil0x42 can you try v2.0.0-beta.8 version? It enables the built-in protonmail's web client which might be a solution for your issue with slow network. Besides the timeout, this issue is about is now configurable, adjust the timeouts.webViewApiPing value in your config.json in case if you still get the original timeout error occuring (app restart is needed). First v2.0.0-beta.8 version start will add the default timeouts.webViewApiPing value to your config.json if it's not yet there.

@nil0x42
Copy link
Author

nil0x42 commented Dec 2, 2018

Hi! I just tried beta8, and after playing a while with webViewApiPing & maxInInterval i had mo more problems with protonmail. However, tutanota doesn't connects anymore:

[2018-12-02 14:24:50.546] [error] [WEB] [reducers/errors] <[account.component][9]> { message:
   'Failed to resolve some DOM elements from the list [username] within "10000" milliseconds',
  name: 'Error' }

(account[9] is my only tutanota account here)

@vladimiry
Copy link
Owner

maxInInterval only affects the fetching logic, ie the local store feature. Can you rename your settings folder for a while and then run the app with just one tutanota account added?

@nil0x42
Copy link
Author

nil0x42 commented Dec 3, 2018

With only 1 tutanota account set, and no protonmails at all, the client logs-in correctly.

@vladimiry
Copy link
Owner

Any chance to try the app on a fast network? 😄

Looks like I need to make DOM elements resolving timeout configurable too, and increase the default value.

@vladimiry
Copy link
Owner

The default DOM elements resolve timeout got increased from 10 to 20 seconds with beta 9 build. Besides you can configure it, see timeouts.domElementsResolving value in your config.json file. Does it still fail?

@nil0x42
Copy link
Author

nil0x42 commented Dec 4, 2018

Hi ! I created a fresh config directory and re-added my accounts to test beta9.
I no longer have the errors i had before:
Error: Failed to wait for "webview:protonmail" service provider initialization
and
Failed to resolve some DOM elements from the list [username] within "10000" milliseconds

But instead, i have a new kind of error that i never saw before:

[2018-12-04 15:13:52.261] [error] [WEB] [reducers/errors] <[account.component][11]> Error: Invocation timeout of "login" method on "email-securely-app:webview-api" channel
    at file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1381:82598
    at t.invokeTask (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1388:7685)
    at Object.onInvokeTask (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:625:999)
    at t.invokeTask (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1388:7606)
    at Object.onInvokeTask (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1388:4658)
    at t.invokeTask (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1388:7606)
    at e.runTask (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1388:2865)
    at e.invokeTask (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1388:8799)
    at i.useG.invoke (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1388:8690)
    at n.args.(anonymous function) (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1419:141)

@nil0x42
Copy link
Author

nil0x42 commented Dec 4, 2018

Edit:
finally the old error just happened:

[2018-12-04 15:21:22.973] [error] [WEB] [reducers/errors] <[account.component][5]> Error: Failed to wait for "webview:protonmail" service provider initialization
    at i.from.r.pipe.n.retryWhen.o (file:///opt/email-securely-app/resources/app.asar/app/web/app.js?759c0dcb9128b3f74d11:1:8358)
    at i (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1034:448)
    at e.error (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1289:28746)
    at file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1381:82689
    at t.invoke (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1388:7001)
    at Object.onInvoke (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:625:1087)
    at t.invoke (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1388:6941)
    at e.run (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1388:2171)
    at file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1381:82667
    at t.invokeTask (file:///opt/email-securely-app/resources/app.asar/app/web/vendors~app.js?759c0dcb9128b3f74d11:1388:7685)

@vladimiry
Copy link
Owner

vladimiry commented Dec 4, 2018

Error: Failed to wait for "webview:protonmail" service provider initialization

I believe this error can be solved by increasing timeouts.webViewApiPing value, in the config.json file.

Invocation timeout of "login" method on "email-securely-app:webview-api" channel

The timeout of this action is not yet configurable, going to handle this. Besides throwing such error messages I better add timeout value used.

@nil0x42
Copy link
Author

nil0x42 commented Dec 4, 2018

The timeout of this action is not yet configurable, going to handle this. Besides throwing such error messages I better add timeout value used.

I agree, it would be wonderful

@nil0x42
Copy link
Author

nil0x42 commented Dec 4, 2018

I wanted to propose a feature that will probably fix a lot of login errors: delayed log-in.

When i use only one account, it logs-in without issues. The login problems occur when more than 5 accounts are set, probably due to traffic congestion for slow networks, because everything is loaded at the same time, when i start the application.

If i could configure email-securely-app to connect to each account one by one, or setting a timer for accounts, it might fix most log-in issues

@vladimiry
Copy link
Owner

Good idea. That should be helpful in case of slow network and many accounts with online web client use added, as yes currently app performs almost all the actions concurrently (except database saving, and for now messages fetch logic). So putting initial page loading action to queue making the automatic login value filling the queued action end mark. In this case, I can decrease the default webViewApiPing timeout value. There should also be no problems if you use only the built-in web clients, but it's not yet available for Tutanota and Protonmail's Tor domain.

@vladimiry
Copy link
Owner

@nil0x42, the default API calls timeout is now configurable, see timeouts.defaultApiCall value, defaults to 25sec (was hardcoded as 15sec before). Can you try the update beta9 build?

I believe the issue is supposed to be resolvable with help of timeouts.defaultApiCall and timeouts.webViewApiPing timeouts combination, but will keep the proposal to perform login sequentially on my radar.

@nil0x42
Copy link
Author

nil0x42 commented Dec 6, 2018

Hi ! i tried with several timeouts, until i tried 300.000 ms. There is one kind of weird error i have since several weeks but i forgot to report them to you. It is about a lot of 400/401 http errors. probably due to the frequency of protonmail api calls.
So my e-mails are still partially connecting

So this is a trace of my most recent session (with the most recent beta9), but i also had these 400/401 errors before.

NOTE: event IDs have been replaced by <EVENT_ID>

Editer by @vladimiry: moved your log to the attchment.

log.txt

@vladimiry
Copy link
Owner

vladimiry commented Dec 6, 2018

It is about a lot of 400/401 http errors. probably due to the frequency of protonmail api calls.

The desktop app doesn't initiate those requests, but Protonmail's WebClient does. The app just logs the HTTP requests errors, so you know something bad happened. Besides such weird things never happened to me. I guess there might something wrong with your setup/network/tor specifics/etc.

Let's close the issue if the original timeouts problem got fixed for you with the recent release.

@vladimiry
Copy link
Owner

Closing as resolved. Feel free to reach me out in case the origins issue reappears and you can't solve it configuring the timeouts. In general, I think your case is not very representative due to seeming to be unusual network setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants