golang appengine - 文件名太长

时间:2016-08-21 11:05:43

标签: python google-app-engine go

我在GO中开发了一个appengine应用程序,现在我尝试使用androidpublisher api。为此,我需要许多依赖项,如:

  • github.com/google/google-api-go-client
  • github.com/golang/oauth2
  • google.golang.org/appengine
  • google.golang.org/appengine/urlfetch

我尝试根据https://github.com/golang/oauth2

中的示例为google-api-go-client设置oauth2身份验证

一切都很好但我不能在我的Windows开发机器上运行app-server。它抱怨文件名太长了:

INFO     2016-08-20 22:48:03,786 devappserver2.py:769] Skipping SDK update check. 
INFO     2016-08-20 22:48:03,960 api_server.py:205] Starting API server at: http://localhost:64053 
INFO     2016-08-20 22:48:03,969 dispatcher.py:197] Starting module "default" running at: http://localhost:8080 
INFO     2016-08-20 22:48:03,974 admin_server.py:116] Starting admin server at:http://localhost:8000

Exception in thread Instance Adjustment: Traceback (most recent call last):   
    File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner 
      self.run()   
    File "C:\Python27\lib\threading.py", line 754, in run 
      self.__target(*self.__args, **self.__kwargs)   
    File "C:\work\go_appengine\google\appengine\tools\devappserver2\module.py",line 1485, in _loop_adjusting_instances 
      self._adjust_instances()  
    File "C:\work\go_appengine\google\appengine\tools\devappserver2\module.py",line 1460, in _adjust_instances 
      self._add_instance(permit_warmup=True)
    File "C:\work\go_appengine\google\appengine\tools\devappserver2\module.py",line 1338, in _add_instance 
      expect_ready_request=perform_warmup)  
    File "C:\work\go_appengine\google\appengine\tools\devappserver2\go_runtime.py",line 174, in new_instance 
      if self._go_application.maybe_build(self._modified_since_last_build):  
    File "C:\work\go_appengine\google\appengine\tools\devappserver2\go_application.py",line 304, in maybe_build 
      self._extras_hash, old_extras_hash = (self._get_extras_hash(),   
    File "C:\work\go_appengine\google\appengine\tools\devappserver2\go_application.py",line 247, in _get_extras_hash gab_stdout, 
      _ = self._run_gab(gab_args, env={})   
    File "C:\work\go_appengine\google\appengine\tools\devappserver2\go_application.py",line 175, in _run_gab
      gab_extra_args, env)   
    File "C:\work\go_appengine\google\appengine\tools\devappserver2\go_application.py",line 111, in _run_gab 
      env=env)   
    File "C:\work\go_appengine\google\appengine\tools\devappserver2\safe_subprocess.py",line 74, in start_process 
      stdin=subprocess.PIPE, startupinfo=startupinfo)   
    File "C:\Python27\lib\subprocess.py", line710, in __init__  
      errread, errwrite)   
    File "C:\Python27\lib\subprocess.py", line 958, in _execute_child 
      startupinfo) 
    WindowsError: [Error 206] The filename or extension is too long

我认为我的GOPATH设置错误,因此他将所有gofiles作为go-app-builder.exe的参数。

我的项目位于C:\Users\me\project\以下,这是gopath指向的地方,当我输入时,我是站着的:

goapp.bat serve .

有人可以帮忙解决这个问题吗?谢谢。

修改

我的项目结构是这样的: 我应该如何设置我的GOPATH?

GOPATH
  $GOPATH
       app.yaml
       cron.yaml
       pkg
       src
            testapp
                 app.go
        golang.org
            x
                  oauth2

修改2

我试图将我的GOPATH移动到project-root-dir / gopath,但现在我收到此错误消息:

Exception in thread Instance Adjustment: Traceback (most recent call last):   File "C:\Python27\lib\threading.py", line 810, in
__bootstrap_inner
    self.run()   File "C:\Python27\lib\threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)   File "C:\Users\Indra\development\tools\go_appengine\google\appengine\tools\devappserver2\module.py", line 1486, in _loop_adjusting_instances
    self._adjust_instances()   File "C:\Users\Indra\development\tools\go_appengine\google\appengine\tools\devappserver2\module.py", line 1461, in _adjust_instances
    self._add_instance(permit_warmup=True)   File "C:\Users\Indra\development\tools\go_appengine\google\appengine\tools\devappserver2\module.py", line 1339, in _add_instance
    expect_ready_request=perform_warmup)   File "C:\Users\Indra\development\tools\go_appengine\google\appengine\tools\devappserver2\go_runtime.py", line 176, in new_instance
    if self._go_application.maybe_build(self._modified_since_last_build):   File "C:\Users\Indra\development\tools\go_appengine\google\appengine\tools\devappserver2\go_application.py", line 304, in maybe_build
    self._extras_hash, old_extras_hash = (self._get_extras_hash(),   File "C:\Users\Indra\development\tools\go_appengine\google\appengine\tools\devappserver2\go_application.py", line 247, in _get_extras_hash
    gab_stdout, _ = self._run_gab(gab_args, env={})   File "C:\Users\Indra\development\tools\go_appengine\google\appengine\tools\devappserver2\go_application.py", line 175, in _run_gab
    gab_extra_args, env)   File "C:\Users\Indra\development\tools\go_appengine\google\appengine\tools\devappserver2\go_application.py", line 111, in _run_gab
    env=env)   File "C:\Users\Indra\development\tools\go_appengine\google\appengine\tools\devappserver2\safe_subprocess.py", line 74, in start_process
    stdin=subprocess.PIPE, startupinfo=startupinfo)   File "C:\Python27\lib\subprocess.py", line 710, in __init__
    errread, errwrite)   File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
    startupinfo) WindowsError: [Error 87] Falscher Parameter

对于所有非德国用户,它抱怨错误的参数

1 个答案:

答案 0 :(得分:0)

我通过设置我的GOPATH解决了这个问题。

现在设置如下:

GOPATH=C:\Users\me\development\appengine\gopath;C:\Users\me\project

现在一切正常,现在上传的文件要小得多。 2MB对11MB。

感谢您的提示。