[racket] racket as cgi error with sqlite

From: prad (prad at towardsfreedom.com)
Date: Wed Mar 27 14:27:00 EDT 2013

i have a working cgi script in racket which accesses a sqlite3 db:

====
#lang racket

(require net/cgi)
(require db/base db/sqlite3)

(define cn (sqlite3-connect #:database "tmp.db"))

; (query-rows cn "select nm from tbl")
(query-exec cn "insert into tbl (nm) values ('hello')")
====

if i do the:
(query-rows cn "select nm from tbl")
it works fine.

if i do the:
(query-exec cn "insert into tbl (nm) values ('hello')")
i get 500 internal server error

both statements work fine from the console.

i've tried changing permissions to 777 on the tmp.db but doing so
doesn't make any difference.

i'm using lighttpd so i thought the error might show up in
/var/log/lighttpd/error.log
but it doesn't.

nor does anything show up in
/var/log/messages


1. how can i see error messages when using racket as cgi with lighttpd (on debian).

2. if #1 isn't possible for some reason, any ideas on why i can read,
but not write to the sqlite db?


-- 
in friendship,
prad


Posted on the users mailing list.