Web push service worker registration error - Registration failed - could not retrieve the public key ?

半城伤御伤魂 提交于 2019-12-11 04:44:13

问题


When trying to install a service worker (Chrome 55), I'm getting this error in the browser console.

Registration failed - could not retrieve the public key

But this is happening only in the browser in one of the devices. In other devices in chrome 55, it's working fine. I'm not able to replicate this issue in other devices with the same chrome version. So I suppose this is not a problem with worker or manifest files. I would be very happy somebody could throw some light on this issue.


回答1:


I got some advice from service worker discuss group regarding this error. Peter who is part of Chromium project says that

"This is the sort of error that fits in the "this should never happen" category. The only situation in which this would happen is when the on-disk GCM Key Store database got corrupted and, for some reason, cannot be recovered."

and Matt pointed me to this : https://cs.chromium.org/chromium/src/content/public/common/push_messaging_status.cc?type=cs&q=%22could+not+retrieve+the+public+key%22&sq=package:chromium&l=49

So this bug happens to be in "should never happen" category. Luckily when I restarted the machine, in which the chrome was throwing this error, the error disappeared and it started working fine.

Read more about this here : https://groups.google.com/a/chromium.org/forum/#!topic/service-worker-discuss/gCFxq4fHPVw



来源:https://stackoverflow.com/questions/41882541/web-push-service-worker-registration-error-registration-failed-could-not-ret

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!