KBEC-00263 - Stalled jobs on CloudBees CD (CloudBees Flow) using the built-in database

Article ID:360032828772
2 minute readKnowledge base

Problem

This article refers specifically to the built-in database shipped with CloudBees CD (CloudBees Flow).

Using the built-in database supplied by CloudBees CD (CloudBees Flow) exposed some obscure scenarios that you may require some workarounds:

  • CloudBees CD (CloudBees Flow) takes an unexpectedly long time to start up

  • Your CloudBees CD (CloudBees Flow) instance has jobs that never end

  • You cannot delete some jobs from the CloudBees CD (CloudBees Flow) UI

  • CloudBees CD (CloudBees Flow) is unable to export your projects because of these same jobs

Solution for 4.2.x

Below is a description of how to access the built-in database directly, for example, how to remove a job you cannot kill through the Commander UI.

  1. Stop ElectricCommander. (If it’s still running, the databse lock will prevent you from accessing it.)

  2. Go to to the Commander installation directory and start the database web UI console:

 jre/bin/java -jar server/lib/h2.jar -web -webAllowOthers

Options used:

-web: launch the database’s web UI console

-webAllowOthers: allow access to the database’s web UI console from remote hosts

  1. Type http://localhost:8082 in the browser address bar to access the built-in database’s web UI console.

  2. Use the following parameters when asked to log in:

Driver class: org.h2.Driver

JDBC URL: jdbc:h2:builtin/commander

login: sa

pwd: sa

  1. Click Connect. The interface that appears in your browser allows you to look at the tables and/or create SQL statements.

Example: To kill a job with ID '550558' run the following commands:

update ec_job_step set status = 'completed' where job_id = 55058;





 delete from ec_resource_usage where job_id = 55058;





 update ec_resource set job_id = null where job_id = 55058;
  1. Before restarting ElectricCommander, stop the database’s web UI console by pressing in the terminal.

Some database tips (https://www.h2database.com/html/tutorial.html) that may be useful.