Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Credentials after moving credentials to a Folder #41

Closed
haroldo-bonette opened this issue Jul 14, 2019 · 4 comments
Closed

Invalid Credentials after moving credentials to a Folder #41

haroldo-bonette opened this issue Jul 14, 2019 · 4 comments

Comments

@haroldo-bonette
Copy link

It seems the plugin is not able to retrieve credentials if they are located inside a folder. After we moved all credentials to a Folder the step for SQLPlus plugin stopped working with error "Failed to initialize credentials or load user and pass"

Credentials path: Jenkins > FOLDER_NAME > Credentials > Folder > Global credentials (unrestricted)

Jenkins server Operation System:Win
Jenkins version: 2.176.1
Where SQLPlus Script Runner is running : slave;
Slave machine Operation System: Windows;
Oracle Database version 12.01;
Oracle SQL*Plus version: 12.2.0.1.0;

ERROR: Invalid credentials TEST_DB_ADMIN. Failed to initialize credentials or load user and pass

Pipeline: step([$class: 'SQLPlusRunnerBuilder',credentialsId:"${ADMIN_DB_CRED}", instance:"${ENV_DSN}", scriptType:'userDefined', script: '', scriptContent:"SELECT * FROM TABLE"])

I also tried with freestyle project and I was able to select the credentials but the build also failed with same error.

@boaglio
Copy link

boaglio commented Jul 14, 2019

Hi Haroldo, I don't have any control over this, when I get Jenkins credentials I use CredentialsMatchers.withId(credentialsId) , so maybe you should test using these values as credentialsId:

  • FOLDER_NAME/TEST_DB_ADMIN
  • FOLDER_NAME//TEST_DB_ADMIN
  • FOLDER_NAME\TEST_DB_ADMIN
  • FOLDER_NAME\TEST_DB_ADMIN

And also check if there is any restriction access to this credential.

@haroldo-bonette
Copy link
Author

haroldo-bonette commented Jul 15, 2019

Hi Fernando, thanks for the quick reply.
I tried to use the folder name in the credentials Id but it does not work.
From a quick research it seems this method will lookup only the global scope whether with Folder plugin the credentials will have a different scope, maybe this could help to find a way to make the plugin lookup folder scope credentials...

@boaglio
Copy link

boaglio commented Aug 22, 2019

I couldn't find a way, sorry... if you find it please send a pull request.

@boaglio boaglio closed this as completed Aug 22, 2019
@cmaggiulli
Copy link

@haroldo-bonette I'm going to attempt to resolve this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants