cancel
Showing results for 
Search instead for 
Did you mean: 

Pipeline failure in gctsDeploy

Karan_Chopra_
Active Participant
0 Kudos

Hi Experts

I am trying to run pipeline for ABAP Development and Testing Process Using Git-Enabled Change and Transport System following the scenerio https://www.project-piper.io/scenarios/gCTS_Scenario/ on project piper but I am facing issue in gctsDeploy step where the Host is read.

step execution failed - cannot parse HTTP response with value <nil>

Below is the part of Jenkinfile and error

Jenkinsfile

@Library(['piper-lib-os']) _
pipeline {
agent any
options {
disableConcurrentBuilds()
}
environment {
DEMOCREDS='ABAP'
HOST='Host'
CLIENT='100'
REPO='karanchopras-workbench'
REPO_URL="https://github.com/karanchopras/workbench"
}
stages {
stage('gCTS Deploy') {
when {
anyOf {
branch 'gCTS'
}
}
steps {
gctsDeploy(
script:this,
host:HOST,
client:CLIENT,
abapCredentialsId:DEMOCREDS,
repository:REPO,
remoteRepositoryURL:REPO_URL,
verbose:true,
role:'SOURCE',
vSID:'GIT')
}
}
stage('gctsExecuteABAPQualityChecks') {
when {
anyOf {
branch 'gCTS'
}
}
steps {
script {
try {
gctsExecuteABAPQualityChecks(
script:this,
host:HOST,
client:CLIENT,
abapCredentialsId:DEMOCREDS,
repository:REPO,
scope:'localChangedObjects',
commit:"${env.GIT_COMMIT}",
workspace:"${WORKSPACE}")
} catch (Exception ex) {
currentBuild.result = 'FAILURE'
unstable(message:"${STAGE_NAME} is unstable")
}
}
}
}
stage('Results in Checkstyle') {
when {
anyOf {
branch 'gCTS'
}
}
steps{
recordIssues(
enabledForFailure:true, aggregatingResults:true,
tools:[checkStyle (pattern:'ATCResults.xml', reportEncoding:'UTF8'), checkStyle (pattern:'AUnitResults.xml', reportEncoding:'UTF8')]
)
}
}
stage('Rollback') {
when {
expression {
currentBuild.result == 'FAILURE'
}
}
steps {
gctsRollback(
script:this,
host:HOST,
client:CLIENT,
abapCredentialsId:DEMOCREDS,
repository:REPO
)
}
}
}
}

Error

+ ./piper gctsDeploy
info gctsDeploy - Using stageName 'gCTS Deploy' from env variable
info gctsDeploy - Project config: NONE ('.pipeline/config.yml' does not exist)
debug gctsDeploy - Skipping fetching secrets from Vault since it is not configured
debug gctsDeploy - For: STAGE_NAME, found: gCTS Deploy
debug gctsDeploy - Could not read env variable JOB_URL using fallback value n/a
debug gctsDeploy - Could not read env variable BUILD_URL using fallback value n/a
info gctsDeploy - Start of gCTS Deploy Step with Configuration Values: &{**** **** karanchopras-workbench https://saps4s.camelot-idpro.de:44300 100 https://github.com/karanchopras/workbench SOURCE GIT GIT false map[] map[] false}
info gctsDeploy - Starting to retrieve configuration metadata from the system
debug gctsDeploy - Using Basic Authentication ****/****
debug gctsDeploy - no trusted certs found / using default transport / insecure skip set to true / : continuing with existing tls config
debug gctsDeploy - Transport timeout: 3m0s, max request duration: 0s
debug gctsDeploy - --------------------------------
debug gctsDeploy - --> GET request to <host of the ABAP system>:<port>/sap/bc/cts_abapvcs/config?sap-client=100
debug gctsDeploy - headers: map[Authorization:[<set>]]
debug gctsDeploy - cookies:
debug gctsDeploy - --------------------------------
debug gctsDeploy - response <nil>
debug gctsDeploy - --------------------------------
error gctsDeploy - step execution failed at configuration metadata retrieval. Please Check if system is up!. - cannot parse HTTP response with value <nil>
info gctsDeploy - fatal error: errorDetails{"category":"undefined","correlationId":"n/a","error":"cannot parse HTTP response with value \u003cnil\u003e","library":"SAP/jenkins-library","message":"step execution failed","result":"failure","stepName":"gctsDeploy","time":"2023-03-21T12:35:34.223706235Z"}
fatal gctsDeploy - step execution failed - cannot parse HTTP response with value <nil>
debug gctsDeploy - Could not read env variable BUILD_URL using fallback value n/a
info gctsDeploy - Step telemetry data:{"StepStartTime":"2023-03-21 12:35:34.079781037 +0000 UTC","PipelineURLHash":"50f013532a9770a2c2cfdc38b7581dd01df69b70","BuildURLHash":"50f013532a9770a2c2cfdc38b7581dd01df69b70","StageName":"gCTS Deploy","StepName":"gctsDeploy","ErrorCode":"1","StepDuration":"144","ErrorCategory":"undefined","CorrelationID":"n/a","PiperCommitHash":"7c4262b0c61c1d10c5b80c3949c60871c969a3ba","ErrorDetail":{"category":"undefined","correlationId":"n/a","error":"cannot parse HTTP response with value \u003cnil\u003e","library":"SAP/jenkins-library","message":"step execution failed","result":"failure","stepName":"gctsDeploy","time":"2023-03-21T12:35:34.223706235Z"}}
debug gctsDeploy - Sending telemetry data
debug gctsDeploy - no trusted certs found / using default transport / insecure skip set to true / : continuing with existing tls config
debug gctsDeploy - Transport timeout: 3m0s, max request duration: 5s
debug gctsDeploy - --------------------------------
debug gctsDeploy - --> GET request to https://webanalytics.cfapps.eu10.hana.ondemand.com/tracker/log?action_name=Piper+Library+OS&custom10...
debug gctsDeploy - headers: map[]
debug gctsDeploy - cookies:
debug gctsDeploy - --------------------------------
debug gctsDeploy - <-- response 204 https://webanalytics.cfapps.eu10.hana.ondemand.com/tracker/log?action_name=Piper+Library+OS&custom10... (219.38ms)
debug gctsDeploy - --------------------------------
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] fileExists
[Pipeline] fileExists
[Pipeline] sh
+ ./piper readPipelineEnv
[Pipeline] readJSON
[Pipeline] echo
Transfer Influx data
[Pipeline] findFiles
[Pipeline] stash
Stashed 0 file(s)
[Pipeline] fileExists
[Pipeline] readJSON
[Pipeline] error
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] libraryResource
[Pipeline] echo
----------------------------------------------------------
--- An error occurred in the library step: gctsDeploy
----------------------------------------------------------
The following parameters were available to the step:
***
[script:WorkflowScript@32814406, host:<host of the ABAP system>:<port>, client:100, abapCredentialsId:ABAP, repository:karanchopras-workbench, remoteRepositoryURL:https://github.com/karanchopras/workbench, verbose:true, role:SOURCE, vSID:GIT]
***
The error was:
***
hudson.AbortException: [gctsDeploy] Step execution failed (category: undefined). Error: cannot parse HTTP response with value <nil>
***
Further information:
* Documentation of library step gctsDeploy: https://sap.github.io/jenkins-library/steps/gctsDeploy/
* Source code of library step gctsDeploy: https://github.com/SAP/jenkins-library/blob/master/vars/gctsDeploy.groovy
* Library documentation: https://sap.github.io/jenkins-library/
* Library repository: https://github.com/SAP/jenkins-library/
----------------------------------------------------------
--- End library step of: gctsDeploy ---
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (gctsExecuteABAPQualityChecks) (hide)
Stage "gctsExecuteABAPQualityChecks" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Results in Checkstyle)
Stage "Results in Checkstyle" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Rollback)
Stage "Rollback" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: [gctsDeploy] Step execution failed (category: undefined). Error: cannot parse HTTP response with value <nil>
Finished: FAILURE

Accepted Solutions (0)

Answers (5)

Answers (5)

astemberg
Discoverer
0 Kudos

We faced a similar issue where the root cause was HTTPS connection to host system with no valid certificate. You can try to add skipSSLVerification: true in your deploy step config.

Karan_Chopra_
Active Participant
0 Kudos

Hi Karin

As we do not have test system ready yet so we are trying to achieve the scenario in same system only, so that later on it will be easier and quick.

Yes I am passing our ABAP system URL onlyin the format HOST = <https://<host of the ABAP system>:<port>> , just for security reason I changed it here.

I have tried both the scenario (Set up a Pipeline-Based ABAP Development and Testing Process Using Git-Enabled Change and Transport ... - Single Jenkinfile with enviorent variables included) and OPEN SAP scenario in Devops with ABAP where we have separate config.yml, but unfortunately in both the cases I get this same error.

I tried with Getting Started With Project "Piper" - Project "Piper": Continuous Delivery for the SAP Ecosystem (p... , this is working fine and app gets deployed in BTP, so problem does not seems to be in Jenkins Server setting.

Karin
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Karan,

you can also start a pipline for the same system as you are developing - I am just not sure that I get the point, why you need to deploy again. Nevertheless, this should not be the issue.

But in your jenkinsfile, in the environment definition, I found this.

HOST = 'host'

What is this expected to achieve? You would need to define the URL to the ABAP system as HOST to allow Jenkins to start the respective action on that system and to pass over credentials

Kind regards

Karin

Karan_Chopra_
Active Participant
0 Kudos

Hello Karin,

No I do not use config.yml in this case, but yes I have not added any colaborator also.

I will try that and see if it works , thankyou.

Karin
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

do you also use a config.yml? If yes, then this issue comes up if indentations in the yml are not correct.

If not: is the user 'ABAP' that you use for democredentials a collaborator for the repository?

Kind regards

Karin

Karan_Chopra_
Active Participant
0 Kudos

hi Karin

Even after adding colaaborator we get same error, we are not triggering pieline via transport release but directly from Jenikins Server. Also we do not have 2 systems so we are using one system only , could that be the reason for error as same system is given in pipeline?