2

We are trying to Setup CI-CD for our Org. However, while sfdx force:auth:jwt:grant on Jenkins, we are gettig the below error. Same command is working fine from local of 2 - 3 people. Jenkins is installed on UNIX based system:

sfdx force:auth:jwt:grant --clientid XXXXX --username XXXXX --jwtkeyfile XXXXX --setdefaultdevhubusername --instanceurl https://test.salesforce.com

ERROR: Command failed with response. - (secret-tool:20489): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed secret-tool: Cannot autolaunch D-Bus without X11 $DISPLAY

Section from Jenkinsfile:

if (isUnix()) {
sh '''
export SFDX_USE_GENERIC_KEYCHAIN=true
echo Above Set Value: $SFDX_USE_GENERIC_KEYCHAIN
sfdx force:org:list
echo Shell is: $SHELL
which secret-tool
which sfdx
force:auth:jwt:grant --clientid XXXXX --username XXXXX --jwtkeyfile XXXXX --setdefaultdevhubusername --instanceurl https://test.salesforce.com '''
}

Any setting which we ccould apply on Jenkins server to resolve the Issue ?... Appreciate your assistance with this.

2 Answers 2

4

You have to export keychain before executing session using secret tool for CI/headless server.

Change

export SFDX_USE_GENERIC_KEYCHAIN=true

To export SFDX_USE_GENERIC_UNIX_KEYCHAIN=true

devolpers guide for env variables.. https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_env_variables.html

1
  • Thanks Vishal... Worked like a charm !!!
    – Varun SFDC
    Apr 24, 2019 at 16:11
0

I believe the issue you're encountering is likely related to certain libraries or packages within your operating system. Specifically, a library named 'dbus' plays a crucial role in facilitating integration of services, among other functions. Additionally, the 'secret-tool' package is instrumental in managing secure connections and also related to GNOME keyring.

From what I can gather, it seems there might be a bug involving these packages and how SFDX utilizes JWT for authentication and connection with the connected app in Salesforce Org. In my experience, if 'secret-tool' is present in your OS, a potential workaround could be to remove 'libsecret'.

I've tried to replicate this issue and explain the process in my video, which you can watch here for more detailed guidance: https://youtu.be/ukO6fMBY-UE.

I hope this helps resolve your problem. Feel free to reach out if you have any more questions!

1
  • 1
    Note the question is 5 years old, has an accepted answer and sfdx got superseded by sf. Dec 26, 2023 at 20:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .