Custom Tool Works Only When Gunicorn Encounters Port Error – Need Help Resolving Issue

Hi Community,

I’m working on integrating a custom tool into local Galaxy on server, and I’ve encountered a strange issue. The tool runs successfully only when Gunicorn gives a port conflict error. Here’s a detailed description of the problem:

I’m developing a custom tool for Galaxy, which involves running a simple ‘Hello World’ Nextflow script. The tool works successfully when tested with Planemo, but when deployed to Galaxy, its behavior depends on how Galaxy is started:

Scenario 1:
If Galaxy is already running in one terminal and I mistakenly start it again in another terminal, I discovered that the tool executes successfully despite the following Gunicorn error:

[2024-11-15 08:37:10 +0000] [23950] [ERROR] Connection in use: ('0.0.0.0', 8080)
[2024-11-15 08:37:10 +0000] [ERROR] Retrying in 1 second.
[2024-11-15 08:37:15 +0000] [ERROR] Can't connect to ('0.0.0.0', 8080)
2024-11-15 08:37:18,857 WARN exited: gunicorn (exit status 1; not expected)

In this case, the tool executes successfully, producing the expected output.

Scenario 2:
If I stop Galaxy, kill all Gunicorn processes using pkill gunicorn, and then restart Galaxy, the tool stalls indefinitely and does not produce any output.

Could this issue be related to Gunicorn specifically, or might it indicate a problem with Galaxy’s process management in the background? How can I ensure that the tool runs reliably?

I’d appreciate any insights or suggestions to debug this issue further. Logs or additional configuration details can be provided if needed.

Thank you in advance for your help!

Hi @gozdekb

So, Gunicorn is disabled in Planemo, correct?

Xref: planemo.galaxy.config — Planemo 0.75.27.dev0 documentation

So that is a pretty good clue that your hunch here is on the right track. That assumes Galaxy versions are the same, etc. You are welcome to post more details about that – version, custom settings.

And that is about as far as I can personally help! Let’s try to bring in others to help with more. I’ve cross posted this over the development chat for that. Feel free to join the chat, too! :slight_smile: You're invited to talk on Matrix

1 Like

@gozdekb how do you deploy Galaxy. Are you using gravity and the galaxyctl utility? You can start and stop Galaxy with galaxyctl and then it should work.

Galaxy has more processes than gunicorn and it would be that we have multiple processes running that don’t work together - but this depends on how you deploy Galaxy.

If planemo is happy you should be happy :slight_smile: Please feel free to submit your tools to GitHub - galaxyproject/tools-iuc: Tool Shed repositories maintained by the Intergalactic Utilities Commission … we will help you reviewing it and deploy it to the toolshed if you like.

1 Like

Dear @bjoern.gruening,

Thank you so much for helping me realize that the issue stemmed from the deployment method I was using for Galaxy. Switching to galaxyctl start instead of sh run.sh resolved my issue with Nextflow integration perfectly.

I had been using Galaxy with its default setup, including Gravity, but wasn’t aware of the distinction between these two methods for starting Galaxy. Your advice not only helped solve my immediate problem but also taught me a more robust way to manage my Galaxy instance.

I truly appreciate your support and the time you took to help. Thank you again!

2 Likes