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

Error: does not exist, is the path to the file correct? #4145

Open
Oleksii-kh89 opened this issue Apr 25, 2024 · 4 comments
Open

Error: does not exist, is the path to the file correct? #4145

Oleksii-kh89 opened this issue Apr 25, 2024 · 4 comments

Comments

@Oleksii-kh89
Copy link

Your question

Hey. When I run script through Jenkins. (Jenkins->Pipeline->pull test script from Git -> sh '''docker run --rm -v /var/jenkins_home/workspace/test_ui_pipeline:/sitespeed.io sitespeedio/sitespeed.io /sitespeed.io/login-test.js --multi''', I get this error

node:fs:735
handleErrorFromBinding(ctx);
^

Error: EISDIR: illegal operation on a directory, read
at Object.readSync (node:fs:735:3)
at tryReadSync (node:fs:420:20)
at readFileSync (node:fs:471:19)
at getAliases (file:///usr/src/app/lib/cli/util.js:89:21)
at parseCommandLine (file:///usr/src/app/lib/cli/cli.js:2253:22)
at start (file:///usr/src/app/bin/sitespeed.js:119:22)
at file:///usr/src/app/bin/sitespeed.js:189:7 {
errno: -21,
syscall: 'read',
code: 'EISDIR'
}

Node.js v20.9.0

But when I run the same test which I have locally everything is fine. Maybe you know what can be a problem. Thank you in advance.

Best regards,

Oleksii

@soulgalore
Copy link
Member

Hi Oleksii,
I wonder can you verify that the mounting is correct? Maybe you could use an extra start script https://www.sitespeed.io/documentation/sitespeed.io/docker/#extra-start-script to check the directory and see what's going on. Maybe something super simple like ls -la /sitespeed.io/ ?

I think /sitespeed.io should be the working directory, so using just login-test.js would work, but I don't see that it should any difference.

@Oleksii-kh89
Copy link
Author

Dear Peter,

Thank you for your response. I tried different approaches which you recommended me. Extra-start-script didn't help me, I doublecheck maping and tried .../login-test.js/:/sitespeed.io/login-test.js but all these didn't help.

When I use comand like this

docker run --rm -v /var/jenkins_home/workspace/test_ui_pipeline:/sitespeed.io sitespeedio/sitespeed.io ls -la /sitespeed.io/login-test.js --multi

I received this error Error: ls does not exist, is the path to the file correct?

Maybe the problem is in the way which I use to run tests. I run Jenkins in docker and than I tried to run tsitespeed test from Jenkins pipeline. Because I receive

Error: /sitespeed.io/login-test.js does not exist, is the path to the file correct?

@soulgalore
Copy link
Member

Hi sorry I think was a misunderstanding with how you run the extra script. You need add a bash script that you mount and can run inside of the container.

For example create a bash script and name it extra.sh:

#!/bin/bash
ls -la /sitespeed.io/

Then you add -e EXTRA_START_SCRIPT=/sitespeed.io/extra.sh to when you start Docker. That way it will try to run the extra.sh script and the ls command will list files in the /sitespeed.io/ folder mounted inside of Docker.

@Oleksii-kh89
Copy link
Author

Dear Peter,

Thank you for your attention and cool idea to use bash script! It was helpful!

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