Open chrisolido opened 1 month ago
To resolve the issues you're facing with connecting to your JIRA cloud instance and the errors in your Jenkins pipeline, follow these steps:
Endpoint URL: Ensure the endpoint URL is in the correct format and ends with a /
. For JIRA Cloud, it should be something like https://your-company.atlassian.net/rest/
.
Authentication: Use your email and an API token for authentication. Here is an example of how to set these fields:
<Block
style={{ marginTop: 8, marginBottom: 0 }}
title="Endpoint URL"
description={
<>
{version === 'cloud'
? 'Provide the Jira instance API endpoint. For Jira Cloud, e.g. https://your-company.atlassian.net/rest/. Please note that the endpoint URL should end with /.'
: ''}
</>
}
required
>
<Input
style={{ width: 386 }}
placeholder="Your Endpoint URL"
value={values.endpoint}
onChange={handleChangeEndpoint}
/>
</Block>
{version === 'cloud' && (
<>
<Block title="E-Mail" required>
<Input
style={{ width: 386 }}
placeholder="Your E-Mail"
value={values.username}
onChange={handleChangeUsername}
/>
</Block>
<Block
title="API Token"
description={
<ExternalLink link={DOC_URL.PLUGIN.JIRA.API_TOKEN}>Learn about how to create an API Token</ExternalLink>
}
required
>
<Input
style={{ width: 386 }}
placeholder={type === 'update' ? '********' : 'Your PAT'}
value={values.password}
onChange={handleChangePassword}
/>
</Block>
</>
)}
Ensure that:
endpoint
field is correctly set to your JIRA Cloud instance URL.username
field contains your email.password
field contains your API token.For the "unsupported protocol scheme" and "unexpected status code 404" errors in your Jenkins pipeline, you can modify the execCloneCommand
function to handle these specific errors. Here is an example:
func (g *GitcliCloner) execCloneCommand(cmd *exec.Cmd) errors.Error {
stdout, err := cmd.StdoutPipe()
if err != nil {
g.logger.Error(err, "stdout pipe error")
return errors.Default.New("stdout pipe error")
}
stderr, err := cmd.StderrPipe()
if err != nil {
g.logger.Error(err, "stderr pipe error")
return errors.Default.New("stderr pipe error")
}
combinedOutput := new(strings.Builder)
stdoutScanner := bufio.NewScanner(stdout)
stdoutScanner.Split(bufio.ScanLines)
stderrScanner := bufio.NewScanner(stderr)
stderrScanner.Split(bufio.ScanLines)
done := make(chan bool)
go func() {
for stdoutScanner.Scan() {
combinedOutput.WriteString(fmt.Sprintf("stdout: %s\n", stdoutScanner.Text()))
}
done <- true
}()
go func() {
for stderrScanner.Scan() {
combinedOutput.WriteString(fmt.Sprintf("stderr: %s\n", stderrScanner.Text()))
}
done <- true
}()
if e := cmd.Start(); e != nil {
g.logger.Error(e, "failed to start\n%s", combinedOutput.String())
return errors.Default.New("failed to start")
}
<-done
<-done
err = cmd.Wait()
if err != nil {
g.logger.Error(err, "git exited with error\n%s", combinedOutput.String())
if strings.Contains(combinedOutput.String(), "stderr: fatal: error processing shallow info: 4") ||
strings.Contains(combinedOutput.String(), "stderr: fatal: the remote end hung up unexpectedly") {
return ErrNoData
}
if strings.Contains(combinedOutput.String(), "stderr: fatal: repository not found") ||
strings.Contains(combinedOutput.String(), "unexpected status code 404") {
return errors.Default.New("repository not found (404)")
}
return errors.Default.New("git exit error")
}
return nil
}
This code checks for the "unexpected status code 404" error and handles it by returning a specific error message, which will help you identify and address the issue in your Jenkins pipeline [1][2].
Ensure that the following environment variables are set for Jenkins to work seamlessly with incubator-devlake
:
JENKINS_ENDPOINT=
JENKINS_USERNAME=
JENKINS_PASSWORD=
Additionally, make sure other core configurations such as PLUGIN_DIR
, DB_URL
, and PORT
are properly set as per your setup requirements [3][4][5][6].
By following these steps, you should be able to resolve the connection issues with your JIRA cloud instance and the errors in your Jenkins pipeline.
To continue the conversation, mention @dosu.
Try adding /rest
suffix to your endpoint.
Question
I am trying to connect to my JIRA cloud and its always failing when testing and and run the pipeline to sync failed to get server info![image](https://github.com/apache/incubator-devlake/assets/343307/47ab1d43-57c4-4e2d-9f88-86696b44e53c)
please help what i am doing wring here? (Newbie)
Screenshots
reason is this.![image](https://github.com/apache/incubator-devlake/assets/343307/d3b61e6d-67e1-40de-94a0-1627d1332737)
Additional context
Add any other context here.