captcha fixed but internal server error not

36 views
Skip to first unread message

mor...@morlix.de

unread,
Jul 2, 2010, 10:04:05 AM7/2/10
to Mozilla Labs Weave Server Users
Now i get the captcha, but the internal server errors still exists.

The problem with the captcha was a missing ; in the captcha.php file.

After lots of debugging i can say, that the problem must exists either
in curl_put or create_user (mysql) function.
But i cannot figure out the exactly problem, so that i can solve it.

Toby Elliott

unread,
Jul 2, 2010, 12:23:01 PM7/2/10
to mozilla-labs-we...@googlegroups.com
Wow, no idea how that semicolon slipped through. Thanks for the catch (it's fixed on tip).

What does the error log say when it gives you an internal server error? Also, is it giving you a 503 with a response, or just a generic 'Apache died' error?

Thanks,
Toby Elliott

mor...@morlix.de

unread,
Jul 2, 2010, 12:40:19 PM7/2/10
to Mozilla Labs Weave Server Users
Hello Toby,

the apache access log says:

<ip> - - [02/Jul/2010:18:37:33 +0200] "PUT /user/1.0/KNJGZX6SZFYTAD3
HTTP/1.1" 500 - "-" "-"

In the weave error log i didn´t see any messages.

Can you please help fix this? I already looked at the code, but i didn
´t find anything in the weave_user/mysql.php file.

Thanks,

morlix

mor...@morlix.de

unread,
Jul 2, 2010, 12:50:33 PM7/2/10
to Mozilla Labs Weave Server Users
If i edit the curl_put function and enable curl verbose i get the
following on the console:

* About to connect() to <hostname> port 443 (#0)
* Trying <ip>... * connected
* Connected to morlix.de (85.25.138.180) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: CN=<hostname>
* start date: 2010-05-22 11:39:36 GMT
* expire date: 2010-11-18 11:39:36 GMT
* issuer: O=Root CA; OU=http://www.cacert.org; CN=CA Cert
Signing Authority; emailAddress=sup...@cacert.org
* SSL certificate verify ok.
> PUT /user/1.0/KNJGZX6SZFYTAD3 HTTP/1.1
Host: <hostname>
Accept: */*
Content-Length: 61
Expect: 100-continue

< HTTP/1.1 100 Continue
* HTTP 1.0, assume close after body
< HTTP/1.0 500 Internal Server Error
< Date: Fri, 02 Jul 2010 16:37:33 GMT
< Server: Apache
< X-Powered-By: PHP/5.2.13-pl0-gentoo
< Content-Length: 0
< Connection: close
< Content-Type: text/html
<
* we are done reading and this is set to close, stop send
* Closing connection #0
Create user...NOT OK

Toby Elliott

unread,
Jul 2, 2010, 12:59:47 PM7/2/10
to mozilla-labs-we...@googlegroups.com
Hmm, 500 is an actual internal server error. We would not return that if there was, say, a database problem (errors from the app return a 503). That could mean that you've got a messed up file or something, but that would likely show up for any query, as it's loading the same libraries as it would for, say, checking username existence.

A 500 should generate an error message in the apache error log.

Also, if you're running the command-line test script, make sure that you have captchas disabled. It shouldn't give you a 500, but it will return an error if they are on.

Regards,
Toby

mor...@morlix.de

unread,
Jul 2, 2010, 1:13:10 PM7/2/10
to Mozilla Labs Weave Server Users
i have disabled captchas and i didn´t see an error in the apache error
log.

The complete log of the weave test script is:

Jul 2 19:08:41 echo517 weave: Jul 02 19:08:41 <hostname> CEF:0|
mozilla|weave|1.3|AuthFail|User Authentication Failed|3|
cs1Label=requestClientApplication cs1=none requestMethod=POST
request=https://<domain>/user/1.0/V6N6JX/password src=<ip> dst=<ip>
suser=v6n6jx
Jul 2 19:08:41 echo517 weave: Jul 02 19:08:41 <hostname> CEF:0|
mozilla|weave|1.3|AuthFail|User Authentication Failed|3|
cs1Label=requestClientApplication cs1=none requestMethod=POST
request=https://<domain>/user/1.0/V6N6JX/password src=<ip> dst=<ip>
suser=v6n6jx
Jul 2 19:08:41 echo517 weave: Jul 02 19:08:41 <hostname> CEF:0|
mozilla|weave|1.3|AuthFail|User Authentication Failed|3|
cs1Label=requestClientApplication cs1=none requestMethod=POST
request=https://<domain>/user/1.0/V6N6JX/email src=<ip> dst=<ip>
suser=v6n6jx
Jul 2 19:08:41 echo517 weave: Jul 02 19:08:41 <hostname> CEF:0|
mozilla|weave|1.3|AuthFail|User Authentication Failed|3|
cs1Label=requestClientApplication cs1=none requestMethod=POST
request=https://<domain>/user/1.0/V6N6JX/email src=<ip> dst=<ip>
suser=v6n6jx
Jul 2 19:08:41 echo517 weave: Jul 02 19:08:41 <hostname> CEF:0|
mozilla|weave|1.3|AuthFail|User Authentication Failed|3|
cs1Label=requestClientApplication cs1=none requestMethod=DELETE
request=https://<domain>/user/1.0/V6N6JX src=<ip> dst=<ip>
suser=v6n6jx
Jul 2 19:08:56 echo517 weave: Jul 02 19:08:56 <hostname> CEF:0|
mozilla|weave|1.3|DeleteUser|User Deleted|1|
cs1Label=requestClientApplication cs1=none requestMethod=DELETE
request=https://<domain>/user/1.0/V6N6JX src=<ip> dst=<ip>
suser=v6n6jx

The apache access log says:

<ip> - - [02/Jul/2010:19:09:55 +0200] "GET /user/1.0/94IQ1UEDDER HTTP/
1.1" 200 1 "-" "-"
<ip> - - [02/Jul/2010:19:09:55 +0200] "PUT /user/1.0/94IQ1UEDDER HTTP/
1.1" 400 1 "-" "-"
<ip> - - [02/Jul/2010:19:09:55 +0200] "PUT /user/1.0/[94IQ1UEDDER HTTP/
1.1" 400 1 "-" "-"
<ip> - - [02/Jul/2010:19:09:55 +0200] "PUT /user/1.0/94IQ1UEDDER HTTP/
1.1" 500 - "-" "-"
<ip> - - [02/Jul/2010:19:09:55 +0200] "GET /user/1.0/94IQ1UEDDER HTTP/
1.1" 200 1 "-" "-"
<ip> - - [02/Jul/2010:19:09:55 +0200] "PUT /user/1.0/94IQ1UEDDER HTTP/
1.1" 500 - "-" "-"
<ip> - 94IQ1UEDDER [02/Jul/2010:19:09:55 +0200] "POST /user/
1.0/94IQ1UEDDER/password HTTP/1.1" 400 1 "-" "-"
<ip> - 94IQ1UEDDER [02/Jul/2010:19:09:55 +0200] "POST /user/
1.0/94IQ1UEDDER/password HTTP/1.1" 401 23 "-" "-"
<ip> - 94IQ1UEDDER [02/Jul/2010:19:09:55 +0200] "POST /user/
1.0/94IQ1UEDDER/password HTTP/1.1" 401 23 "-" "-"
<ip> - 94IQ1UEDDER [02/Jul/2010:19:09:55 +0200] "POST /user/
1.0/94IQ1UEDDER/email HTTP/1.1" 401 23 "-" "-"
<ip> - 94IQ1UEDDER [02/Jul/2010:19:09:55 +0200] "POST /user/
1.0/94IQ1UEDDER/email HTTP/1.1" 401 23 "-" "-"
<ip> - - [02/Jul/2010:19:09:55 +0200] "GET /user/1.0/94IQ1UEDDER/node/
weave HTTP/1.1" 404 13 "-" "-"
<ip> - 94IQ1UEDDER [02/Jul/2010:19:09:55 +0200] "DELETE /user/
1.0/94IQ1UEDDER HTTP/1.1" 401 23 "-" "-"
<ip> - - [02/Jul/2010:19:09:55 +0200] "PUT /user/1.0/94IQ1UEDDER HTTP/
1.1" 500 - "-" "-"
<ip> - - [02/Jul/2010:19:10:00 +0200] "DELETE /user/1.0/94IQ1UEDDER
HTTP/1.1" 200 7 "-" "-"


On 2 Jul., 18:59, Toby Elliott <telli...@mozilla.com> wrote:
> Hmm, 500 is an actual internal server error. We would not return that if there was, say, a database problem (errors from the app return a 503). That could mean that you've got a messed up file or something, but that would likely show up for any query, as it's loading the same libraries as it would for, say, checking username existence.
>
> A 500 should generate an error message in the apache error log.
>
> Also, if you're running the command-line test script, make sure that you have captchas disabled. It shouldn't give you a 500, but it will return an error if they are on.
>
> Regards,
> Toby
>
> On Jul 2, 2010, at 9:50 AM, mor...@morlix.de wrote:
>
> > If i edit the curl_put function and enable curl verbose i get the
> > following on the console:
>
> > * About to connect() to <hostname> port 443 (#0)
> > *   Trying <ip>... * connected
> > * Connected to morlix.de (85.25.138.180) port 443 (#0)
> > * successfully set certificate verify locations:
> > *   CAfile: none
> >  CApath: /etc/ssl/certs
> > * SSL connection using DHE-RSA-AES256-SHA
> > * Server certificate:
> > *        subject: CN=<hostname>
> > *        start date: 2010-05-22 11:39:36 GMT
> > *        expire date: 2010-11-18 11:39:36 GMT
> > *        issuer: O=Root CA; OU=http://www.cacert.org;CN=CA Cert
> > Signing Authority; emailAddress=supp...@cacert.org

Toby Elliott

unread,
Jul 2, 2010, 1:41:53 PM7/2/10
to mozilla-labs-we...@googlegroups.com
The CEF alerts are just noting that you're trying to log in with a user account that doesn't exist.

Most of the queries are "working", which means the problem isn't in the file syntax, but is something happening to kill apache at runtime. We should be catching all exceptions, and if nothing is appearing in the error logs, the only thing I can suggest is to stick in a whole lot of error logging into the code and trying to figure out where it dies.

Toby

Toby Elliott

unread,
Jul 2, 2010, 6:53:09 PM7/2/10
to mozilla-labs-we...@googlegroups.com
One possibility that occurs - the PUT request is the only one to use json_decode in the php. I know some of the early versions of the json library had problems (usually parse problems, though, not crashers), so you might want to see what version of php you're running and look into a possible upgrade.

Regards,
Toby


On Jul 2, 2010, at 10:13 AM, mor...@morlix.de wrote:

Reply all
Reply to author
Forward
0 new messages