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

Test runs fails with "has no scheme but we will try to resolve it as remote module" #3286

Closed
Schachte opened this issue Aug 17, 2023 · 5 comments
Assignees
Labels
awaiting user waiting for user to respond bug

Comments

@Schachte
Copy link

Brief summary

I'm running my test locally after building and it works fine:

k6 run dist/test.js

However, when deploying onto a remote VM:


          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io

WARN[0000] The moduleSpecifier "dist/test.js" has no scheme but we will try to resolve it as remote module. This will be deprecated in the future and all remote modules will need to explicitly use "https" as scheme. 
ERRO[0000] The moduleSpecifier "dist/test.js" couldn't be found on local disk. Make sure that you've specified the right path to the file. If you're running k6 using the Docker image make sure you have mounted the local directory (-v /local/path/:/inside/docker/path) containing your script and modules so that they're accessible by k6 from inside of the container, see https://k6.io/docs/using-k6/modules#using-local-modules-with-docker. Additionally it was tried to be loaded as remote module by prepending "https://" to it, which also didn't work. Remote resolution error: "Get "https://dist/est.js": dial tcp: lookup dist: Temporary failure in name resolution"

I'm not using Docker and I have all dependencies required (node, npm, Go).

What's going on here?

k6 version

k6 v0.43.1

OS

go1.19.6/ubuntu latest

Docker version and image (if applicable)

n/a

Steps to reproduce the problem

Run test

Expected behaviour

Test runs and doesn't treat module as remote module

Actual behaviour

Module is treated as remote, says file can't be found and fails test

@mstoykov
Copy link
Collaborator

Hi @Schachte, the error message is a bit derranged as for UX reasons we try a bunch of things and some of the messages try to tease out what is wrong.

But the problem is 100% that the file isn't there. If you run it with ./ infront k6 will stop tryign the other stuff and will not try to load it remotely. But before that it still tries to load it locally.

So the problem is that the file isn't where you think it is. Maybe you are running k6 in a different directory then what you think.

@mstoykov mstoykov added the awaiting user waiting for user to respond label Aug 18, 2023
@mstoykov mstoykov assigned mstoykov and unassigned codebien Aug 18, 2023
@mstoykov
Copy link
Collaborator

For the record we also decided that the trying of https:// will be finally deprecated #3287

@Schachte
Copy link
Author

I don't think that's true as the file is definitely there and putting relative path, ./ doesn't resolve the issue. The only resolution is running this in Docker and nothing else. That's fine, but the overhead of needing the container is a bit cumbersome.

@mstoykov
Copy link
Collaborator

@Schachte if even adding ./ doesn't fix it - I am pretty certain that the file isn't there or the k6 process can't access/see it.

Like ... I can't figure out how one k6 process can find the file with this path if it exists, but another won't, except for the file isn't there for one of the processes.

I would recommend using ls or similar to print the contents of the directories around it before running k6.

Maybe even double checking where you run the command from.

@codebien
Copy link
Collaborator

Closing as this doesn't seem to be an issue where we can have a concrete action. But feel free to reopen reporting more details if any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting user waiting for user to respond bug
Projects
None yet
Development

No branches or pull requests

3 participants