简体   繁体   English

Google App Engine:“错误:服务器错误”,但日志中没有任何内容

[英]Google App Engine: “Error: Server Error” but nothing in the logs

I deployed an app to Google App Engine. 我将一个应用程序部署到了Google App Engine。 When I navigate to it, I get this: 当我导航到它时,得到以下信息:

Error: Server Error 错误:服务器错误

The server encountered an error and could not complete your request. 服务器遇到错误,无法完成您的请求。

If the problem persists, please report your problem and mention this error message and the query that caused it. 如果问题仍然存在,请报告您的问题并提及此错误消息以及引起该问题的查询。

All the pages do this. 所有页面都执行此操作。 appcfg.py upload_data doesn't work either. appcfg.py upload_data也不起作用。 I'm not sure why. 我不知道为什么。 Am I doing something wrong here? 我在这里做错什么了吗?

As an aside, it feels like sometimes I spend more time wrestling with GAE than I do actually writing code. 顺便说一句,感觉有时候我花很多时间在GAE上比实际编写代码花费更多的时间。 (Although it's possible that my frustration is entirely my own fault.) (尽管我的挫败感可能完全是我自己的错。)

If you build your application abject (assuming you're using the webapp microframework that comes with App Engine, since you haven't mentioned that crucial detail;-) in the following way...: 如果您以以下方式构建应用程序目标(假设您使用的是App Engine附带的webapp微框架,因为您没有提到该关键细节;-),则采用以下方式...:

application = webapp.WSGIApplication(url_to_handlers, debug=True)

the debug=True means you should be seeing a traceback in the browser for your exceptions, making debugging far easier. debug=True意味着您应该在浏览器中看到针对您的异常的回溯,从而使调试更加容易。 (The url_to_handlers is a list of pairs (url, handler) , and of course I'm assuming you've imported webapp appropriately, etc etc). url_to_handlers是对(url, handler)的列表,当然我假设您已经适当地导入了webapp等)。

Just about every framework has debugging facilities that are at least equivalent (or better, eg showing a page in which by suitable clicking you can expand nested frames and examine each frame's local variables) so this should not be hard to do whatever other framework you may be using (and it's advisable until you feel your app is really solid -- after that, once you open it up beyond a small alpha-test layer of friends, you probably don't want to bother your users with full tracebacks... though I've seen many web pages do that, in all kinds of different languages and frameworks, it's still not the best user experience;-). 几乎每个框架都具有至少等效的调试工具(或更好的调试工具,例如,显示一个页面,通过单击适当的页面,您可以扩展嵌套框架并检查每个框架的局部变量),因此,无论您使用其他任何框架都应该很容易正在使用(在您觉得自己的应用程序确实可靠之前,建议您使用它-在此之后,一旦您在一个很小的朋友的alpha测试层之外打开它,您可能就不想再对用户进行完整的追溯...尽管我已经看到许多网页可以使用各种不同的语言和框架来做到这一点,但这仍然不是最佳的用户体验;-)。

Most any exception that occurs only when deploying to production but isn't reproduced in the local SDK in strict mode means a weakness in the SDK, btw, and it's a good idea (once you know exactly what happened) to post a bug in the SDK's tracker. 大多数只有在部署到生产环境时才会发生的异常,但不会在严格模式下在本地SDK中复制,这意味着SDK会存在漏洞,顺便说一句,在您将错误发布到Windows XP中时,这是一个好主意(一旦您确切知道发生了什么) SDK的跟踪器。 (Some things that may reasonably considered exceptions to this general rule include timeout problems, since the exact performance and workload of the deployment servers at any given time are of course essentially impossible to reproduce with any accuracy on your local SDK, so the SDK basically doesn't even try;-). (某些可以合理地认为是该一般规则例外的情况包括超时问题,因为在任何给定时间部署服务器的确切性能和工作量当然基本上不可能在本地SDK上以任何精度再现,因此,SDK基本上不会甚至不尝试;-)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM