[google-appengine] x-forwared-for not set correcty on node.js

2016-08-14 Thread Karl Hiramoto

The documentation at 
 https://cloud.google.com/appengine/docs/flexible/nodejs/runtime  
Says: " The user's IP address is available in the standard X-Forwarded-For 
header 
"

However this is not the case,   doing some debugging the HTTP request 
headers I always see are:

"x-real-ip": "169.254.160.2",
"x-forwarded-for": "169.254.160.2",
"x-google-real-ip": "169.254.160.2",

These are link local IP addresses and can not be correct. 

Documentation bug or   app engine bug?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/02ce2e7b-f19e-489f-9bf8-2651321ed7ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: ImportError: No module named django.core.handlers.wsgi

2016-08-14 Thread Mak Ahmad
Thank you Adam. I should have shared that I already do have django in my 
app.yaml

application: xx-
version: 1
runtime: python27
api_version: 1
threadsafe: yes

# Handlers match in order, put above the default handler.
handlers:
- url: /static
  static_dir: static
- url: /.*
  script: main.application

libraries:
- name: django
  version: "1.5"
- name: jinja2
  version: "2.6"
- name: markupsafe
  version: "0.15"
- name: ssl
  version: latest

builtins:
- django_wsgi: on


Any thoughts on how I can get the build in django in my sys.path?


On Sunday, August 14, 2016 at 10:35:32 AM UTC-7, Adam (Cloud Platform 
Support) wrote:
>
> You're getting the ImportError because django is not in your sys.path.
>
> If you want to use one of the built-in django versions 
>  
> from the App Engine SDK, simply add this to your app.yaml (it's not 
> necessary to install the Django library separately):
>
> libraries:
> - name: django
>   version: "1.4"
>
> If you want to include your own django version with your app (eg. to use a 
> recent version > 1.5), don't add the above line and instead install the 
> library directly into your project's root directory:
>
> $ cd myapp/
> $ pip install django -t .
>
> If you want to install to a subfolder 
> 
>  
> like 'lib', first add these lines to your app, preferably in 
> appengine_config.py in the root of your project:
>
> from google.appengine.ext import vendor
>
> # Add any libraries installed in the "lib" folder.
> vendor.add('lib')
>
> Then install the library:
>
> $ cd myapp/
> $ pip install django -t lib/
>
> By default dev_appserver.py excludes local site-packages and it's best to 
> not try and override this, since your app will only work locally and not 
> when deployed.
>
> On Saturday, August 13, 2016 at 12:33:25 PM UTC-4, Mak Ahmad wrote:
>>
>> Forgot to mention, I get that django wsgi error when trying to access 
>> http://localhost:8080/
>>
>> On Saturday, August 13, 2016 at 9:31:47 AM UTC-7, Mak Ahmad wrote:
>>>
>>> Hi I'm getting the following error and cannot find anything in the 
>>> forums that has helped me with AppEngine:
>>>
>>> ImportError: No module named django.core.handlers.wsgi 
>>>
>>> Here's my code
>>> import os
>>> os.environ['DJANGO_SETTINGS_MODULE'] = 'app.settings'
>>>
>>> #import sys
>>> #sys.path.append('lib')
>>> #sys.path.append('//Library/Python/2.7/site-packages/django')
>>> import django.core.handlers.wsgi
>>>
>>> from requests_toolbelt.adapters import appengine
>>> appengine.monkeypatch()
>>>
>>> application = django.core.handlers.wsgi.WSGIHandler()
>>>
>>>
>>> I tried manually adding django to the library but that didn't work 
>>> either. I also tried going to the google_appengine django 1.5 library 
>>> folder and doing a python setup.py but that didn't work either.
>>>
>>> Any thoughs? I know Django is builtin to appengine just don't see where 
>>> my system path issue is. 
>>>
>>> I can do the following with no error
>>>
>>> Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
>>>
>>> [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
>>>
>>> Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> >>> import django
>>>
>>> >>> import django.core.handlers.wsgi
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/23c3104c-8f39-4bcd-87c7-57412727dba3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: ImportError: No module named django.core.handlers.wsgi

2016-08-14 Thread 'Adam (Cloud Platform Support)' via Google App Engine
You're getting the ImportError because django is not in your sys.path.

If you want to use one of the built-in django versions 
 
from the App Engine SDK, simply add this to your app.yaml (it's not 
necessary to install the Django library separately):

libraries:
- name: django
  version: "1.4"

If you want to include your own django version with your app (eg. to use a 
recent version > 1.5), don't add the above line and instead install the 
library directly into your project's root directory:

$ cd myapp/
$ pip install django -t .

If you want to install to a subfolder 

 
like 'lib', first add these lines to your app, preferably in 
appengine_config.py in the root of your project:

from google.appengine.ext import vendor

# Add any libraries installed in the "lib" folder.
vendor.add('lib')

Then install the library:

$ cd myapp/
$ pip install django -t lib/

By default dev_appserver.py excludes local site-packages and it's best to 
not try and override this, since your app will only work locally and not 
when deployed.

On Saturday, August 13, 2016 at 12:33:25 PM UTC-4, Mak Ahmad wrote:
>
> Forgot to mention, I get that django wsgi error when trying to access 
> http://localhost:8080/
>
> On Saturday, August 13, 2016 at 9:31:47 AM UTC-7, Mak Ahmad wrote:
>>
>> Hi I'm getting the following error and cannot find anything in the forums 
>> that has helped me with AppEngine:
>>
>> ImportError: No module named django.core.handlers.wsgi 
>>
>> Here's my code
>> import os
>> os.environ['DJANGO_SETTINGS_MODULE'] = 'app.settings'
>>
>> #import sys
>> #sys.path.append('lib')
>> #sys.path.append('//Library/Python/2.7/site-packages/django')
>> import django.core.handlers.wsgi
>>
>> from requests_toolbelt.adapters import appengine
>> appengine.monkeypatch()
>>
>> application = django.core.handlers.wsgi.WSGIHandler()
>>
>>
>> I tried manually adding django to the library but that didn't work 
>> either. I also tried going to the google_appengine django 1.5 library 
>> folder and doing a python setup.py but that didn't work either.
>>
>> Any thoughs? I know Django is builtin to appengine just don't see where 
>> my system path issue is. 
>>
>> I can do the following with no error
>>
>> Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
>>
>> [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
>>
>> Type "help", "copyright", "credits" or "license" for more information.
>>
>> >>> import django
>>
>> >>> import django.core.handlers.wsgi
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/22887b6f-27e2-4bc9-bf08-6cfd6214d719%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Get result of async operation to Google speech-to-text

2016-08-14 Thread Aris Alexis
I have the same problem with the response, it doesn't include any result. 
Does this mean it didn't understand anything from the audio file? I am 
sending a 40seconds linear16 raw PCM 16 bit signed file with clear voices. 
If there is a problem why isn't there an error reported?


On Thursday, August 11, 2016 at 2:30:55 AM UTC+2, Bruno Leitão wrote:
>
> Hi all,
>
> I perform a async request to google speech-to-text, and now i do not know 
> how to get the result of operation.
>
> I already know that operation was successful
>
> Thanks
> BL
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/d728426a-8304-4fb7-9746-31ccac51cbd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Re: The API package 'search' or call 'IndexDocument()' was not found

2016-08-14 Thread Apurva Nandan
Hi Nick,

Many thanks a lot for resolving the issue which was literally puzzling me.
I was actually following my old elasticsearch way of indexing the documents
by creating desktop based jars to run periodically as cron jobs. But I
guess, I will figure something out in this case as well.

Just a small question, when I run this thing on the development server,
where is the index stored locally?

- Apurva

On Mon, Aug 8, 2016 at 10:47 PM, 'Nick (Cloud Platform Support)' via Google
App Engine  wrote:

> Hey Apurva,
>
> The reason this is failing is because you should be running this code in
> the context of an App Engine servlet, not merely within the main() method
> of a traditional java class. Here is an example tutorial
> showing
> a basic java app for App Engine. When I ran the code within the App Engine
> development server environment and in production, I saw no errors.
>
> Cheers,
>
> Nick
> Cloud Platform Community Support
>
> On Tuesday, July 26, 2016 at 4:53:53 PM UTC-4, Apurva Nandan wrote:
>
>>
>> Using Google App Engine's Search API, I am trying to index some document
>> into a test index. I am using the code sample given on the Google App
>> Engine official documentation. But when I try to run the snippet below. I
>> get the following error when I tr to put a document via index.put:
>>
>> Exception in thread "main" 
>> com.google.apphosting.api.ApiProxy$CallNotFoundException:
>> The API package 'search' or call 'IndexDocument()' was not found. at
>> com.google.apphosting.api.ApiProxy$1.get(ApiProxy.java:179) at
>> com.google.apphosting.api.ApiProxy$1.get(ApiProxy.java:177) at
>> com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:88)
>> at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:88)
>> at 
>> com.google.appengine.api.search.FutureHelper.getInternal(FutureHelper.java:73)
>> at 
>> com.google.appengine.api.search.FutureHelper.quietGet(FutureHelper.java:32)
>> at com.google.appengine.api.search.IndexImpl.put(IndexImpl.java:486) at
>> test.service.SearchingService.indexADocument(SearchingService.java:52)
>>
>> Here's the code snippet:
>>
>>  IndexSpec indexSpec = IndexSpec.newBuilder().setName(indexName).build();
>>
>>   SearchService service = SearchServiceFactory.getSearchService(
>>
>> SearchServiceConfig.newBuilder().setDeadline(10.0).setNamespace("geeky").build());
>>   Index index = service.getIndex(indexSpec);
>>
>>
>>
>>   final int maxRetry = 3;
>>   int attempts = 0;
>>   int delay = 2;
>>   while (true) {
>> try {
>>
>>   index.put(document); // ERROR!!
>> } catch (PutException e) {
>>   if 
>> (StatusCode.TRANSIENT_ERROR.equals(e.getOperationResult().getCode())
>>   && ++attempts < maxRetry) { // retrying
>> Thread.sleep(delay * 1000);
>> delay *= 2; // easy exponential backoff
>> continue;
>>   } else {
>> throw e; // otherwise throw
>>   }
>> }
>> break;
>>   }
>>
>> }
>>
>> I am using appengine-java-sdk-1.9.18 with Eclipse Kepler. It doesn't
>> matter if I run the code on a local dev server or in production hosted on
>> appspot. I get the same error. I am already authenticated in eclipse to my
>> google account, and am able to push my code into production via eclipse.
>> Has anybody seen this error before?
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google App Engine" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/google-appengine/w9Pv1JH9nHg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> google-appengine+unsubscr...@googlegroups.com.
> To post to this group, send email to google-appengine@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-appengine.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-appengine/5b908f62-e248-4694-9900-
> 05a4bf31cfd3%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAFk2cV6NPRkv5gtJZ7Usa-KZE_g%2BkuKDzC%2BZH2a_1XWjeKYBhQ%40mail.gmail