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

Broken runProcedure.groovy ? #17

Open
webskin opened this issue Oct 8, 2020 · 3 comments
Open

Broken runProcedure.groovy ? #17

webskin opened this issue Oct 8, 2020 · 3 comments

Comments

@webskin
Copy link

webskin commented Oct 8, 2020

Hello,

When trying to execute :

https://github.com/electric-cloud-community/DSL-Samples/blob/master/runProcedure.groovy

With :

ectool evalDsl --dslFile runProcedure.groovy

I have this error :

ectool error [InvalidScript]: Unknown exception during DSL eval at line 59: Unable to locate persister: com.electriccloud.property.IntrinsicProperty
    Line 0016: DSL method 'project'
    Line 0017: DSL method 'procedure'
    Line 0017: Handling 'project' before processing 'procedure'
    Line 0017: Checking if project exists with args {projectName=Hello Project}
    Line 0017: project exists: true
    Line 0017: Invoking 'modifyProject' with args {projectName=Hello Project}
    Line 0017: Done invoking 'modifyProject'
    Line 0018: DSL method 'formalParameter'
    Line 0018: Handling 'procedure' before processing 'formalParameter'
    Line 0018: Checking if procedure exists with args {procedureName=testRunProcedure}
    Line 0018: Resolving projectName to 'Hello Project' from project[name=Hello Project,id=5087ebae-0876-11eb-9de9-005056870fe4]
    Line 0018: procedure exists: true
    Line 0018: Invoking 'modifyProcedure' with args {procedureName=testRunProcedure}
    Line 0018: Resolving projectName to 'Hello Project' from project[name=Hello Project,id=5087ebae-0876-11eb-9de9-005056870fe4]
    Line 0018: Done invoking 'modifyProcedure'
    Line 0019: Setting argument 'required' to '1'
    Line 0020: Setting argument 'defaultValue' to 'Bob'
    Line 0018: Checking if formalParameter exists with args {formalParameterName=friend, required=1, defaultValue=Bob}
    Line 0018: Resolving projectName to 'Hello Project' from procedure[name=testRunProcedure,id=509dbda3-0876-11eb-9de9-005056870fe4]
    Line 0018: Resolving procedureName to 'testRunProcedure' from procedure[name=testRunProcedure,id=509dbda3-0876-11eb-9de9-005056870fe4]
    Line 0018: formalParameter exists: true
    Line 0018: Invoking 'modifyFormalParameter' with args {formalParameterName=friend, required=1, defaultValue=Bob}
    Line 0018: Resolving procedureName to 'testRunProcedure' from procedure[name=testRunProcedure,id=509dbda3-0876-11eb-9de9-005056870fe4]
    Line 0018: Resolving projectName to 'Hello Project' from procedure[name=testRunProcedure,id=509dbda3-0876-11eb-9de9-005056870fe4]
    Line 0018: Done invoking 'modifyFormalParameter'
    Line 0018: END DSL method 'formalParameter'
    Line 0022: DSL method 'step'
    Line 0023: Setting argument 'command' to 'printf("Hello $[friend] from EF DSL!\n");
    sleep(5);
    exit(0);
    '
    Line 0027: Setting argument 'shell' to 'ec-perl'
    Line 0022: Checking if procedureStep exists with args {stepName=helloFriend, command=printf("Hello $[friend] from EF DSL!\n");
    sleep(5);
    exit(0);
    , shell=ec-perl}
    Line 0022: Resolving projectName to 'Hello Project' from procedure[name=testRunProcedure,id=509dbda3-0876-11eb-9de9-005056870fe4]
    Line 0022: Resolving procedureName to 'testRunProcedure' from procedure[name=testRunProcedure,id=509dbda3-0876-11eb-9de9-005056870fe4]
    Line 0022: step exists: true
    Line 0022: Invoking 'modifyStep' with args {stepName=helloFriend, command=printf("Hello $[friend] from EF DSL!\n");
    sleep(5);
    exit(0);
    , shell=ec-perl}
    Line 0022: Resolving projectName to 'Hello Project' from procedure[name=testRunProcedure,id=509dbda3-0876-11eb-9de9-005056870fe4]
    Line 0022: Resolving timeLimitUnits to 'minutes' from procedure[name=testRunProcedure,id=509dbda3-0876-11eb-9de9-005056870fe4]
    Line 0022: Resolving procedureName to 'testRunProcedure' from procedure[name=testRunProcedure,id=509dbda3-0876-11eb-9de9-005056870fe4]
    Line 0022: Done invoking 'modifyStep'
    Line 0022: END DSL method 'step'
    Line 0017: END DSL method 'procedure'
    Line 0016: END DSL method 'project'
    Line 0037: Getting 'logFile'
    Line 0039: DSL method 'runProcedure'
    Line 0039: Invoking 'runProcedure' with args {projectName=Hello Project, procedureName=testRunProcedure, actualParameter={friend=James}}
    Line 0039: Done invoking 'runProcedure'
    Line 0039: END DSL method 'runProcedure'
    Line 0052: Getting 'logFile'
    Line 0059: DSL method 'getProperty'
    Line 0059: Invoking 'getProperty' with args {propertyName=status, jobId=cd5b3910-093b-11eb-ae76-005056870fe4}
    Line 0059: Done invoking 'getProperty'
    Details:
    Unable to locate persister: com.electriccloud.property.IntrinsicProperty

Hibernate / Transaction issue ?

@gmaxey
Copy link

gmaxey commented Oct 8, 2020

Sorry, I'm not getting this error, so I'm unable to reproduce the issue. I'm using CloudBees 10.0.0.

@gmaxey
Copy link

gmaxey commented Oct 8, 2020

Did you get any data in the file /tmp/dsl.log? Examine the job in the UI. Did it run? The job step should have fails (exit 1).

@webskin
Copy link
Author

webskin commented Oct 8, 2020

In dsl.log I have only :

jobId:ce251642-0976-11eb-9822-005056870fe4

image

It completes with success but it is the subsequent code that failed:

  // Now let's grab the jobId launched to run the procedure
  def id=resp.jobId
  // Let's wait for it to finish
  logFile << "jobId:" + id.toString() + "\n"

  def String status=''
  while(status != "completed") {
    // We need the polling in a different transaction started after
    //    the runProcedure one.
  transaction{
    status=getProperty(propertyName: 'status', jobId: id).value;
    logFile << "status:" + status + "\n"
               }
    sleep (1000)
  }
  def String outcome=getProperty(propertyName: 'outcome', jobId: id).value;

  logFile << "outcome:" + outcome + "\n"

At status=getProperty(propertyName: 'status', jobId: id).value;

I am using Flow 9.2.0.139827

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

2 participants