如何将 appcfg.py 用于使用 google 的 eclipse 插件创建的 google-app-engine 项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2043979/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to use appcfg.py for google-app-engine projects created using google's eclipse plugin?
提问by Aadith Ramia
I have created a google-app-engine java project in Eclipse using Google's Eclipse plugin. My previous attempt to deploy failed. Now, when I retry, I get the following message:
我使用 Google 的 Eclipse 插件在 Eclipse 中创建了一个 google-app-engine java 项目。我之前的部署尝试失败了。现在,当我重试时,我收到以下消息:
Unable to update app: Error posting to URL : http://appengine.google.com/api/appversion/create?app_id=mybdaywisherversion=1409 conflict Another transaction for this user is already in progress for this app and major version. That user can undo the transaction with appcfg.py's "rollback" command.
无法更新应用程序:发布到 URL 时出错:http: //appengine.google.com/api/appversion/create?app_id = mybdaywisherversion=1409 冲突 此用户的另一笔交易已针对此应用程序和主要版本进行。该用户可以使用 appcfg.py 的“回滚”命令撤消事务。
Now, I have always used the google-app-engine features from inside Eclipse only and have not a clue how to run the appcfg.py command.
现在,我一直只在 Eclipse 内部使用 google-app-engine 功能,并且不知道如何运行 appcfg.py 命令。
Could not get much help from documentation available over the internet. The only thing I could make out was for mac (I'm on mac), the command to be used is appcfg.sh. Inside Eclipse, I looked where App-Engine SDK is located on my machine and went to that location. Even found appcfg.sh there. But when I try to run it, it only reports the error "command not found". Tried various alternatives to run it (like tried running it with sudo, tried running it as ./appcfg.sh by going to whether its located) but no success
无法从 Internet 上可用的文档中获得太多帮助。我唯一能弄清楚的是对于 mac(我在 mac 上),要使用的命令是 appcfg.sh。在 Eclipse 中,我查看了 App-Engine SDK 在我的机器上的位置并前往该位置。甚至在那里找到了 appcfg.sh。但是当我尝试运行它时,它只报告错误“找不到命令”。尝试了各种替代方法来运行它(比如尝试使用 sudo 运行它,尝试通过查看它是否位于 ./appcfg.sh 来运行它)但没有成功
Can someone please tell me the step I will have to follow to run the apcfg command?
有人可以告诉我运行 apcfg 命令必须遵循的步骤吗?
采纳答案by Aadith Ramia
Better perspective gained about the problem.
对这个问题有了更好的看法。
Documenting the problem here for the benefit of on-lookers:
为了旁观者的利益,在此处记录问题:
I was using Google's Plugin for Eclipse for a Google App Engine project. An attempt to deploy the application on app-engine server failed because of network problems. Subsequent attempts were failing because the previous attempt had created some kind of lock and that transaction had to be rolled back. The plugin does not provide any way to do this. One has to use appcfg program over command line to rollback. http://code.google.com/appengine/docs/java/tools/eclipse.htmlhas details. The problem I was facing was occuring becuase of OS level permissions on appcfg.sh. Ga ve permission to self using chmod and could get it working.
我在 Google App Engine 项目中使用了 Google 的 Eclipse 插件。由于网络问题,尝试在 app-engine 服务器上部署应用程序失败。随后的尝试都失败了,因为前一次尝试创建了某种锁,并且该事务必须回滚。该插件没有提供任何方法来做到这一点。必须通过命令行使用 appcfg 程序来回滚。http://code.google.com/appengine/docs/java/tools/eclipse.html有详细信息。我面临的问题是由于 appcfg.sh 上的操作系统级别权限而发生的。允许自己使用 chmod 并可以让它工作。
回答by aMit
As the result of an Internal Server Error during app deployment, I am now left with a pending transaction, that I need to rollback before I can deploy again.
由于应用程序部署期间的内部服务器错误,我现在有一个待处理的事务,我需要回滚才能再次部署。
Creating staging directory Scanning for jsp files. Scanning files on local disk. Initiating update. java.io.IOException: Error posting to URL: 409 Conflict Another transaction by user is already in progress for this app and major version. That user can undo the transaction with appcfg.py's "rollback" command.
创建暂存目录 扫描 jsp 文件。扫描本地磁盘上的文件。启动更新。java.io.IOException: Error Posting to URL: 409 Conflict 此应用程序和主要版本的另一个用户事务已经在进行中。该用户可以使用 appcfg.py 的“回滚”命令撤消事务。
this was how I did it (all from the command line) which is a slightly simpler method, which achieved the same effect.....
这就是我这样做的方式(全部来自命令行),这是一种稍微简单的方法,达到了相同的效果.....
C:\Documents and Settings\Amit\My Documents\newproject>"C:\Program Files\eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine-java-sdk-1.2.5\bin\appcfg" rollback war
C:\Documents and Settings\Amit\My Documents\newproject>"C:\Program Files\eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.2.5.v200909021031\appengine-java-sdk-1.2.5\bin \appcfg" 回滚War
Reading application configuration data...
正在读取应用程序配置数据...
2009-09-17 20:47:35.859::INFO: Logging to STDERR via org.mortbay.log.StdErrLog Beginning server interaction for idebanet... 0% Rolling back the update. Success. Cleaning up temporary files...
2009-09-17 20:47:35.859::INFO:通过 org.mortbay.log.StdErrLog 登录 STDERR 开始与 idebanet 进行服务器交互... 0% 回滚更新。成功。正在清理临时文件...
C:\Documents and Settings\Amit\My Documents\newproject>
C:\Documents and Settings\Amit\My Documents\newproject>
Courtesy:JOHN
礼貌:约翰
回答by John Ballinger
I dont think these answers were that helpful.
我不认为这些答案有帮助。
using the commmand line cd into you application directory. for me this is
cd /Sites/appengine_myapp
Now you have done this.
appcfg.py --no_cookies [email protected] --passin rollback ./
You should be prompted for your password.
使用命令行 cd 进入您的应用程序目录。对我来说这是
cd /Sites/appengine_myapp
现在你已经做到了。
appcfg.py --no_cookies [email protected] --passin rollback ./
应该会提示您输入密码。
回答by jbochi
Try running appcfg.py with rollback option. See the docs:
尝试使用回滚选项运行 appcfg.py。查看文档:
appcfg.py [options] rollback
Undoes a partially completed update for the given application. You can use this if an update was interrupted, and the command is reporting that the application cannot be updated due to a lock.
appcfg.py [选项] 回滚
撤消给定应用程序的部分完成更新。如果更新被中断,并且命令报告应用程序由于锁定而无法更新,您可以使用它。
回答by soheil
for mac / linux user: 1.cd /"sdkdirectory"/bin 2. chmod +x appcfg.sh 3. ./appcfg.sh -s appengine.google.com -e [email protected] rollback /Users/"...."/workspace/yourapp/war
对于 mac / linux 用户:1.cd /"sdkdirectory"/bin 2. chmod +x appcfg.sh 3../appcfg.sh -s appengine.google.com -e [email protected] rollback /Users/"。 ...”/工作区/你的应用程序/War
回答by sa_nyc
for deploying your application using command line , follow these steps:
要使用命令行部署应用程序,请执行以下步骤:
cd "/Library/Google/google_appengine"
./appcfg.py update "path-to-project/src"
you will be prompted for your email and password.
系统将提示您输入电子邮件和密码。
回答by jsaf
I was having issues to run those appcfg provided by Eclipse. I had to install Python+ App Engine sdk for python and benefit from appcfg.py functinnalities. It was on Windows though.
我在运行 Eclipse 提供的那些 appcfg 时遇到问题。我必须为 python 安装 Python+ App Engine sdk 并从 appcfg.py functinnalities 中受益。虽然它是在 Windows 上。
回答by sbarbonjr
When you are using Linux, try a solution posted in this link:
当您使用 Linux 时,请尝试此链接中发布的解决方案: