イケてる SaaS を作りたい (koni blog)

SNS管理ツール「SocialDog」を運営する株式会社AutoScale代表 小西将史のブログです。イケてるSaaSを目指して日々奮闘しています。

GAEのローカルサーバーが起動できない時の対処法

GAEのローカルサーバー dev_appserver.py を起動しようとしたらエラーが出た。

$ dev_appserver.py .
INFO     2016-04-01 03:16:14,707 sdk_update_checker.py:229] Checking for updates to the SDK.
WARNING  2016-04-01 03:16:14,948 simple_search_stub.py:1126] Could not read search indexes from /var/folders/0y/yxn2c_d91gx0y3l1132kwd0w0000gn/T/appengine.koni-tech.koni/search_indexes
INFO     2016-04-01 03:16:14,953 api_server.py:205] Starting API server at: http://localhost:59482
INFO     2016-04-01 03:16:14,956 api_server.py:648] Applying all pending transactions and saving the datastore
INFO     2016-04-01 03:16:14,956 api_server.py:651] Saving search indexes
Traceback (most recent call last):
  File "/usr/local/bin/dev_appserver.py", line 83, in <module>
    _run_file(__file__, globals())
  File "/usr/local/bin/dev_appserver.py", line 79, in _run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1040, in <module>
    main()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1033, in main
    dev_server.start(options)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 824, in start
    self._dispatcher.start(options.api_host, apis.port, request_data)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 194, in start
    _module.start()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/module.py", line 1176, in start
    self._balanced_module.start()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 315, in start
    self._start_all_fixed_port(host_ports)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 352, in _start_all_fixed_port
    raise BindError('Unable to bind %s:%s' % self.bind_addr)
google.appengine.tools.devappserver2.wsgi_server.BindError: Unable to bind localhost:8080

エラーっぽいファイルパスが出ていたので、そのディレクトリを削除して起動しなおしたらうまく行った。

$ rm -rf /var/folders/0y/yxn2c_d91gx0y3l1132kwd0w0000gn/T/appengine.koni-tech.koni/

search_indexesって書いてあるけど、search使ってないんだけどな・・