Welcome! Log In Create A New Profile


drizzle-nginx-module error body missing?

October 16, 2011 01:00AM
Hey nginx list, it's been awhile. This question is directed at agentzh and chaoslawful.

I'm using nginx drizzle to insert to a table. I have a unique key constraint on the table. When I try to insert and violate the unique constraint, I get a 500 from the nginx location doing the mysql query, but no response body or headers to pass on to my client indicating what the mysql error was. I can easily check for the 500 in the location calling the mysql location, but I'd like to pass on the error code to the actual client with some useful error information and not mask any further 500's.

The json-ified output of a successful insert has an errcode field:

, but an actual error returns an empty body. Is there no way to grab the error relating to my failed insert? Any suggestions?

Here's the error log:
2011/10/16 04:08:53 [error] 2847#0: *60 failed to send query: 17 (1062): Duplicate entry '2-200-6094279b20' for key 'id_versions' while sending query to drizzle upstream, client:, server: , request: "POST http://foo/v1/publish HTTP/1.1", subrequest: "/mysql", upstream: "drizzle://", host: "foo"

Here's the location:
location /mysql {
drizzle_pass mysqldb;
drizzle_module_header off;
set_unescape_uri $mysql_query $query_string;
drizzle_query $mysql_query;
rds_json on;

Here's the query I'm sending lua and proven via ngx.say(query)
INSERT INTO published SET packages_id=(SELECT id FROM packages WHERE name='infra-package'), sha='6094279b2033a9dfa8bd38cadffeb9d274657936', version='200', path='678459e1ce';

location /addpackage {
content_by_lua "

local query = <bunch of query building code>

local res = ngx.location.capture('/mysql', { args = query} )



Subject Author Posted

drizzle-nginx-module error body missing?

dannynoonan October 16, 2011 01:00AM

Re: drizzle-nginx-module error body missing?

agentzh October 16, 2011 01:14AM

Re: drizzle-nginx-module error body missing?

dannynoonan October 16, 2011 01:24AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 64
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready