How to log aiojobs exceptions to file - aiohttp

For aiohttp, I can use logging.getLogger('aiohttp'), but what to use for aiojobs?
My code raised an exception and I noted it in console:
Job processing failed
job: <Job coro=<<coroutine object Message.process_messages at 0x108b32150>>>
Traceback (most recent call last):
...

I have to use logging.getLogger('asyncio')

Related

VoidMessage response failing on Google Cloud Endpoints

I've create a small Google Cloud Endpoints Frameworks application running on App Engine - Standard Environment. Overall, things have been working very nicely.
I need to create a method that simply returns as HTTP 204 once it is called via HTTP GET. As I understand it, this can be accomplished by simply returning message_types.VoidMessage().
However, when I use this approach, the endpoint returns an HTTP 500 error. From the error console, the error reported is:
ValueError: response_size should be a positive int/long
My method is essentially empty right now (just logging) - the error does not originate until the response is attempted.
Traceback:
(/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py:279)
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 267, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "/base/data/home/apps/..../lib/google/api/control/wsgi.py", line 194, in call
return self._application(environ, start_response)
File "/base/data/home/apps/..../lib/google/api/control/wsgi.py", line 574, in call
return self._application(environ, start_response)
File "/base/data/home/apps/..../lib/google/api/control/wsgi.py", line 323, in call
rules)
File "/base/data/home/apps/..../lib/google/api/control/wsgi.py", line 356, in _create_report_request
url=app_info.url
File "/base/data/home/apps/..../lib/google/api/control/report_request.py", line 241, in new
_validate_int_arg('response_size', response_size)
File "/base/data/home/apps/..../lib/google/api/control/report_request.py", line 45, in _validate_int_arg
raise ValueError('%s should be a positive int/long' % (name,))
ValueError: response_size should be a positive int/long
Any thoughts would be appreciated.
I'm on App Engine Standard edition.
google-endpoints is v2.0.0b5
google-endpoints-api-management is v1.0.0b6

How to set up CKAN in RHEL

I was following the steps given here to install CKAN from source in my Redhat Enterprise Linux 6 system.
At the step 6, I get the following output:
> (default)[hrishi#rd ~]$ cd /usr/lib/ckan/default/src/ckan
(default)[hrishi#rd ckan]$ paster db init -c /etc/ckan/default/development.ini
2015-05-15 11:23:35,695 ERROR [ckan.lib.search.common] HTTP code=404, reason=Not Found
Traceback (most recent call last):
File "/usr/lib/ckan/default/src/ckan/ckan/lib/search/common.py", line 51, in is_available
conn.query("*:*", rows=1)
File "/usr/lib/python2.6/site-packages/solr/core.py", line 703, in query
return self.select(*args, **params)
File "/usr/lib/python2.6/site-packages/solr/core.py", line 798, in __call__
xml = self.raw(**params)
File "/usr/lib/python2.6/site-packages/solr/core.py", line 823, in raw
rsp = conn._post(self.selector, request, conn.form_headers)
File "/usr/lib/python2.6/site-packages/solr/core.py", line 639, in _post
return check_response_status(self.conn.getresponse())
File "/usr/lib/python2.6/site-packages/solr/core.py", line 1097, in check_response_status
raise ex
SolrException: HTTP code=404, reason=Not Found
2015-05-15 11:23:35,697 WARNI [ckan.lib.search] Problems were found while connecting to the SOLR server
2015-05-15 11:23:35,927 ERROR [ckan.lib.search.common] HTTP code=404, reason=Not Found
Traceback (most recent call last):
File "/usr/lib/ckan/default/src/ckan/ckan/lib/search/common.py", line 51, in is_available
conn.query("*:*", rows=1)
File "/usr/lib/python2.6/site-packages/solr/core.py", line 703, in query
return self.select(*args, **params)
File "/usr/lib/python2.6/site-packages/solr/core.py", line 798, in __call__
xml = self.raw(**params)
File "/usr/lib/python2.6/site-packages/solr/core.py", line 823, in raw
rsp = conn._post(self.selector, request, conn.form_headers)
File "/usr/lib/python2.6/site-packages/solr/core.py", line 639, in _post
return check_response_status(self.conn.getresponse())
File "/usr/lib/python2.6/site-packages/solr/core.py", line 1097, in check_response_status
raise ex
SolrException: HTTP code=404, reason=Not Found
2015-05-15 11:23:35,928 WARNI [ckan.lib.search] Problems were found while connecting to the SOLR server
Initialising DB: SUCCESS
Could someone tell me where I went wrong?
Also, I followed these steps to setup Solr in my system.
(just a wild guess) A common pitfall on RHEL systems is that the default SELinux configuration might not allow internal http connections. So try
/usr/sbin/setsebool httpd_can_network_connect 1
(or simply disable SELinux).
And, of course, check your config ini if you really have the correct address and port of the Solr server. ;-)

Go AppEngine remote_api sample not working

Are the Go AppEngine samples up to date?
I'm running into issues getting example/remote_api/datastore_info.go working for my test AppEngine running on localhost.
I've changed the client.PostForm from:
resp, err := client.PostForm("https://www.google.com/accounts/ClientLogin", v)
to:
resp, err := client.PostForm("http://localhost:35058/_ah/remote_api", v)
(35058 is the port reported for api_server during startup).
I've tried both 1.9.3 and latest 1.9.4 versions.
The api server reports:
ERROR 2014-05-06 20:57:56,378 api_server.py:215] Exception while handling
Traceback (most recent call last):
File "/root/go_appengine/google/appengine/tools/devappserver2/api_server.py", line 194, in _handle_POST
request.ParseFromString(wsgi_input)
File "/root/go_appengine/google/net/proto/ProtocolBuffer.py", line 88, in ParseFromString
self.MergeFromString(s)
File "/root/go_appengine/google/net/proto/ProtocolBuffer.py", line 95, in MergeFromString
self.MergePartialFromString(s)
File "/root/go_appengine/google/net/proto/ProtocolBuffer.py", line 109, in MergePartialFromString
self.TryMerge(d)
File "/root/go_appengine/google/appengine/ext/remote_api/remote_api_pb.py", line 210, in TryMerge
d.skipData(tt)
File "/root/go_appengine/google/net/proto/ProtocolBuffer.py", line 529, in skipData
self.skipData(t)
File "/root/go_appengine/google/net/proto/ProtocolBuffer.py", line 529, in skipData
self.skipData(t)
File "/root/go_appengine/google/net/proto/ProtocolBuffer.py", line 537, in skipData
raise ProtocolBufferDecodeError, "corrupted"
ProtocolBufferDecodeError: corrupted
There were some bug fixes in 1.9.6; can you try with the latest SDK?
I've been exactly the same problem in whatever call to my development server
Traceback (most recent call last):
File "/home/mike/go_appengine/google/appengine/tools/devappserver2/api_server.py", line 238, in _handle_POST
request.ParseFromString(wsgi_input)
File "/home/mike/go_appengine/google/net/proto/ProtocolBuffer.py", line 140, in ParseFromString
self.MergeFromString(s)
File "/home/mike/go_appengine/google/net/proto/ProtocolBuffer.py", line 152, in MergeFromString
self.MergePartialFromString(s)
File "/home/mike/go_appengine/google/net/proto/ProtocolBuffer.py", line 168, in MergePartialFromString
self.TryMerge(d)
File "/home/mike/go_appengine/google/appengine/ext/remote_api/remote_api_pb.py", line 210, in TryMerge
d.skipData(tt)
File "/home/mike/go_appengine/google/net/proto/ProtocolBuffer.py", line 677, in skipData
raise ProtocolBufferDecodeError, "corrupted"
ProtocolBufferDecodeError: corrupted
I've go version go1.4.2 (appengine-1.9.24) linux/amd64
Problem was I'm using the IP for "API" instead the IP for default module
INFO 2015-08-13 19:42:03,901 devappserver2.py:763] Skipping SDK update check.
INFO 2015-08-13 19:42:03,947 api_server.py:205] Starting API server at: http://localhost:60852
INFO 2015-08-13 19:42:03,971 dispatcher.py:197] Starting module "default" running at: http://localhost:49333
INFO 2015-08-13 19:42:03,972 admin_server.py:118] Starting admin server at: http://localhost:8000
You must use module host/por to place calls to your go application; API ip is for remote api, I think.

Taskqueue error while testing locally

I've been developing with appengine for the past 6 months now and haven't had too many issues-- but I just switched my box setup from ArchLinux to a Linux Mint install and now am having a weird issue I haven't seen before. I'm using the 1.8.0 python sdk. I'm trying to dispatch tasks onto a named queue and am getting the following traceback:
ERROR 2013-06-05 14:53:33,762 taskqueue_stub.py:1892] Failed to dispatch task
Traceback (most recent call last):
File "/opt/google_appengine/google/appengine/api/taskqueue/taskqueue_stub.py", line 1890, in ExecuteTask
'0.1.0.2')
File "/opt/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 532, in add_request
headers_dict['Host'], urlparse.urlsplit(relative_url).path)
File "/opt/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 580, in _resolve_target
raise request_info.ServerDoesNotExistError(prefix)
ServerDoesNotExistError: 15.bqdownloader-test
ERROR 2013-06-05 14:53:33,762 taskqueue_stub.py:1965] An error occured while sending the task "task16" (Url: "/_ah/warmup") in queue "download-queue". Treating as a task error.
My backends.py contains the following section that pertains:
- name: bqdownloader-test
class: B1
instances: 20
options: dynamic
I've looked around and have found one mention of this error, but no fix. Has anyone encountered this? I don't really know what to do to address this issue. Thanks in advance.

(NS_ERROR_MALFORMED_URI) [nsIIOService.newURI] When executing a user keyword taking 'URL' as arguments

When I execute the user keyword, I get the following error:
Message: u'Component returned failure code: 0x804b000a (NS_ERROR_MALFORMED_URI) [nsIIOService.newURI]'
My test:
*** Settings ***
Library lib_TestSetUp.py
Library CP_Web_SignInPage.py
*** Test Cases ***
TC1
${wd_handle}= Initiate Setup 'Firefox'
Login User ${wd_handle} 'http://www.amazon.com/cloudplayer' 'karthicm+ustest1#amazon.com' 'test123'
When I run, webdriver handle is set to ${wd_handle} and I use the same handler to run my remaining tests on the ride.
def login_user(wd_handle, Login_URL, UserName, Password):
{
//Does login operation
}
Console:
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 551, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Python27\Lib\SocketServer.py", line 225, in serve_forever
r, w, e = select.select([self], [], [], poll_interval)
AttributeError: 'module' object has no attribute 'select'
Log:
Starting test: DigitalMP3 Project.TestSuite.TC1
20130603 16:26:44.629 : INFO : ${wd_handle} = <selenium.webdriver.firefox.webdriver.WebDriver object at 0x03302790>
20130603 16:26:49.720 : INFO :
Message: u'Component returned failure code: 0x804b000a (NS_ERROR_MALFORMED_URI) [nsIIOService.newURI]'
INFO:
RIDE 1.1 running on Python 2.7.3.
robotframework-2.7.7
selenium 2.33
The problem is with the single quotes being used for the arguments 'http://www.amazon.com/cloudplayer'
Just using - http://www.amazon.com/cloudplayer worked fine. RobotFramework by defaults takes the arguments as raw strings

Resources