Pipeline 'does not define any stages', but it does?

Hello there!

I am new to Jenkins and have decided to learn about the Pipeline declarative script. After reading and watching several tutorials on writing a simple Pipeline script, I had decided to give it a go on Jenkins.

When running the simple script, it displays the following error message - ‘This Pipeline has run successfully, but does not define any stages. Please use the stage step to define some stages in this Pipeline’,

However, after combing through the script and comparing it to the tutorial scripts online, everything appears to be precisely the same. So what is going on here? Is it perhaps a plugin issue?

Many thanks for your support in advance.

Please click this link to view screenshots of the script itself and the console output.

Are you sure you that run in your screenshots is after the script was run? You have no echo statement in the logs.

I’m guessing for some reason a run happened. Then the pipeline script was added. Then you saw those messages. You’ll have to run it again. Jenkins is only able to talk about the last run (s) not the current state of the script

Hey @halkeye! And thanks for the feedback!

Yeah, the script is present before the build.

I can post more screenshots but they will be exactly the same as the OP.

EDIT: Grammar.