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个回答



您无需同时指定两者</ strong>应用程序目录( ./ </ code> (根据您的情况)和</ strong> app.yaml </ code>。 来自运行本地开发服务器 :</ p>


指定应用程序的目录路径,例如:</ p>

  dev_appserver.py [PATH_TO_YOUR_APP] 
</ code> </ pre>

或者,您可以指定特定
服务的配置文件,例如:</ p>

  dev_appserver.py  app.yaml 
</ code> </ pre>
</ blockquote>

服务器很可能从目录规范中检测到 app.yaml </ code>然后将其获取 再次从 app.yaml </ code>规范中删除,导致重复服务错误。</ p>

我只需删除 ./ </ code>目录规范 从命令行(我宁愿不依赖自动检测,对于多服务应用程序,自动检测可能会失败)。</ p>
</ div>

展开原文

原文

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).

duan02468
duan02468 哦,我多么愚蠢。 重新启动并没有保存我的用户历史记录,因此我从内存中键入了命令(显然做得很糟糕!)谢谢,您让我头疼不已。
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐