英文:
LookupHost in Google App Engine errors
问题
我已经尝试了以下代码:
addresses, error := net.LookupHost("google.com")
在普通的Go环境和Google App Engine SDK中,它通常可以正常工作。
然而,在生产环境的GAE实例中,它会产生以下错误:
error reading DNS config: open /etc/resolv.conf: operation not permitted
这个问题会被修复吗?是否有解决方法?我能否在app.yaml
配置中进行任何更改?
英文:
I've tried the following code:
addresses, error := net.LookupHost("google.com")
in regular Go and in the Google App Engine SDK, and it generally works fine.
However in a production GAE instance, it produces the following error:
error reading DNS config: open /etc/resolv.conf: operation not permitted
Will this be fixed, is there a workaround, can I change anything in the app.yaml
configuration etc.?
答案1
得分: 4
你需要使用AppEngine API:
请注意,你还需要一个上下文(context)。
英文:
You'll need to use the AppEngine API:
Note you'll need a context there as well.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论