function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VARUN GULATI 30VARUN GULATI 30 

Error on secret-tool for sfdx force:auth:jwt:grant

Greetings Expert,

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.

Rohit RadhakrishnanRohit Radhakrishnan
Incase this is not yet resolved. Please have a look at this blog on authenticating using JWT.
https://salesforcerealm.com/2020/03/07/authenticate-sfdx-using-jwt/
Pankaj AwaghadPankaj Awaghad
Hello team, I am getting the same while connecting the Salesforce org from Unix server. 

$ sfdx force:auth:jwt:grant --clientid ****  --jwtkeyfile server.key --username pankaj.awaghad@yahoo.com --instanceurl https://login.salesforce.com
ERROR running auth:jwt:grant:  We encountered a JSON web token error, which is likely not an issue with Salesforce CLI. Here’s the error: Command failed with response:
 - ** Message: 19:54:10.017: Remote error from secret service: org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.Secret.Collection' on object at path /org/freedesktop/secrets/collection/login
secret-tool: No such interface 'org.freedesktop.Secret.Collection' on object at path /org/freedesktop/secrets/collection/login

How to resolve this ? Any idea? Please help me. I need to connect to org from Unix server and Salesforce CLI is installed on unix server