dsoxcj7276 2016-08-21 11:05
浏览 81
已采纳

golang appengine-文件名太长

I developed an appengine application in GO and now I tried to use the androidpublisher api. For this I need many dependencies like:

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

I tried to setup oauth2 authentication for google-api-go-client according to the example in https://github.com/golang/oauth2

Everything looks fine but I can't run the app-server anymore on my windows development machine. It complains about too long filenames:

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

I think my GOPATH is set up wrong so he gives all gofiles as argument to go-app-builder.exe.

My project is under C:\Users\me\project\ that's where the gopath points to and were I'm standing when I type:

goapp.bat serve .

Can someone help to fix this problem? Thank you.

EDIT

My project structure is like this: How should i set my GOPATH?

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

Edit 2

I tried to move my GOPATH to project-root-dir/gopath but now i get this error message:

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

for all non german users it complains about a wrong parameter

  • 写回答

1条回答 默认 最新

  • dongtuji0992 2016-08-24 20:31
    关注

    I solved the problem by setting my GOPATH.

    It's set now like this:

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

    Now everything works find and the uploaded file is much smaller now. 2MB vs. 11MB.

    Thanks for the tip.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 编写程序,使用XPath爬取模拟图书网站的数据
  • ¥15 安卓13,动态广播无法接受
  • ¥50 docker运行容器端口如何映射(不重启服务、不重建容器)
  • ¥30 使用XPath爬取模拟图书馆网站的数据
  • ¥50 基于TwinCAT3实现力传感器的实时读取
  • ¥20 python求解八元一次不定方程,无数解中随机输出几组即可(相关搜索:用python)
  • ¥50 libreoffice导出PPTX到PDF中的错误换行问题
  • ¥15 python实现网页视频下载
  • ¥15 如何通过深度图获得物体的完整、正确点云?
  • ¥15 有没有操作系统适用白丁的经典的书籍,如何解决?(标签-学习)