R10-C INETS-4.2 HTTP post method

Michael McDaniel erlang@REDACTED
Sun Feb 13 06:42:01 CET 2005


On Fri, Feb 11, 2005 at 01:54:45PM -0800, Stephen Han wrote:
> Hi.
> 
> Does anyone ever tried http:request with 'post' method?
> 
> Since I install R10-C http client 'post' method is not working.
> There are bunch of message coming out but noteably at the beginning I
> got following message.
> 
> > http:request(post, {"http://www.erlang.org", [], "application/xml", []}, [],[]).
> 
> Of course, the sample URL is not valide but, I expect we should not
> get those error, either.
> 
> ** dets: Bug was found when accessing table cookie_db,
> ** dets: operation was close and reply was
> {'EXIT',{{case_clause,{'EXIT',{{badmatch,{error,eacces}},[{dets,perform_save,2},{dets,fclose,1},{dets,apply_op,4},{dets,do_apply_op,4},{proc_lib,init_p,5}]}}},[{dets,perform_save,2},{dets,fclose,1},{dets,apply_op,4},{dets,do_apply_op,4},{proc_lib,init_p,5}]}}.
> ** exited: {{case_clause,{undefined,{error,
>                                         {'EXIT',
>                                             {{badmatch,
<snip>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I also am seeing the dets error.

$ uname -a
Linux cougora 2.6.4-52-default #1 Wed Apr 7 02:08:30 UTC 2004 i686 i686 i386 GNU/Linux
$ erl
Erlang (BEAM) emulator version 5.4.4 [source] [hipe]

Eshell V5.4.4  (abort with ^G)
1>  http:request(get,{"http://www.quickbots.com",[]},[],[]).

=INFO REPORT==== 12-Feb-2005::21:23:00 ===
The inets application was not started. Has now been started as a temporary application.

=ERROR REPORT==== 12-Feb-2005::21:23:00 ===
** dets: Bug was found when accessing table cookie_db,
** dets: operation was close and reply was {'EXIT',{{case_clause,{'EXIT',{{badmatch,{error,eacces}},[{dets,perform_save,2},{dets,fclose,1},{dets,apply_op,4},{dets,do_apply_op,4},{proc_lib,init_p,5}]}}},[{dets,perform_save,2},{dets,fclose,1},{dets,apply_op,4},{dets,do_apply_op,4},{proc_lib,init_p,5}]}}.
** exited: {{case_clause,{undefined,{error,
                                        {'EXIT',
                                            {{badmatch,
                                                 {error,

	etc. etc. etc.        


=ERROR REPORT==== 12-Feb-2005::21:23:00 ===
Error in process <0.30.0> with exit value: {{case_clause,{undefined,{error,{'EXIT',{{badmatch,{error,{undef,[{http_request,http_headers,[{http_request_h,undefined,"keep-alive",undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,... 


AND THEN I do  (having found the ENOENT error using 'strace erl')

# mkdir /usr/local/lib/erlang/lib/inets-4.2/priv/cookie_db
# chmod go+w /usr/local/lib/erlang/lib/inets-4.2/priv/cookie_db

$ erl
Erlang (BEAM) emulator version 5.4.4 [source] [hipe]

Eshell V5.4.4  (abort with ^G)
1> http:request(get,{"http://www.quickbots.com",[]},[],[]).

=INFO REPORT==== 12-Feb-2005::21:20:10 ===
    application: inets
    exited: {shutdown,{inets_app,start,[normal,[]]}}
    type: temporary
** exited: {{case_clause,{error,{shutdown,{inets_app,start,[normal,[]]}}}},
            [{http,ensure_started,1},
             {http,handle_request,5},
             {erl_eval,do_apply,5},
             {shell,exprs,6},
             {shell,eval_loop,3}]} **

=ERROR REPORT==== 12-Feb-2005::21:20:10 ===
Error in process <0.30.0> with exit value: {{case_clause,{error,{shutdown,{inets_app,start,[normal,[]]}}}},[{http,ensure_started,1},{http,handle_request,5},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]}

2> q().
$ 


If I go to another machine on my network, and go through the proxy on the 'net connected machine, it works...
$ uname -a
Linux fangora 2.6.4-52-default #1 Wed Apr 7 02:08:30 UTC 2004 i686 i686 i386 GNU/Linux
$ erl
Erlang (BEAM) emulator version 5.4.4 [source] [hipe]

Eshell V5.4.4  (abort with ^G)                                                                                   
1>  application:start(inets).
ok
2>  http:set_options([{proxy, {{"cougora.autosys.us",3128}, ["localhost"]}}]).
ok
3>  http:request(get, {"http://www.quickbots.com/",
3>  [ {"Referer", "http://www.erlang.org/"},
3>  {"Proxy-Connection", "keep-alive"},
3>  {"Keep-Alive", "300"},
3>  {"Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"},
3>  {"Accept-Encoding", "gzip,deflate"},
3>  {"Accept-Language", "en-us,en;q=0.5"},
3>  {"Accept", "image/png,*/*;q=0.5"},
3>  {"User-Agent",
3>   "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a4) Gecko/20040927"},
3>  {"Host", "www.erlang.org"} ]},
3>  [], []).
{ok,{{"HTTP/1.0",200,"OK"},
     [{"date","Sun, 13 Feb 2005 05:36:50 GMT"},
      {"via","1.0 cougora.autosys.us (squid/3.0-PRE3)"},
      {"etag","\"15481-1ee2-da976100\""},
      {"server","Apache"},
      {"content-length","7906"},
      {"content-type","text/html; charset=ISO-8859-1"},
      {"last-modified","Wed, 15 Jan 2003 21:45:08 GMT"},
      {"accept-ranges","bytes"},
      {"x-cache","MISS from cougora.autosys.us"},
      {"x-cache-lookup","HIT from cougora.autosys.us:3128"},
      {"proxy-connection","keep-alive"}],
     "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"  etc. etc. etc.
4> q().

=ERROR REPORT==== 12-Feb-2005::21:29:09 ===
** dets: Bug was found when accessing table cookie_db,
** dets: operation was close and reply was {'EXIT',{{case_clause,{'EXIT',{{badmatch,{error,eacces}},[{dets,perform_save,2},{dets,fclose,1},{dets,apply_op,4},{dets,do_apply_op,4},{proc_lib,init_p,5}]}}},[{dets,perform_save,2},{dets,fclose,1},{dets,apply_op,4},{dets,do_apply_op,4},{proc_lib,init_p,5}]}}.

Substituting inets-4.0.1 works in without proxying;  proxying does not work.

I have run out of ideas for awhile and also welcome any suggestions.


Michael McDaniel
Portland, Oregon, USA




More information about the erlang-questions mailing list