IOException while requesting key: Invalid device key response

僤鯓⒐⒋嵵緔 提交于 2020-01-02 01:25:11

问题


I'm using a Pi 3 with google IOT to operate some relays that control valves on an irrigation system. The system uses the internet to get a weather forecast to work how much water to use, and uses NanoHTTPD to provide a UI.

It's running nicely, but occasionally I get an error which stops the whole thing. From the log files:

05-04 05:26:14.677 737-1077/com.google.android.gms.persistent W/Conscrypt: Could not set socket write timeout:
05-04 05:26:14.678 737-1077/com.google.android.gms.persistent W/Conscrypt:    java.lang.reflect.Method.invoke(Native Method)
       com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms@11973330:13)
05-04 05:26:14.798 737-1077/com.google.android.gms.persistent W/Conscrypt: Could not set socket write timeout:
05-04 05:26:14.799 737-1077/com.google.android.gms.persistent W/Conscrypt:    java.lang.reflect.Method.invoke(Native Method)
       com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms@11973330:13)
05-04 05:26:14.914 737-1077/com.google.android.gms.persistent W/GLSUser: [AppCertManager] IOException while requesting key: 
    java.io.IOException: Invalid device key response.
        at fmk.a(:com.google.android.gms@11973330:12)
        at fmk.a(:com.google.android.gms@11973330:64)
        at fmi.a(:com.google.android.gms@11973330:8)
        at fme.a(:com.google.android.gms@11973330:1)
        at fmd.a(:com.google.android.gms@11973330:10)
        at com.google.android.gms.auth.account.be.legacy.AuthCronChimeraService.b(:com.google.android.gms@11973330:7)
        at ers.call(:com.google.android.gms@11973330:3)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at kfr.run(:com.google.android.gms@11973330:26)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at kku.run(Unknown Source:7)
        at java.lang.Thread.run(Thread.java:764)

I'd appreciate some hint on how to stop this from happening.

Thanks.


回答1:


Simple. This means that the key on the Google Console that is associated with the IOT service is not matching the one stored locally on your Mac/Pi 3.

Just run: keytool -list -v -keystore <your keystore> -storepass <your store password> and copy the key under SHA1 or SHA256 to the Google Console.

You can create a keystore if none is present by keytool -genkeypair.

For other useful commands run keytool -h.



来源:https://stackoverflow.com/questions/50168155/ioexception-while-requesting-key-invalid-device-key-response

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