duandao1931 2018-04-12 17:17
浏览 69
已采纳

InvalidAppConfigError:重复的模块:my-service

My computer (Windows 10) hosting my VM (Ubuntu 16.04) restarted last night (because Windows is a jerk) and now I can't seem to run my service locally. This was running fine yesterday and I haven't changed a single line of code. Only thing that happened was the reboot.

I am running dev_appserver.py ./ app.yaml.

My app.yaml file:

runtime: go
api_version: go1
service: my-service

handlers:
- url: /.*
  script: _go_app

#[START env_variables]
env_variables:
 GCLOUD_STORAGE_BUCKET: my-cloud-bucket
#[END env_variables]

and the error I get is:

Traceback (most recent call last):
  File "/usr/lib/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 103, in <module>
    _run_file(__file__, globals())
  File "/usr/lib/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 97, in _run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 350, in <module>
    main()
  File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 338, in main
    dev_server.start(options)
  File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 94, in start
    env_variables=parsed_env_variables)
  File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 953, in __init__
    module.module_name)
google.appengine.tools.devappserver2.errors.InvalidAppConfigError: Duplicate >module: my-service

Any advice?

  • 写回答

1条回答 默认 最新

  • duanpin9531 2018-04-12 17:26
    关注

    You shouldn't need to specify both the application directory (./ in your case) and the app.yaml simultaneously. From Running the local development server:

    Specify the directory path to your app, for example:

    dev_appserver.py [PATH_TO_YOUR_APP]
    

    Alternatively, you can specify the configuration file of a specific service, for example:

    dev_appserver.py app.yaml
    

    Most likely the server detects the app.yaml from the directory specification and then gets it again from the app.yaml specification, leading to the duplicate service error.

    I'd simply drop the ./ directory specification from the command line (I'd rather not rely on the auto-detection, which can fail miserably for multi-service apps).

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

报告相同问题?

悬赏问题

  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3