1

I'm trying to create a webservice using webapp2 and datastore in python. But whenever i try to run "dev_appserver.py app.yaml" it throws me the following error

ERROR 2017-10-11 05:44:16,207 instance.py:280] Cannot connect to the instance on localhost:17514

Full Error message thrown out in the console

But when i ran the same program using mac it working perfectly fine. Is I'm missing something here, Please find the screeenshot of components i have installed in gcloud.

gcloud components installed screenshot

Could somebody tell what i'm doing wrong here? I'm newbie to google cloud platform, if i am doing something wrong kindly point me to right direction. Any help would be appreciated. Thank you.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97

4 Answers4

1

I see the same errors when trying to execute the dev_appserver.py from the Cloud SDK version 174.0.0.

However the dev_appserver.py from the standalone GAE SDK version 1.9.61 (theoretically the same being packed into the gcloud SDK 174.0.0) is running fine.

So one possible workaround to try would be to also install the standalone GAE SDK and run that dev_appserver.py instead.

Note: this is on linux, though, YMMV.

Related: What is the relationship between Google's App Engine SDK and Cloud SDK?

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
1

The problem is fixed. Like @DanCornilescu said it's an environment issue. I deactivated the virtual environment. And It works fine with no issue.

0

Solution for macOS. Maybe it works on Linux and Windows:

Find and remove folder:

appengine.None.<USER_NAME>

from the:

/var/folders

In may case:

/var/folders/6w/v0865mm96rj85dlwnr311bt00000gn/T/appengine.None.<USER_NAME>
Ivan
  • 305
  • 4
  • 9
0

I'm refactoring some of my old golang applications and I ran into this problem. I'd oversimplified the spin-up of my web server not realizing this is a critical block of code:

    // Critical to work on AppEngine
    port := os.Getenv("PORT")
    if port == "" {
        port = "8080"
        log.Printf("Defaulting to port %s", port)
    }
    log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), r))

Hope this helps.