New Installation

New Installation

by Giuseppe Sportelli -
Number of replies: 7

Hi, all

i've installed jobe on debian 4.19 and

when i lanch testsubmit.py

i receive that the test fail.

All errors are of type:

***************** HTTP ERROR ******************

 Response: 500 Internal Server Error
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>An uncaught Exception was encountered</h4>

<p>Type: ParseError</p>
<p>Message: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)</p>
<p>Filename: /var/www/html/jobe/application/libraries/LanguageTask.php</p>
<p>Line Number: 63</p>


    <p>Backtrace:</p>
    
       
    
       
            <p style="margin-left:10px">
            File: /var/www/html/jobe/index.php<br />
            Line: 315<br />
            Function: require_once            </p>
       
    

</div>

how do i resolve  ?

When i open the browser

the testpage fails with same php error.

Tnank for attention


In reply to Giuseppe Sportelli

Re: New Installation

by Richard Lobb -
Please confirm your code in /var/www/html/jobe/application/libraries/LanguageTask.php is the same as the code in the git repo: https://github.com/trampgeek/jobe/blob/master/application/libraries/LanguageTask.php. Look particularly at lines 62 - 64.

I don't see any syntax error around line 63, and the code runs OK on my servers.
In reply to Richard Lobb

Re: New Installation

by Giuseppe Sportelli -

Hello thank for reply

At line 62 to 64

on my installation

public string $id;             // The task id - use the workdir basename
    public string $input;          // Stdin for this task
    public string $sourceFileName; // The name to give the source file
    public string $executableFileName;  // The name of the compiled (if necessary) executable
    public array $params;          // Request parameters

    public ?int $userId = null;     // The user id (number counting from 0).
    public ?string $user;           // The corresponding

i have cloned git source like explained in README.

Thank you


In reply to Giuseppe Sportelli

Re: New Installation

by Richard Lobb -

I checked the syntax of LanguageTask.php on this website and it's fine with PHP 8.0 and PHP 7.4 but fails with exactly your error with PHP 5.6. So, short answer: your system is too old.

Possible workarounds (which may or may not be possible/workable):

  1. Update to a newer version of PHP.
  2. Run the Docker image JobeInABox instead of installing "native" Jobe.
  3. Upgrade your OS.
  4. Back off to a very old version of Jobe.
In reply to Richard Lobb

Re: New Installation

by Giuseppe Sportelli -
Hello Richard My os is debian 4.1
php -v says  7.3.31-1
on docker.
Is it need to upgrade ?
Thank you
In reply to Giuseppe Sportelli

Re: New Installation

by Richard Lobb -
Well, your version of PHP doesn't run the current version of Jobe and I'm not about to try to make the code backward compatible with such an old version of PHP. So your options are as above, with two further additions:

5. Try to figure out why the current code doesn't work with your version of PHP and modify it.
6. Don't use Jobe.
In reply to Richard Lobb

Re: New Installation

by Giuseppe Sportelli -
Hi, Richard thank you.
I have upgraded to debian 12 with php 8.0
and now Jobe work fine.
Have i a question, how to change tcp port where Jobe listen ?
I want to change for security reason.

In reply to Giuseppe Sportelli

Re: New Installation

by Richard Lobb -
I've never been convinced there was a good reason to use https to Jobe - it just adds to the overhead. There's nothing very vital travelling on the connection and if your Jobe server is properly firewalled the risks are minimal. Jobe is not a webserver in the normal sense, so most of the so-called security risks with port 80 don't apply.

However, if you insist: you need a reverse proxy between the Moodle server and Jobe. The easiest way to achieve this is perhaps to use a JobeInABox Docker container on your Jobe server, running on some port like 5000. Then, assuming the Jobe host server also runs Apache, enable the site `000-default-le-ssl.conf` and edit the VirtualHost entry to include lines like

    # Proxy configuration for /jobe ...
    ProxyPass "/jobe" "http://localhost:5000/jobe"
    ProxyPassReverse "/jobe" "http://localhost:5000/jobe"

Then, enable mod proxy, mod_proxy_http and mod_ssl with the commands

    sudo a2enmod proxy
    sudo a2enmod proxy_http
    sudo a2enmod ssl

and restart Apache.

You then need to prefix the Jobe host name in the CodeRunner settings with https://