Skip to content
New issue

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

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

Already on GitHub? # to your account

Cannot create personal access token under user preferences #23129

Open
huonguyenlt opened this issue Sep 4, 2024 · 10 comments
Open

Cannot create personal access token under user preferences #23129

huonguyenlt opened this issue Sep 4, 2024 · 10 comments
Labels
area/install Issues related to installation, including offline/air gap and initial setup kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.

Comments

@huonguyenlt
Copy link

Describe the bug

Cannot add personal access token with provider Microsoft azure devops
Error: Token "test" was not added because it is not valid.

Che version

7.89

Steps to reproduce

Create PAT on azure devops
image

Add the PAT to che
image

Error after add the token
image

Expected behavior

Should be able to add the PAT

Runtime

other (please specify in additional context)

Screenshots

No response

Installation method

other (please specify in additional context)

Environment

Amazon

Eclipse Che Logs

No response

Additional context

Che cluster is deployed on EKS

@huonguyenlt huonguyenlt added the kind/bug Outline of a bug - must adhere to the bug report template. label Sep 4, 2024
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Sep 4, 2024
@tolusha
Copy link
Contributor

tolusha commented Sep 4, 2024

It should definitely work for https://dev.azure.com If you have Azure On Prem, then it is needed to configure Eclipse Che firstly. Although, I had no chance to try it, it must be possible.
Update checluster custom resource to set the correct values:

spec:
  components:
    cheServer:
      extraProperties:
        CHE_INTEGRATION_AZURE_DEVOPS_APPLICATION__SCOPES: "vso.code_write"
        CHE_OAUTH_AZURE_DEVOPS_AUTHURI: "https://app.vssps.visualstudio.com/oauth2/authorize"
        CHE_OAUTH_AZURE_DEVOPS_TOKENURI: "https://app.vssps.visualstudio.com/oauth2/token"
        CHE_INTEGRATION_AZURE_DEVOPS_API_ENDPOINT: "https://vssps.dev.azure.com"
        CHE_INTEGRATION_AZURE_DEVOPS_SCM_API__ENDPOINT: "https://dev.azure.com"

@dkwon17 dkwon17 added severity/P1 Has a major impact to usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Sep 4, 2024
@huonguyenlt
Copy link
Author

@tolusha the config you provide only available for azure devops service. In my case, i use azure devops server.

@huonguyenlt
Copy link
Author

I tried to add the property CHE_INTEGRATION_AZURE_DEVOPS_SCM_API__ENDPOINT bbut still not working
image

@huonguyenlt
Copy link
Author

image

Also update the CHE_INTEGRATION_AZURE_DEVOPS_API_ENDPOINT with my azure devops server url, still eclispe che use the default https://vssps.dev.azure.com as you can see in the below error message
Caused by: java.net.URISyntaxException: Illegal character in path at index 41: https://vssps.dev.azure.com/DevSecOps-COE /_apis/profile/profiles/me?api-version=7.0

PS: do we have the document (exhausted list) of extraProperties

@tolusha
Copy link
Contributor

tolusha commented Sep 5, 2024

still eclispe che use the default https://vssps.dev.azure.com/

Double check if che-server pod is restarted.
Log into the container and print env to check the acutal values of env vars.

PS: do we have the document (exhausted list) of extraProperties

Unfortunately I can't find them in our documentation.
But the list is available by the url [1]

[1] https://github.com/eclipse-che/che-server/blob/main/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che/che.properties

@huonguyenlt
Copy link
Author

huonguyenlt commented Sep 6, 2024

@tolusha I checked the env vars, they are all correct. Is there any env var I have to set beside these 3?

sh-4.4$ CHE_INTEGRATION_AZURE_DEVOPS_API__ENDPOINT=https://devado.xxx.com
sh-4.4$ CHE_INTEGRATION_AZURE_DEVOPS_APPLICATION__SCOPES=vso.code_write
sh-4.4$ CHE_INTEGRATION_AZURE_DEVOPS_SCM_API__ENDPOINT=https://devado.xxx.com

In the link you shared, it says CHE_INTEGRATION_AZURE_DEVOPS_API__ENDPOINT is the Azure DevOps Service API server address. So I am confused if it is applicable for my case as I use azure devops server.

# Azure DevOps Service API server address.
che.integration.azure.devops.api_endpoint=https://vssps.dev.azure.com

One more question, do you know where I can find logs after adding the Personal access token. I check all che components' log but cant find them

@tolusha tolusha added the area/install Issues related to installation, including offline/air gap and initial setup label Sep 6, 2024
@tolusha
Copy link
Contributor

tolusha commented Sep 6, 2024

Is there any env var I have to set beside these 3?

I bileve it should be enough to add PAT

One more question, do you know where I can find logs after adding the Personal access token. I check all che components' log but cant find them

They are available if log level set to DEBUG spec.components.cheServer.logLevel: DEBUG

When PAT is added, we simply validte it by requesting the user profile as below [1]. If use can't be retrieve, then PAT is considered to be invalid and can't be added.

[1] https://github.com/eclipse-che/che-server/blob/c5963e0de77b98298af79c642e44e372f85739c6/wsmaster/che-core-api-factory-azure-devops/src/main/java/org/eclipse/che/api/factory/server/azure/devops/AzureDevOpsApiClient.java#L91-L103

@tolusha
Copy link
Contributor

tolusha commented Oct 8, 2024

@huonguyenlt
Were you able to add PAT eventually ?

@huonguyenlt
Copy link
Author

@tolusha no, I am not able to do it. I think it does not support azure server.

@tolusha
Copy link
Contributor

tolusha commented Feb 12, 2025

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area/install Issues related to installation, including offline/air gap and initial setup kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

4 participants