Table jobs not found: Job Composer Error

We have been considering the idea you mention, as we have been having multiple permissions issues with this client since the beginning during the installation we have been trying to create one of these empty files “production.sqlitle3” trying to launch the Job Composer.
With this file I try to test if the python sqlitle3 module can interact with the file using a small script, in this case we use to create two tables (jobs and workflow)

Something like this:

import sqlite3

# Ruta completa al archivo production.sqlite3
db_path = 'production.sqlite3'

# Conectar a la base de datos
conn = sqlite3.connect(db_path)

try:
    # Crear un objeto cursor para ejecutar comandos SQL
    cursor = conn.cursor()

    # Crear la tabla 'jobs' (si no existe)
    cursor.execute('''CREATE TABLE IF NOT EXISTS jobs
                      (id INTEGER PRIMARY KEY, title TEXT, salary REAL)''')

   # Crear la tabla 'jobs' (si no existe)
    cursor.execute('''CREATE TABLE IF NOT EXISTS workflows
                      (id INTEGER PRIMARY KEY, title TEXT, salary REAL)''')
    # Obtener la lista de tablas
    cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
    tablas = cursor.fetchall()

    # Imprimir las tablas
    print("Tablas en la base de datos:")
    for tabla in tablas:
        print(tabla[0])

finally:
    # Cerrar la conexión a la base de datos, independientemente de si hubo errores o no
    print("Close")
    conn.close()


We ran this as the user ‘ortegae’ and it seems to create the tables, in fact if we try to launch the Job Composer now the logs say that the columns in these tables are not correct. So in my opinion it is likely that Open Ondemand is having permissions issues interacting with this database, as we were having permissions issues elsewhere in the installation. But from here I don’t know how to check it, can you think of anything?

Once again thank you very much for the help you give us.

The file listed above is how we setup the database when you navigate through the navigation bar. You can try to run that manually to see what it does. It should be in /var/www/ood/apps/myjobs/bin/setup-production. You may need to source /opt/ood/enable to get the right ruby version and gems loaded up.

rm ~/ondemand/data/sys/myjobs/production.sqlite3
source /opt/ood/enable
/var/www/ood/apps/myjobs/bin/setup-production

Or if you notice the last command in that ruby script - you can try to just run the rake task that sets up the database.

rm ~/ondemand/data/sys/myjobs/production.sqlite3
source /opt/ood/enable
cd /var/www/ood/apps/myjobs
RAILS_ENV=production bin/rake db:setup

Do all of these as an unprivileged user (i.e., a real user, not root) to replicate the database setup.

Hello again!
We have done this test you propose and we have found a problem with the db configuration as we suspected.
The execution cannot be performed by a non-root user, we have tested this once again in our local environment and we have seen that it works perfectly, so I guess we will have to contact the client to see why these executions fail (probably because of permissions issues like all the failures so far).

Hello everybody again!

We have managed to fix the problem, as we suspected the main problem was related to permissions on the execution of the binaries.
Our customer says that the partition on the machine is mounted as “noexec” as they do by default, so with this the OOD will not work correctly. By changing this mount option we have solved all the problems in the list, so now we have everything ready to work.

Once again thanks for your work and guidance Jeff.
Best regards!!!

1 Like

:man_facepalming: OK so setup-production was not executable!? OK, I’ll file a ticket upstream as we should have seen that error message in your logs.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.