oktadev/okta-aws-cli-assume-role

Unable to run okta-aws on linux Graphics Device initialization failed for

nivimoraf opened this issue · 1 comments

Describe the bug
Getting an error when running okta-aws PROFILE sts get-caller-identity
The error is

Graphics Device initialization failed for :  es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
	at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
	at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:243)
	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
	at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
	at java.base/java.lang.Thread.run(Thread.java:831)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
	... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
	at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
	at java.base/java.lang.Thread.run(Thread.java:831)

To Reproduce
Steps to reproduce the behavior:

  1. Install okta-aws-cli-assume-role on Ubuntu 20
  2. Install openjdk-16-jre-headless
  3. Run okta-aws PROFILE sts get-caller-identity
  4. See error

Expected behavior
A browser applet should launch to allow the user to enter credentials.

Screenshots
The command fails with

Additional context

  • OS - Ubuntu 20
  • Java - openjdk version "16.0.1" 2021-04-20
    OpenJDK Runtime Environment (build 16.0.1+9-Ubuntu-120.04)
    OpenJDK 64-Bit Server VM (build 16.0.1+9-Ubuntu-120.04, mixed mode, sharing)

I found the solution.

  1. Run sudo apt-get update
  2. Run sudo apt install -y openjfx
  3. ~/.okta/bin/withokta should have additional flags:
java ${PROXY_CONFIG} \
     --add-modules  javafx.swing,javafx.graphics,javafx.fxml,javafx.media,javafx.web \
     --module-path /usr/share/openjfx/lib \
     -Djava.util.logging.config.file=/home/USER/.okta/logging.properties \
     -classpath /home/USER/.okta/okta-aws-cli.jar \
     com.okta.tools.WithOkta $@