Issue #1356: Running Rainbow in Command line with a custom Pipeline opens the GUI (okapiframework/okapi)

1 view
Skip to first unread message

matijakovac

unread,
May 15, 2024, 11:26:07 AM5/15/24
to okapi-...@googlegroups.com
New issue 1356: Running Rainbow in Command line with a custom Pipeline opens the GUI
https://bitbucket.org/okapiframework/okapi/issues/1356/running-rainbow-in-command-line-with-a

Matija Kovač:

Hi,
I’m building a Flask API server around some of the Okapi functionality. I was having an issue with Tikal and wanted to use more of the advanced functionality available in the Okapi Rainbow, but there are issues when running Rainbow in a headless environment, in my case running the Java subprocess as part of the Python app inside a Docker container.

Here’s an example of a command that works perfectly fine and returns a working XLF file:

```
rainbow.sh -x TranslationKitCreation -sl en -tl fr someFile.docx -o someFile.docx.xlf
```


But when trying to run a custom pipeline, like this:

```
rainbow.sh -pln myPipeline.pln -sl en -tl sl someFile.docx -o someFile.docx.xlf
```

the system is trying to open the GUI app and since I’m in a headless server I get this error:

```
Unable to init server: Could not connect: Connection refused
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
    at org.eclipse.swt.SWT.error(SWT.java:4944)
    at org.eclipse.swt.widgets.Display.createDisplay(Display.java:1199)
    at org.eclipse.swt.widgets.Display.create(Display.java:1123)
    at org.eclipse.swt.graphics.Device.<init>(Device.java:167)
    at org.eclipse.swt.widgets.Display.<init>(Display.java:632)
    at org.eclipse.swt.widgets.Display.<init>(Display.java:623)
    at net.sf.okapi.applications.rainbow.Main.main(Main.java:30)
```

I am of course running rainbow.sh with `-Djava.awt.headless=true` and trying to enforce this both the Docker environment and the function where this command is executed.

So, it works fine with just the -x and the pipeline ID, but it doesn’t work with a pipeline file.
Am I passing the parameters correctly? I tried countless options, such as with and without the -x, putting the pipeline filename in ““ and others, but I always get hit with the same error - Rainbow tries to launch the GUI app.

At this point I’d be happy to look at any workaround as I’ve been dealing with this for too many hours.

Reply all
Reply to author
Forward
0 new messages