Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boinc client unable to properly communicate with BOINC server (internal 500 error) #16

Closed
grctest opened this issue Aug 29, 2016 · 14 comments

Comments

@grctest
Copy link
Contributor

grctest commented Aug 29, 2016

Hey,

I've been making some good progress with my BOINC project, but I've run into an issue with my project:
https://github.com/grctest/project-rain-site/issues/2

This is preventing me from properly connecting to my project within the BOINC manager client - the account name and team fields do not appear as a result.

My main aim is to provide the ability to match one's CPID (which needs to merge with other project's CPIDs) to multiple cryptocurrency addresses/accounts, so distributing work units isn't planned at the moment.

Without work units, will I continue to encounter this 'internal 500 error'? Or has something else potentially caused this issue?

I'm going to re-fork the boinc-server-docker repo with the aim of not breaking.. what I may have broken.. lol..

Cheers.

@marius311
Copy link
Owner

Good to hear about the progress! Re: the error, I don't think its related to no workunits, probably something is actually wrong. Do you see anything in /var/log/apache2/*.log giving more information? Or what about in ~/project/log_boincserver/*.log?

You could also try enabling some client debug flags, although I'm not sure that'll help, my guess is it'll be in one of aforementioned logs.

@davidpanderson
Copy link
Collaborator

Error 500 means the scheduler crashed.
The way to debug this is:

  • get the scheduler request file (sched_request_xxx.xml)
    and copy it to the server
  • run the scheduler under the debugger, and feed it the request, e.g.
    gdb cgi
    r < sched_request_xxx.xml

This gives you a stack trace for the crash,
which generally shows what the problem is.

-- David

On 8/29/2016 8:14 AM, grctest wrote:

Hey,

I've been making some good progress with my BOINC project, but I've run into an
issue with my project:
grctest/project-rain-site#2 https://github.com/grctest/project-rain-site/issues/2

This is preventing me from properly connecting to my project within the BOINC
manager client - the account name and team fields do not appear as a result.

My main aim is to provide the ability to match one's CPID (which needs to merge
with other project's CPIDs) to multiple cryptocurrency addresses/accounts, so
distributing work units isn't planned at the moment. Without work units, will I
continue to encounter this 'internal 500 error'? Or has something else potentially
caused this issue?

I'm going to re-fork the boinc-server-docker repo with the aim of not breaking..
what I may have broken.. lol..

Cheers.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#16, or mute the thread
https://github.com/notifications/unsubscribe-auth/AA8KgZbf3iWDcfeoLFjuRjWcO5qdpRIWks5qkvdbgaJpZM4Jvk-S.

@grctest
Copy link
Contributor Author

grctest commented Aug 29, 2016

I'll look into the debug flags, in the meantime these are the logs you mentioned:

Apache2 - Access.log: (IP omitted)

IPADDRESS - - [29/Aug/2016:17:44:42 +0000] "POST /boincserver_cgi/cgi HTTP/1.1" 500 782 "-" "BOINC client (x86_64-pc-linux-gnu 7.6.31)"
IPADDRESS - - [29/Aug/2016:17:46:08 +0000] "GET /boincserver/ HTTP/1.1" 200 3424 "-" "BOINC client (x86_64-pc-linux-gnu 7.6.31)"
IPADDRESS - - [29/Aug/2016:17:46:15 +0000] "POST /boincserver_cgi/cgi HTTP/1.1" 500 782 "-" "BOINC client (x86_64-pc-linux-gnu 7.6.31)"
IPADDRESS - - [29/Aug/2016:17:47:52 +0000] "POST /boincserver_cgi/cgi HTTP/1.1" 500 782 "-" "BOINC client (x86_64-pc-linux-gnu 7.6.31)"

Apache2 - Errors.log (Best bet @ what's gone wrong?)

[Mon Aug 29 17:44:42.654522 2016] [cgi:error] [pid 391] [client IPADDRESS:52512] End of script output before headers: cgi
[Mon Aug 29 17:46:15.709651 2016] [cgi:error] [pid 392] [client IPADDRESS:52518] End of script output before headers: cgi
[Mon Aug 29 17:47:52.774137 2016] [cgi:error] [pid 389] [client IPADDRESS:52538] End of script output before headers: cgi

log_boincserver - antique_file_deleter.out

2016-08-29 02:00:02.1162 [CRITICAL] Couldn't find http_user 'apache' in passwd
2016-08-29 02:00:02.1174 [CRITICAL] delete_antiques() returned with error -1

log_boincserver - notify (no timestamp, could be old)
/usr/bin/env: php: No such file or directory

A couple of the other logs in log_boincserver were similar to the above log, but that's probably because the message boards were disabled..

Edit: @davidpanderson I've added the <debug_req_reply_dir> entry to my config.xml file & generated the following files:
639_0_sched.log 639_0_sched_reply.xml 639_0_sched_request.xml

I'll install gdb on the project server to get the stack trace soon, thanks.

Edit:
I tried both the sched_request xml generated on the server, and the sched_request xml created by the BOINC client, I was not successful in performing the stack trace:

(gdb) r < test.xml
Starting program:  < test.xml
No executable file specified.
Use the "file" or "exec-file" command.

@marius311
Copy link
Owner

marius311 commented Aug 30, 2016

I think that error indicates you ran "gdb" instead of "gdb cgi" ? Or maybe you didn't run from "project/cgi-bin" so the executable wasn't found ?

@grctest
Copy link
Contributor Author

grctest commented Aug 30, 2016

I tested the following:

  1. Cloned marius311/boinc-server-docker, rsync'ed the /db/ and /html/ folders from grctest/project-rain-site & resulted in the same error as above.
  2. Just recursive cloned this repo and didn't apply my project-rain-site files, so it's something I've broken with the project-rain-site repo.

I did not run gdb from the project/cgi-bin folder.

Schedule request file collected from the client.

(gdb) r < client_sched_request.xml
Starting program: /root/project/cgi-bin/cgi < client_sched_request.xml
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff40ce700 (LWP 1135)]
[Thread 0x7ffff40ce700 (LWP 1135) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff60718b4 in __GI_____strtod_l_internal (nptr=0x0, endptr=0x0,
    group=<optimized out>, loc=0x7ffff63daf20 <_nl_global_locale>)
    at strtod_l.c:600
600     strtod_l.c: No such file or directory.

Schedule request debug file created by the server:

(gdb) r < 639_0_sched_request.xml
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /root/project/cgi-bin/cgi < 639_0_sched_request.xml
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff40ce700 (LWP 1137)]
[Thread 0x7ffff40ce700 (LWP 1137) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff60718b4 in __GI_____strtod_l_internal (nptr=0x0, endptr=0x0,
    group=<optimized out>, loc=0x7ffff63daf20 <_nl_global_locale>)
    at strtod_l.c:600
600     strtod_l.c: No such file or directory.

Could this have been caused by adding new fields to the BOINC website and SQL table?

@marius311
Copy link
Owner

Sounds very plausible. I don't think boinc-server-docker compiles the scheduler with debug info which makes reading that above stack trace difficult, you could add --enable-debug to the ./configure command here (or in the Dockerfile-b2d version if you use that), rebuild the project, then try the gdb trick again. It should give you a better idea where the error is.

Alternatively, the only place in the BOINC source that I see a call to strtod is inside XML_PARSER::parse_double in parse.cpp, maybe that's enough of a hint. Anything weird inside any custom XML files you copied in, or inside that scheduler request XML, regarding doubles?

@grctest
Copy link
Contributor Author

grctest commented Aug 30, 2016

Added --enable-debug to the ./configure command, and successfully ran the command but it shows a very similar output:

(gdb) r < client-test.xml
Starting program: /root/project/cgi-bin/cgi < client-test.xml
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff40ce700 (LWP 331)]
[Thread 0x7ffff40ce700 (LWP 331) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff60718b4 in __GI_____strtod_l_internal (nptr=0x0, endptr=0x0,
group=, loc=0x7ffff63daf20 <_nl_global_locale>)
at strtod_l.c:600
600 strtod_l.c: No such file or directory.

Most likely culprits:
https://github.com/grctest/project-rain-site/blob/master/BOINC%20Server%20files/db/boinc_db.cpp
https://github.com/grctest/project-rain-site/blob/master/BOINC%20Server%20files/db/boinc_db_types.h
https://github.com/grctest/project-rain-site/blob/master/BOINC%20Server%20files/db/schema.sql

Going to try edit the 3 files above to fix this ongoing issue.

I'm most uncertain about these lines: (Perhaps I need to split it up into multiple lines instead of 1?)
https://github.com/grctest/project-rain-site/blob/master/BOINC%20Server%20files/db/boinc_db.cpp#L359
https://github.com/grctest/project-rain-site/blob/master/BOINC%20Server%20files/db/boinc_db.cpp#L371

I don't recall adding any new 'double' fields anywhere..

@marius311
Copy link
Owner

Sounds like you're on the right track so this may not be necessary, but just remembered you also need to execute bt from gdb after its crashed to print out the full stack trace so you can exactly where you're at when it died.

@grctest
Copy link
Contributor Author

grctest commented Aug 30, 2016

(gdb) bt
#0 0x00007ffff60718b4 in __GI_____strtod_l_internal (nptr=0x0, endptr=0x0,
group=, loc=0x7ffff63daf20 <_nl_global_locale>)
at strtod_l.c:600
#1 0x0000000000442949 in atof (__nptr=)
at /usr/include/x86_64-linux-gnu/bits/stdlib-float.h:28
#2 DB_USER::db_parse (this=0x7ffffff67490, r=@0x7ffffff0f6e8: 0x6aa408)
at ../db/boinc_db.cpp:427

Relevant line in boinc_db.cpp: https://github.com/grctest/project-rain-site/blob/master/BOINC%20Server%20files/db/boinc_db.cpp#L427

The lines before 427 were where I added the new fields, I pretty much just copied the format of the postal code. I believe I need to redo the boinc_db and boinc_db_types files.

#3 0x000000000044bd42 in DB_BASE::lookup (this=0x7ffffff67490,
clause=) at ../db/db_base.cpp:349
#4 0x000000000040c4bf in authenticate_user () at handle_request.cpp:381
#5 0x000000000040dd8d in process_request (
code_sign_key=code_sign_key@entry=0x68a6f0 "1024\nba4fcdf8e37b5f0db09af89f74ddbd364eafd943cbdb443cb2c1e340d28276e3\ned4f5f213c0abbbd92ad649b7d993c6c6d4ea78ea52597df80baa022804d42d5\n30a0b608befb04accf3514fa442487482b8e23d22e0886292a5ee70aa3530db2\n"...) at handle_request.cpp:1255
#6 0x000000000040fbc8 in handle_request (fin=,
fout=0x7ffff63db2a0 <IO_2_1_stdout>,
code_sign_key=0x68a6f0 "1024\nba4fcdf8e37b5f0db09af89f74ddbd364eafd943cbdb443cb2c1e340d28276e3\ned4f5f213c0abbbd92ad649b7d993c6c6d4ea78ea52597df80baa022804d42d5\n30a0b608befb04accf3514fa442487482b8e23d22e0886292a5ee70aa3530db2\n"...)
at handle_request.cpp:1504
#7 0x0000000000405a2d in main (argc=0, argv=0x0) at sched_main.cpp:661

@davidpanderson
Copy link
Collaborator

If you need to add more per-user info to the database, you might want to do this using a new table that references the user table. See, e.g. the user_submit table.

@grctest
Copy link
Contributor Author

grctest commented Aug 31, 2016

Ok, I've begun moving the new fields out of the user table into dedicated tables:
https://github.com/grctest/project-rain-site/commit/c421e84bc1b6df422a34b64e50873dd1aefbbf07
https://github.com/grctest/project-rain-site/tree/master/BOINC%20Server%20files/db

I'll close this issue for the time being - I've got to figure out what to edit in the BOINC web server PHP to apply the new user data to the new table.

Cheers, guys!

@grctest grctest closed this as completed Aug 31, 2016
@grctest
Copy link
Contributor Author

grctest commented Sep 1, 2016

I've moved the new fields into its own table called project_rain, however I've hit a new issue due to my lack of c++ knowledge (only the linked bottom log is relevant, the prior logs are previous builds).

I'd appreciate some pointers as to what I've done wrong if you've got some spare time: https://github.com/grctest/project-rain-site/issues/3#issuecomment-243955881

Cheers :)

@davidpanderson
Copy link
Collaborator

This means that a derived class doesn't define one of the virtual functions
of its base class.
I suggest that you look on stackoverflow, or post to boinc_dev or boinc_projects.
-- David

On 9/1/2016 3:18 PM, grctest wrote:

I've moved the new fields into its own table called project_rain, however I've hit
a new issues due to my lack of c++ knowledge.

I'd appreciate some pointers as to what I've done wrong if you've got some spare
time: grctest/project-rain-site#3 (comment)
https://github.com/grctest/project-rain-site/issues/3#issuecomment-243955881

Cheers :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#16 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA8KgYHOT7f8g8kMVP3KziWqTN200VcGks5ql09RgaJpZM4Jvk-S.

@grctest
Copy link
Contributor Author

grctest commented Sep 7, 2016

Quick follow up: https://steemit.com/beyondbitcoin/@cm-steem/project-rain-update-regarding-development

TL;DR: I managed to create the new table & present the data on the web server.

Thanks for the help with this issue! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants