trampgeek / jobeinabox

The dockerfile and doc for building the Docker image JobeInABox
MIT License
12 stars 29 forks source link

PHP Error #16

Closed utkarshsystem closed 1 year ago

utkarshsystem commented 1 year ago

The new image of jobe server is throwing PHP error

image

trampgeek commented 1 year ago

I have recently become aware of 'unable to fork' problems on hosts running nginx. Is that your situation? If so, I will be pushing a bug fix in the next few days.

If you're not running jobeinabox on an nginx server, please send me the full output from the testsubmit.py testsuite (see here) and describe your host configuration - base OS, number of CPUs, memory size.

Note that for performance and security reasons, it is strongly recommended that jobeinabox be used only on a dedicated and tightly-firewalled stand-alone server, not one providing other services.

utkarshsystem commented 1 year ago

Yes, we are running on nginx

Base OS: Ubuntu 20.4 CPU: 1 Memory: 4 GB

A PHP Error was encountered Severity: Warning

Message: exec(): Unable to fork [gcc --version 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

File: /var/www/html/jobe/application/libraries/LanguageTask.php Line: 518 Function: exec

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 336 Function: getVersion

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 54 Function: supported_languages

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

A PHP Error was encountered Severity: Warning

Message: exec(): Unable to fork [gcc --version 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

File: /var/www/html/jobe/application/libraries/LanguageTask.php Line: 518 Function: exec

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 336 Function: getVersion

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 54 Function: supported_languages

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

A PHP Error was encountered Severity: Warning

Message: exec(): Unable to fork [java -version 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

File: /var/www/html/jobe/application/libraries/LanguageTask.php Line: 518 Function: exec

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 336 Function: getVersion

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 54 Function: supported_languages

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

A PHP Error was encountered Severity: Warning

Message: exec(): Unable to fork [/usr/local/bin/matlab_exec_cli -nodisplay -nojvm -nosplash -r exit 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

File: /var/www/html/jobe/application/libraries/LanguageTask.php Line: 518 Function: exec

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 336 Function: getVersion

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 54 Function: supported_languages

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

A PHP Error was encountered Severity: Warning

Message: exec(): Unable to fork [nodejs --version 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

File: /var/www/html/jobe/application/libraries/LanguageTask.php Line: 518 Function: exec

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 336 Function: getVersion

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 54 Function: supported_languages

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

A PHP Error was encountered Severity: Warning

Message: exec(): Unable to fork [octave --version --norc --no-window-system --silent 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

File: /var/www/html/jobe/application/libraries/LanguageTask.php Line: 518 Function: exec

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 336 Function: getVersion

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 54 Function: supported_languages

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

A PHP Error was encountered Severity: Warning

Message: exec(): Unable to fork [fpc -iV 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

File: /var/www/html/jobe/application/libraries/LanguageTask.php Line: 518 Function: exec

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 336 Function: getVersion

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 54 Function: supported_languages

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

A PHP Error was encountered Severity: Warning

Message: exec(): Unable to fork [php --version 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

File: /var/www/html/jobe/application/libraries/LanguageTask.php Line: 518 Function: exec

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 336 Function: getVersion

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 54 Function: supported_languages

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

A PHP Error was encountered Severity: Warning

Message: exec(): Unable to fork [python2 --version 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

File: /var/www/html/jobe/application/libraries/LanguageTask.php Line: 518 Function: exec

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 336 Function: getVersion

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 54 Function: supported_languages

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

A PHP Error was encountered Severity: Warning

Message: exec(): Unable to fork [python3 --version 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

File: /var/www/html/jobe/application/libraries/LanguageTask.php Line: 518 Function: exec

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 336 Function: getVersion

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 54 Function: supported_languages

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

A PHP Error was encountered Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/html/jobe/system/core/Exceptions.php:271)

Filename: core/Common.php

Line Number: 570

Backtrace:

File: /var/www/html/jobe/application/libraries/REST_Controller.php Line: 871 Function: set_status_header

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 82 Function: response

File: /var/www/html/jobe/application/libraries/REST_Controller.php Line: 793 Function: index_get

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

trampgeek commented 1 year ago

If you're running nginx on the same server you'll have to wait for the bug fix. Note that jobeinabox does not need to be run on a host that has any sort of web server running on it - the web services are provided within the container. So if this is a dedicated Jobe server you can simply shut down nginx.

trampgeek commented 1 year ago

I've pushed changes to Jobe and the Dockerfile for building JobeInABox which I hope deals with the conflict with nginx on the server. The jobeinabox:latest image on Docker Hub has also been updated.

The symptoms you report aren't quite the same as others are reporting, so I'm keen to know whether the fix that I've just pushed solves your problems as well. Please check and let me know the outcome.

utkarshsystem commented 1 year ago

We are still facing the same issue? What PHP version you're using? I think if you update the PHP version to 8.2 in your image it will work

image

utkarshsystem commented 1 year ago

A PHP Error was encountered Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/html/jobe/system/core/Exceptions.php:271)

Filename: core/Common.php

Line Number: 570

Backtrace:

File: /var/www/html/jobe/application/libraries/REST_Controller.php Line: 871 Function: set_status_header

File: /var/www/html/jobe/application/controllers/Restapi.php Line: 82 Function: response

File: /var/www/html/jobe/application/libraries/REST_Controller.php Line: 793 Function: index_get

File: /var/www/html/jobe/index.php Line: 315 Function: require_once

"Please access this API via the runs, runresults, files or languages collections"

utkarshsystem commented 1 year ago

PHP version output

php -version

PHP 8.1.2-1ubuntu2.11 (cli) (built: Feb 22 2023 22:56:18) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.2, Copyright (c) Zend Technologies with Zend OPcache v8.1.2-1ubuntu2.11, Copyright (c), by Zend Technologies #

trampgeek commented 1 year ago

I just created a new host on Digital Ocean: 1 CPU, 1 GB RAM, Ubuntu 20:04. I logged into it as root and ran the following commands:

apt update
apt install docker.io
docker run -d -p 4000:80 --name jobe trampgeek/jobeinabox:latest

JobeInABox ran just fine in that configuration, verified by the command

docker exec -t jobe /usr/bin/python3 /var/www/html/jobe/testsubmit.py

Can you confirm, please, that you are running jobeinabox (the containerised version of jobe) rather than installing Jobe directly on the host?

I don't think the version of PHP should be relevant here. It shouldn't matter what version is installed on the host. In the container (assuming you're running the prebuilt image) it's indeed PHP 8.1.2. But why do you think changing the version in the container to PHP 8.2 is going to help?

utkarshsystem commented 1 year ago

Did you try to run REST calls? Whenever you invoke REST calls it calls PHP code.

On Mon, 5 Jun 2023 at 19:41, Richard Lobb @.***> wrote:

I just created a new host on Digital Ocean: 1 CPU, 1 GB RAM, Ubuntu 20:04. I logged into it as root and ran the following commands:

apt update apt install docker.io docker run -d -p 4000:80 --name jobe trampgeek/jobeinabox:latest

JobeInABox ran just fine in that configuration, verified by the command

docker exec -t jobe /usr/bin/python3 /var/www/html/jobe/testsubmit.py

Can you confirm, please, that you are running jobeinabox (the containerised version of jobe) rather than installing Jobe directly on the host?

I don't think the version of PHP should be relevant here. It's shouldn't matter what version is installed on the host. In the container (assuming you're running the prebuilt image) it's indeed PHP 8.1.2. But why do you think changing the version in the container to PHP 8.2 is going to help?

— Reply to this email directly, view it on GitHub https://github.com/trampgeek/jobeinabox/issues/16#issuecomment-1577691992, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALCMXYYT65MG2IHEAWKZTTXJZVEPANCNFSM6AAAAAAYYPUPXM . You are receiving this because you authored the thread.Message ID: @.***>

trampgeek commented 1 year ago

Sure - any tests you do with JobeInABox should involve REST calls, which indeed use PHP inside the container. The testsubmit.py test suite does lots of REST calls - that's all it does.

This conversation has taken some odd twists and I'm getting the feeling that you are not using JobeInABox in the manner intended. JobeInABox gives you a container that provides REST services to programs outside the container, but I'm starting to wonder if you are trying to use it with your own code inside the container.

Please execute the following terminal commands as root on your host:

docker run -d -p 5000:80 --name jobetester trampgeek/jobeinabox:latest
docker cp jobetester:/var/www/html/jobe/testsubmit.py .
python3 testsubmit.py --host localhost --port 5000

See below for the output your should get from the last of those three commands. If you get that, JobeInABox would seem to be working fine. If you don't get that, please copy and paste the entire contents of the terminal window including all commands you typed into a text file and attach it to your response.

Expected output if all is well:

root@ubuntu-20-04-tester:~# python3 testsubmit.py --host localhost --port 5000
Supported languages:
    c: 11.3.0
    cpp: 11.3.0
    java: 11.0.19
    nodejs: 12.22.9
    octave: 6.4.0
    pascal: 3.2.2
    php: 8.1.2
    python3: 3.10.6

Valid Python3 OK
Python3 with stdin OK
Syntactically invalid Python3 OK
Python3 runtime error OK
Python3 file I/O OK
Testing use of interpreter args with Python3 OK
Testing use of runargs args with Python3 OK
Python3 program with customised timeout OK
Python3 program with support files OK
Valid Python3/pylint program OK
Invalid Python3/pylint program OK
UTF-8 output from Python3 (will fail unless Jobe set up for UTF-8) OK
Test good C hello world OK
Test compile error C hello world OK
Test use of compileargs with C OK
Test runtime error C hello world OK
Test timelimit on C OK
Test outputlimit on C OK
Memory limit exceeded in C (seg faults) OK
Infinite recursion (stack error) on C OK
C program controlled forking OK
A C program with ASCII non-UTF-8-compatible output OK
Valid Octave OK
octave with stdin OK
Syntactically invalid Octave (treated as runtime error) OK
Syntactically valid Nodejs hello world OK
Syntactically invalid Nodejs OK
Correct Php program  OK
Syntactically incorrect Php program  OK
Syntactically incorrect Php program  OK
Correct Java program  OK
Correct Java program without supplied sourcefilename  OK
Syntactically incorrect Java program  OK
Java program with a support class (.java) OK
Java program with Unicode output (will fail unless Jobe set up for UTF-8)  OK
Test good C++ hello world OK
Test compile error C++ hello world OK
Good Hello world Pascal test OK
Fail Hello world Pascal test OK

39 tests, 39 passed, 0 failed, 0 exceptions

Checking parallel submissions in C
Test good C hello world OK
Test good C hello world OK
Test good C hello world OK
Test good C hello world OK
Test good C hello world OK
Test good C hello world OK
Test good C hello world OK
Test good C hello world OK
Test good C hello world OK
Test good C hello world OK
All done

Testing a submission with an excessive cputime parameter
OK
root@ubuntu-20-04-tester:~# 
utkarshsystem commented 1 year ago
                    <p style="margin-left:10px">
                    File: /var/www/html/jobe/index.php<br />
                    Line: 315<br />
                    Function: require_once                  </p>

"Language 'pascal' is not known"

39 tests, 0 passed, 0 failed, 39 exceptions

Checking parallel submissions in C Traceback (most recent call last): File "/var/www/html/jobe/testsubmit.py", line 1123, in sys.exit(main()) File "/var/www/html/jobe/testsubmit.py", line 1116, in main return normal_testing(langs_to_run) File "/var/www/html/jobe/testsubmit.py", line 1010, in normal_testing check_multiple_submissions(job, NUM_PARALLEL_SUBMITS, 0) File "/var/www/html/jobe/testsubmit.py", line 737, in check_multiple_submissions t.start() File "/usr/lib/python3.10/threading.py", line 935, in start _start_new_thread(self._bootstrap, ()) RuntimeError: can't start new thread

: not found

^[[A^[[A

in/sh: 12:

# #

top

top - 13:27:37 up 5:12, 0 users, load average: 0.12, 0.17, 0.12 Tasks: 9 total, 1 running, 8 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.8 us, 0.8 sy, 0.0 ni, 97.0 id, 0.0 wa, 0.0 hi, 0.0 si, 1.3 st MiB Mem : 1939.7 total, 130.1 free, 404.2 used, 1405.4 buff/cache MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1370.4 avail Mem

PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+

COMMAND 1 root 20 0 2888 956 860 S 0.0 0.0 0:00.03 apache2ctl 9 root 20 0 201536 22940 17996 S 0.0 1.2 0:00.05 apache2 10 www-data 20 0 201816 18100 11632 S 0.0 0.9 0:00.10 apache2 11 www-data 20 0 201824 16368 10840 S 0.0 0.8 0:00.04 apache2 12 www-data 20 0 201808 16328 10836 S 0.0 0.8 0:00.04 apache2 13 www-data 20 0 201808 16332 10840 S 0.0 0.8 0:00.03 apache2 14 www-data 20 0 201808 16368 10836 S 0.0 0.8 0:00.04 apache2 22 root 20 0 2888 932 836 S 0.0 0.0 0:00.03 sh 33 root 20 0 7820 3484 2876 R 0.0 0.2 0:00.00 top

On Tue, 6 Jun 2023 at 18:29, Richard Lobb @.***> wrote:

Sure - any tests you do with JobeInABox should involve REST calls, which indeed use PHP inside the container. The testsubmit.py test suite does lots of REST calls - that's all it does.

This conversation has taken some odd twists and I'm getting the feeling that you are not using JobeInABox in the manner intended. JobeInABox gives you a container that provides REST services to programs outside the container, but I'm starting to wonder if you are trying to use it with your own code inside the container.

Please execute the following terminal commands as root on your host:

docker run -d -p 5000:80 --name jobetester trampgeek/jobeinabox:latest docker cp jobetester:/var/www/html/jobe/testsubmit.py . python3 testsubmit.py --host localhost --port 5000

See below for the output your should get from the last of those three commands. If you get that, JobeInABox would seem to be working fine. If you don't get that, please copy and paste the entire contents of the terminal window including all commands you typed into a text file and attach it to your response.

Expected output if all is well:

@.***:~# python3 testsubmit.py --host localhost --port 5000 Supported languages: c: 11.3.0 cpp: 11.3.0 java: 11.0.19 nodejs: 12.22.9 octave: 6.4.0 pascal: 3.2.2 php: 8.1.2 python3: 3.10.6

Valid Python3 OK Python3 with stdin OK Syntactically invalid Python3 OK Python3 runtime error OK Python3 file I/O OK Testing use of interpreter args with Python3 OK Testing use of runargs args with Python3 OK Python3 program with customised timeout OK Python3 program with support files OK Valid Python3/pylint program OK Invalid Python3/pylint program OK UTF-8 output from Python3 (will fail unless Jobe set up for UTF-8) OK Test good C hello world OK Test compile error C hello world OK Test use of compileargs with C OK Test runtime error C hello world OK Test timelimit on C OK Test outputlimit on C OK Memory limit exceeded in C (seg faults) OK Infinite recursion (stack error) on C OK C program controlled forking OK A C program with ASCII non-UTF-8-compatible output OK Valid Octave OK octave with stdin OK Syntactically invalid Octave (treated as runtime error) OK Syntactically valid Nodejs hello world OK Syntactically invalid Nodejs OK Correct Php program OK Syntactically incorrect Php program OK Syntactically incorrect Php program OK Correct Java program OK Correct Java program without supplied sourcefilename OK Syntactically incorrect Java program OK Java program with a support class (.java) OK Java program with Unicode output (will fail unless Jobe set up for UTF-8) OK Test good C++ hello world OK Test compile error C++ hello world OK Good Hello world Pascal test OK Fail Hello world Pascal test OK

39 tests, 39 passed, 0 failed, 0 exceptions

Checking parallel submissions in C Test good C hello world OK Test good C hello world OK Test good C hello world OK Test good C hello world OK Test good C hello world OK Test good C hello world OK Test good C hello world OK Test good C hello world OK Test good C hello world OK Test good C hello world OK All done

Testing a submission with an excessive cputime parameter OK @.***:~#

— Reply to this email directly, view it on GitHub https://github.com/trampgeek/jobeinabox/issues/16#issuecomment-1579543738, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALCMXYOGRHATCNJDWXUN3LXJ6VL5ANCNFSM6AAAAAAYYPUPXM . You are receiving this because you authored the thread.Message ID: @.***>

utkarshsystem commented 1 year ago

python3 testsubmit.py

Supported languages:

***** HTTP ERROR **

Response: 200 OK

A PHP Error was encountered

Severity: Warning

Message: exec(): Unable to fork [gcc --version 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

File: /var/www/html/jobe/application/libraries/LanguageTask.php
Line: 518
Function: exec

File: /var/www/html/jobe/application/controllers/Restapi.php
Line: 336
Function: getVersion

File: /var/www/html/jobe/application/controllers/Restapi.php
Line: 54
Function: supported_languages

File: /var/www/html/jobe/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: exec(): Unable to fork [gcc --version 2>&1]

Filename: libraries/LanguageTask.php

Line Number: 518

Backtrace:

On Tue, 6 Jun 2023 at 21:30, Sharad Goyal ***@***.***> wrote: > > > > > > >

> File: /var/www/html/jobe/index.php
> Line: 315
> Function: require_once

> > > > >
"Language 'pascal' is not known" > > 39 tests, 0 passed, 0 failed, 39 exceptions > > Checking parallel submissions in C > Traceback (most recent call last): > File "/var/www/html/jobe/testsubmit.py", line 1123, in > sys.exit(main()) > File "/var/www/html/jobe/testsubmit.py", line 1116, in main > return normal_testing(langs_to_run) > File "/var/www/html/jobe/testsubmit.py", line 1010, in normal_testing > check_multiple_submissions(job, NUM_PARALLEL_SUBMITS, 0) > File "/var/www/html/jobe/testsubmit.py", line 737, in > check_multiple_submissions > t.start() > File "/usr/lib/python3.10/threading.py", line 935, in start > _start_new_thread(self._bootstrap, ()) > RuntimeError: can't start new thread > # : not found > # ^[[A^[[A > # in/sh: 12: > # > # > # top > top - 13:27:37 up 5:12, 0 users, load average: 0.12, 0.17, 0.12 > Tasks: 9 total, 1 running, 8 sleeping, 0 stopped, 0 zombie > %Cpu(s): 0.8 us, 0.8 sy, 0.0 ni, 97.0 id, 0.0 wa, 0.0 hi, 0.0 si, > 1.3 st > MiB Mem : 1939.7 total, 130.1 free, 404.2 used, 1405.4 buff/cache > MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1370.4 avail Mem > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ > COMMAND > 1 root 20 0 2888 956 860 S 0.0 0.0 0:00.03 > apache2ctl > 9 root 20 0 201536 22940 17996 S 0.0 1.2 0:00.05 > apache2 > 10 www-data 20 0 201816 18100 11632 S 0.0 0.9 0:00.10 > apache2 > 11 www-data 20 0 201824 16368 10840 S 0.0 0.8 0:00.04 > apache2 > 12 www-data 20 0 201808 16328 10836 S 0.0 0.8 0:00.04 > apache2 > 13 www-data 20 0 201808 16332 10840 S 0.0 0.8 0:00.03 > apache2 > 14 www-data 20 0 201808 16368 10836 S 0.0 0.8 0:00.04 > apache2 > 22 root 20 0 2888 932 836 S 0.0 0.0 0:00.03 sh > 33 root 20 0 7820 3484 2876 R 0.0 0.2 0:00.00 top > > > > On Tue, 6 Jun 2023 at 18:29, Richard Lobb ***@***.***> > wrote: > >> Sure - any tests you do with JobeInABox should involve REST calls, which >> indeed use PHP inside the container. The testsubmit.py test suite does lots >> of REST calls - that's *all* it does. >> >> This conversation has taken some odd twists and I'm getting the feeling >> that you are not using JobeInABox in the manner intended. JobeInABox gives >> you a container that provides REST services to programs outside the >> container, but I'm starting to wonder if you are trying to use it with your >> own code inside the container. >> >> Please execute the following terminal commands as root *on your host*: >> >> docker run -d -p 5000:80 --name jobetester trampgeek/jobeinabox:latest >> docker cp jobetester:/var/www/html/jobe/testsubmit.py . >> python3 testsubmit.py --host localhost --port 5000 >> >> See below for the output your should get from the last of those three >> commands. If you get that, JobeInABox would seem to be working fine. If you >> don't get that, please copy and paste the entire contents of the terminal >> window including all commands you typed into a text file and attach it to >> your response. >> >> *Expected output if all is well:* >> >> ***@***.***:~# python3 testsubmit.py --host localhost --port 5000 >> Supported languages: >> c: 11.3.0 >> cpp: 11.3.0 >> java: 11.0.19 >> nodejs: 12.22.9 >> octave: 6.4.0 >> pascal: 3.2.2 >> php: 8.1.2 >> python3: 3.10.6 >> >> Valid Python3 OK >> Python3 with stdin OK >> Syntactically invalid Python3 OK >> Python3 runtime error OK >> Python3 file I/O OK >> Testing use of interpreter args with Python3 OK >> Testing use of runargs args with Python3 OK >> Python3 program with customised timeout OK >> Python3 program with support files OK >> Valid Python3/pylint program OK >> Invalid Python3/pylint program OK >> UTF-8 output from Python3 (will fail unless Jobe set up for UTF-8) OK >> Test good C hello world OK >> Test compile error C hello world OK >> Test use of compileargs with C OK >> Test runtime error C hello world OK >> Test timelimit on C OK >> Test outputlimit on C OK >> Memory limit exceeded in C (seg faults) OK >> Infinite recursion (stack error) on C OK >> C program controlled forking OK >> A C program with ASCII non-UTF-8-compatible output OK >> Valid Octave OK >> octave with stdin OK >> Syntactically invalid Octave (treated as runtime error) OK >> Syntactically valid Nodejs hello world OK >> Syntactically invalid Nodejs OK >> Correct Php program OK >> Syntactically incorrect Php program OK >> Syntactically incorrect Php program OK >> Correct Java program OK >> Correct Java program without supplied sourcefilename OK >> Syntactically incorrect Java program OK >> Java program with a support class (.java) OK >> Java program with Unicode output (will fail unless Jobe set up for UTF-8) OK >> Test good C++ hello world OK >> Test compile error C++ hello world OK >> Good Hello world Pascal test OK >> Fail Hello world Pascal test OK >> >> 39 tests, 39 passed, 0 failed, 0 exceptions >> >> Checking parallel submissions in C >> Test good C hello world OK >> Test good C hello world OK >> Test good C hello world OK >> Test good C hello world OK >> Test good C hello world OK >> Test good C hello world OK >> Test good C hello world OK >> Test good C hello world OK >> Test good C hello world OK >> Test good C hello world OK >> All done >> >> Testing a submission with an excessive cputime parameter >> OK >> ***@***.***:~# >> >> — >> Reply to this email directly, view it on GitHub >> , >> or unsubscribe >> >> . >> You are receiving this because you authored the thread.Message ID: >> ***@***.***> >> >
utkarshsystem commented 1 year ago

It was working fine till May 31st or June Ist and suddenly stopped working after June Ist or 2nd.

trampgeek commented 1 year ago

This is free open-source software. I am prepared to help you try to fix your problems but you need to answer the questions I ask you exactly, not just send me fragments of output that do not correspond to the questions I am asking. It is impossible for me to debug a situation that I cannot replicate.

So please answer the following questions as fully and completely as possible, numbering your answers.

  1. Please confirm that you are using JobeInABox, the docker containerised version of Jobe, rather than "native" Jobe. This is the JobeInABox repo on github, so I am assuming you're running the container, but some of the output you're showing me just shouldn't be possible if testing the container from outside of it.

  2. Please supply a complete transcript (preferably as an attached file, rather than inline), including the commands themselves, of what happens when you execute the following three teminal commands as root on your host machine

    docker run -d -p 5000:80 --name jobetester trampgeek/jobeinabox:latest
    docker cp jobetester:/var/www/html/jobe/testsubmit.py .
    python3 testsubmit.py --host localhost --port 5000
  3. You say you have a 1 CPU Ubuntu 20.04 server with 4GB of RAM. Is this a server that is solely for running Jobe, or does it run other services as well?

  4. If the server is running other services, what services? If it is not running other services, why is nginx installed on it? [As an aside, a 1 CPU server is pretty minimal, even if all it's running is Jobe. However, that's probably not the cause of your problems. As I showed in an earlier posting, I can run JobeInABox fine on a 1CPU server with 4GB RAM]

  5. Is this Jobe server solely for use with the Moodle CodeRunner plugin or are you using Jobe for some other role? If so, what role?

  6. You say it was working fine until around May 31st or June 1st. Did you upgrade the server in any way around that time, including running up a new JobeInABox? A running JobeInABox container does not auto-update, so if the server started to fail, you must have done something. What?

  7. Why do you think that the version of PHP is relevant to the problems you are having?

utkarshsystem commented 1 year ago

I apologize for my inline messages. I am able to debug more and can confirm it is a PHP problem

I am able to get the correct version inside the container directly on the UNIX prompt and all installations look good

root@6ea9f9f6b386:/tmp# nodejs --version v12.22.9 root@6ea9f9f6b386:/tmp#

Later I created a simple PHP program in the tmp directory

image image

Next, I checked the PHP version image

Finally, I ran a simple hello world.php "Hello, world!PHP Warning: exec(): Unable to fork [whoami] in /tmp/helloworl.php on line 8" image

utkarshsystem commented 1 year ago
  • Please confirm that you are using JobeInABox, the docker containerised version of Jobe, rather than "native" Jobe. This is the JobeInABox repo on github, so I am assuming you're running the container, but some of the output you're showing me just shouldn't be possible if testing the container from outside of it.

yes I am running a docker container

  • Please supply a complete transcript (preferably as an attached file, rather than inline), including the commands themselves, of what happens when you execute the following three teminal commands as root on your host machine

    [errrlo.txt](https://github.com/trampgeek/jobeinabox/files/11682747/errrlo.txt)
    
    docker run -d -p 5000:80 --name jobetester trampgeek/jobeinabox:latest
    docker cp jobetester:/var/www/html/jobe/testsubmit.py .
    python3 testsubmit.py --host localhost --port 5000
  • You say you have a 1 CPU Ubuntu 20.04 server with 4GB of RAM. Is this a server that is solely for running Jobe, or does it run other services as well?

I have 1 CPU and 2GB RAM. We have been running jobe server since last year without having any problems with less than 1 GB RAM. I have increased it to 2GB because this might be a memory problem.

  • If the server is running other services, what services? If it is not running other services, why is nginx installed on it? [As an aside, a 1 CPU server is pretty minimal, even if all it's running is Jobe. However, that's probably not the cause of your problems. As I showed in an earlier posting, I can run JobeInABox fine on a 1CPU server with 4GB RAM] I have provided a dedicated server to the jobe server with 2GB RAM

  • Is this Jobe server solely for use with the Moodle CodeRunner plugin or are you using Jobe for some other role? If so, what role?

Yes

  • You say it was working fine until around May 31st or June 1st. Did you upgrade the server in any way around that time, including running up a new JobeInABox? A running JobeInABox container does not auto-update, so if the server started to fail, you must have done something. What?

No upgrade was done from our side

  • Why do you think that the version of PHP is relevant to the problems you are having? Refer to my previous message where I debugged a simple whoami command inside PHP, and it did not work.
trampgeek commented 1 year ago

Thanks for that information and the extra bit of debugging.

However, your errlo.txt file does not appear to be what I asked for, twice now. I want a direct transcript from a terminal window of the output from the three commands I gave you. Not only do those commands not appear in that file you gave me, but the output appears to be from an attempt by a web server to access Jobe at an inappropriate URL (jobe/index.php). Which is why it contains the message "Please access this API via the runs, runresults, files or languages collections" There should never be a need to visit that URL, and I don't see how it could have arisen from the three commands I gave you.

Your test inside the container, attempting to run helloworl.php, is indeed informative. But it doesn't prove the problem is PHP. It just tells you that when PHP attempted to fork to create a child process within the container it was prevented from doing so, e.g. by a memory limit or a process limit. See for example https://stackoverflow.com/questions/20648949/php-warning-exec-unable-to-fork. There are quite a few possibilities, all essentially related to resource limitations imposed by the OS that probably have nothing to do with JobeInABox. And almost certainly are not related to the version of PHP that's installed inside the container. Those commands run fine in a normal JobeInABox container. So there is something very odd about your environment.

I asked for the precise terminal window output because I wanted to see how you were starting up JobeInABox and how you were testing.

We seem to have some sort of communication problem. Here are the three questions that you don't seem to have answered yet:

  1. Please supply a complete transcript (preferably as an attached file, rather than inline), including the commands themselves, of what happens when you execute the following three teminal commands as root on your host machine

    docker run -d -p 5000:80 --name jobetester trampgeek/jobeinabox:latest
    docker cp jobetester:/var/www/html/jobe/testsubmit.py .
    python3 testsubmit.py --host localhost --port 5000
  2. Is this Jobe server solely for use with the Moodle CodeRunner plugin or are you using Jobe for some other role? If so, what role?

  3. Why is nginx even installed on the server?

And a couple of new questions:

  1. What do you get if you type the command ulimit -a inside the container?

  2. If you type the command bash inside the container (which brings up a new instance of bash), and type the command bash again several times, do you get any errors?

If you don't understand what I'm asking for, please ask for further clarification.

utkarshsystem commented 1 year ago
  1. Attached screen shot image

  2. We have created our own Moodle LMS and we attach job server with the LMS software.

  3. Nginx is not installed on the job server container. We forward request from nginx to JobeServer Container.

  4. ulimit -a response image

  5. Here is the response of bash

image

utkarshsystem commented 1 year ago

I have created a single php command with pwd and it did not work inside the container. It might be possible ubuntu 22 and PHP versions might not be compatible.

php -r "echo 'hi'; echo exec('pwd');";

image

trampgeek commented 1 year ago

I have asked three times now for you to run three simple commands on the host, showing me a complete transcript of the output, including those commands. In your most recent posting you did at last show output corresponding more-or-less to two of those three commands but you did not include the command that started up a new container for testing. And you changed the port number from 5000 to 49513 for some reason. This makes me suspect that you are not running a normal Ubuntu 20:04 host + docker.io environment. Why would you want to change the port number in that way?

JobeInTheBox runs fine on an Ubuntu base OS running standard out-of-the-box docker installed with apt_get install docker.io. See my posting of three days ago showing the three commands I ran on a freshly installed Ubuntu 20.04 system to fire up a working Jobe. Why should you think that there's a problem with Ubuntu 22 and PHP inside the container when the same container works for other people?

I'm pretty sure that the problems you are having are nothing to do with the container itself, but are related to restrictions imposed on the container from outside, either by docker or by the base OS.

The two most likely scenarios I can think of are:

  1. You're not actually running docker.io on a simple Ubuntu 20.04 base OS that is installed on directly on a machine. For example, docker desktop running on Windows imposes various extra restrictions.
  2. You are running docker with UID mapping enabled (see here , so that the root user inside the container is not actually root on the host machine. Furthermore the UID on the host to which root in the container is being mapped must have additional constraints, such as no shell access.

There are at least 2 or 3 thousand Jobe installs running around the world and no-one else is reporting this problem. It's free open-source software. I'm happy to fix bugs in Jobe if you can identify a clear unambiguous flaw, preferably with instructions to allow me to reproduce the issue. But I don't think this is a JobeInTheBox issue - I think it's a problem with how you're running it. I've put quite a lot of time into this already, and I'm sorry but you're going to have to debug this problem yourself from now on.

If you are unable to debug it, I recommend you start up an Ubuntu 22.04 server on Digital Ocean or AWS or similar, and run the three commands I gave earlier (as root):

apt update
apt install docker.io
docker run -d -p 4000:80 --name jobe trampgeek/jobeinabox:latest

That should give you a Jobe server running on port 4000. You can drop the port mapping and use port 80 if you wish. But please do read the JobeInTheBox documentation on docker hub and firewall your server so only you can use it.

A 1GB 1CPU server on Digital Ocean costs $6 per month. I doubt you can even power a normal PC 24/7 for less. Granted that's a very low powered server but so is the one you're testing with, apparently.

Best of luck with your debugging.

trampgeek commented 1 year ago

PS: If you think it's a problem with the version of Ubuntu or PHP, you can just change the base OS in the Dockerfile and build your own image. Instructions are given in the JobeInABox readme.

utkarshsystem commented 1 year ago

I appreciate your prompt reply. We have solved the problem by releasing new image by using the following 3 commands.

sudo apt update sudo apt install containerd sudo apt install docker.io

I never shared the first command because we do AWS ECS cluster deployment. Our deployments are a little different/unique in nature.

trampgeek commented 1 year ago

Thanks for posting back. Good to know the problem is solved.

Just for the benefit on anyone else who lands on this page while searching ...

docker.io is a rather old version of docker, which works fine if all you want is a dedicated server running jobeinabox. It's the quickest way to get up and running. However, if you are running other services, or just want a more up-to-date version of docker, you can install docker-ce, following the instructions given here (for Ubuntu 22.04).

I'll close this now utkarshsystem. Hope things go OK from now on.