GAE上傳專案錯誤處理 - appcfg rollback

GAE是Google Cloud Platform上的一個大服務,提供穩定且自動Scale的平台,一般操作都是透過Eclipse的外掛來開發,但是今天遇到一個上傳不上去的問題... IDE卻沒有提供操作Function可以處理(或是我沒看到@@),重開Eclipse數次未能解決...

經由log檔案提供的資訊,針對AppEngine的Command Line服務來下手.... 一般user可以在Eclipse的plugin folder的下面路徑底下找到相關的執行檔案:

    $ ~/opt/eclipse-juno-SR2/plugins/com.google.appengine.eclipse.sdkbundle_1.7.6/appengine-java-sdk-1.7.6/bin/
中間的"sdkbundle_..."要視SDK版本而定,操作時候記得將權限開放給操作者使用(ex: Mac user需要透過chmod來開放執行權限..)
處理AppEngine無法上傳之問題,錯誤:

    com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gae-project-name&version=2&  409 Conflict  Another transaction by user simonsu is already in progress for app: s~gae-project-name, version: 2. That user can undo the transaction with "appcfg rollback".
操作描述:

    $ cd ~/opt/eclipse-juno-SR2/plugins/com.google.appengine.eclipse.sdkbundle_1.7.6/appengine-java-sdk-1.7.6/bin/  $ appcfg.sh update war/  ********************************************************  There is a new version of the SDK available.  -----------  Latest SDK:  Release: 1.8.6  Timestamp: Fri Sep 27 05:18:08 CST 2013  API versions: [1.0]    -----------  Your SDK:  Release: 1.7.6  Timestamp: Sat Mar 16 09:18:56 CST 2013  API versions: [1.0]    -----------  Please visit https://developers.google.com/appengine/downloads for the latest SDK.  ********************************************************  Reading application configuration data...  十月 16, 2013 11:56:37 下午 com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml  INFO: Successfully processed war/WEB-INF/appengine-web.xml  十月 16, 2013 11:56:37 下午 com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml  INFO: Successfully processed war/WEB-INF/web.xml  Beginning server interaction for gae-project-name...  Email: [your account]  Password for [your account]:
0% Created staging directory at: '/var/folders/n3/4xxf8_pd5kl1qr4wjgt8p8600000gn/T/appcfg4648333373954393727.tmp' 5% Using java7 runtime: true 8% Scanning for jsp files. 20% Scanning files on local disk. 25% Initiating update. com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gae-project-name&version=2& 409 Conflict Another transaction by user [your account] is already in progress for app: s~gae-project-name, version: 2. That user can undo the transaction with "appcfg rollback".
Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gae-project-name&version=2& 409 Conflict Another transaction by user [your account] is already in progress for app: s~gae-project-name, version: 2. That user can undo the transaction with "appcfg rollback".
Please see the logs [/var/folders/n3/4xxf8_pd5kl1qr4wjgt8p8600000gn/T/appcfg1291090110446622014.log] for further information.
上面範例提示操作Log位置,直接檢視錯誤訊息:

    $ cat /var/folders/n3/4xxf8_pd5kl1qr4wjgt8p8600000gn/T/appcfg1291090110446622014.log  Unable to update:  com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gae-project-name&version=2&  409 Conflict  Another transaction by user [your account] is already in progress for app: s~gae-project-name, version: 2. That user can undo the transaction with "appcfg rollback".
at com.google.appengine.tools.admin.AbstractServerConnection.send1(AbstractServerConnection.java:293) at com.google.appengine.tools.admin.AbstractServerConnection.send(AbstractServerConnection.java:253) at com.google.appengine.tools.admin.AbstractServerConnection.post(AbstractServerConnection.java:232) at com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:644) at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java:449) at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:124) at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:371) at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:53) at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute(AppCfg.java:1163) at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:232) at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:109) at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:105) com.google.appengine.tools.admin.AdminException: Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gae-project-name&version=2& 409 Conflict Another transaction by user [your account] is already in progress for app: s~gae-project-name, version: 2. That user can undo the transaction with "appcfg rollback".
at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:376) at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:53) at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute(AppCfg.java:1163) at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:232) at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:109) at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:105) Caused by: com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gae-project-name&version=2& 409 Conflict Another transaction by user [your account] is already in progress for app: s~gae-project-name, version: 2. That user can undo the transaction with "appcfg rollback".
at com.google.appengine.tools.admin.AbstractServerConnection.send1(AbstractServerConnection.java:293) at com.google.appengine.tools.admin.AbstractServerConnection.send(AbstractServerConnection.java:253) at com.google.appengine.tools.admin.AbstractServerConnection.post(AbstractServerConnection.java:232) at com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:644) at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java:449) at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:124) at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:371) ... 5 more
使用rollback方式,中斷未完成的transaction...

    $ ./appcfg.sh rollback war/  Reading application configuration data...  十月 16, 2013 11:57:22 下午 com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml  INFO: Successfully processed war/WEB-INF/appengine-web.xml  十月 16, 2013 11:57:22 下午 com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml  INFO: Successfully processed war/WEB-INF/web.xml  Beginning server interaction for gae-project-name...  0% Rolling back the update.  Success.  Cleaning up temporary files...
完成後,即可重新上傳project啦!

    $ ./appcfg.sh update war/  Reading application configuration data...  十月 16, 2013 11:57:31 下午 com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml  INFO: Successfully processed war/WEB-INF/appengine-web.xml  十月 16, 2013 11:57:31 下午 com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml  INFO: Successfully processed war/WEB-INF/web.xml  Beginning server interaction for gae-project-name...  0% Created staging directory at: '/var/folders/n3/4xxf8_pd5kl1qr4wjgt8p8600000gn/T/appcfg4902577019168099900.tmp'  5% Using java7 runtime: true  8% Scanning for jsp files.  20% Scanning files on local disk.  25% Initiating update.  28% Cloning 2 static files.  31% Cloning 78 application files.  40% Uploading 4 files.  52% Uploaded 1 files.  61% Uploaded 2 files.  68% Uploaded 3 files.  73% Uploaded 4 files.  77% Initializing precompilation...  80% Sending batch containing 4 file(s) totaling 13KB.  90% Deploying new version.  95% Closing update: new version is ready to start serving.  98% Uploading index definitions.    Update completed successfully.  Success.  Cleaning up temporary files...