Cypress Permission denied

Hi Team,

I am having permission denied issue when the cypress scripts(11.1 v) are run directly on the worker( Ubuntu 22.04.1 LTS ). Its a listening tentacle.
image
I have checked tentacle.config and run show-configuration command, didn’t notice anything major, except for Services
image
The npx cypress --version outputs 12.18.1

Please advice

Hey @parnithakaleru,

Thank you for contacting Octopus Support and sorry to see you are getting a permission denied error when trying to run cypress scripts onto a linux worker.

Are you able to test running the same scripts directly on the linux worker at all? You will need to ensure you run them from the same account as the tentacle service on your linux box is running under.

Let me know if you can run those tests and if you can we can dig a bit deeper for you,

Kind Regards,
Clare

Hi Clare,

Thanks for your input. I have tried running the cypress test scripts directly on the linux worker and it failed. I had to install few dependencies with which the scripts run without any issue.

However when triggered via Octopus deploy they now fail with


I am investigating it, while if you can think of why the error is appearing, please advice.

Thanks,
Pari

Hey @parnithakaleru,

Great news you got this working outside of Octopus, hopefully it will be nice and easy to get this working inside of Octopus now.

Are you running your Linux worker under a custom service user account by any chance? If so can you make sure that has the correct permissions to the place where your cypress files are.

I can see node_modules/inline-assets/bin/inline-assets.js is not found in the logs. Can you first check to see if that .js file is in that folder, if it is you will probably need to give your worker service account permissions to the node_modules folder, you might need write permissions depending on what the tests are doing but you may be ok with read, you would need to test that.

Let me know if that helps,
Kind Regards,
Clare

Hi Clare,

Yes I did check and can confirm file does exists and permission have been in place for the parent directories and the file. The output file generated has this error - Could not find a Cypress configuration file in this folder: /etc/octopus/Cypress-worker/Work/20230327104238-53340-157.

In Work directory, temp directory created cannot find config file. All I can see on the worker is


from Dec, Jan, Feb and none from March.

Regards,
Pari

Hey @parnithakaleru,

Thanks for confirming those files are not in there, I forgot those files are cleaned up after a deployment so you might not see the files in there.

Are you able to get a screenshot to us of the step you are using for this process please, specifically looking at any packages you are referencing in the step as that will help us potentially identify the issue.

I look forward to hearing from you,
Kind Regards,
Clare

Morning Clare,

I have sent in logs along with json for further investigation from your end.

To add more details - I am able to run cypress scripts from the worker directly without any issues.
Also from the octopus deploy with my bash script pointing too manually placed test scripts directory.

Issue is when the test scripts package that’s uploaded to library is referenced within process/step then it errors out with cypress permission denied where it starts to look in the path /etc/octopus/

Kind Regards,
Pari

Hey @parnithakaleru,

Thank you for sending us those logs through, ill take a look in a moment and see if I can ascertain what is going on, thanks for the extra information about the testing too.

It looks like there is something not quite right about the package Octopus is downloading onto the worker but I will take a look.

If you don’t mind we will continue this investigation via email and I will update this forum ticket once we have found the issue in case other customers run into a similar issue.

Kind Regards,
Clare

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.