Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

[error] Parameter 'commandLine' cannot be null or empty. #51

Open
davivcgarcia opened this issue Jul 16, 2020 · 14 comments
Open

[error] Parameter 'commandLine' cannot be null or empty. #51

davivcgarcia opened this issue Jul 16, 2020 · 14 comments

Comments

@davivcgarcia
Copy link

When using the action:

    - name: (API) Setup Deno environment
      uses: denolib/setup-deno@v2
      with:
        deno-version: v1.x

On a self-hosted runner, I see the following error:

Run denolib/setup-deno@v2
  with:
    deno-version: v1.x
##[error]Parameter 'commandLine' cannot be null or empty.

Any advice?

@davivcgarcia
Copy link
Author

The error seems to be generated here:

setup-deno/dist/index.js

Lines 4754 to 4766 in 482dc73

function exec(commandLine, args, options) {
return __awaiter(this, void 0, void 0, function* () {
const commandArgs = tr.argStringToArray(commandLine);
if (commandArgs.length === 0) {
throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
}
// Path to tool to execute should be first arg
const toolPath = commandArgs[0];
args = commandArgs.slice(1).concat(args || []);
const runner = new tr.ToolRunner(toolPath, args, options);
return runner.exec();
});
}

@zhmushan
Copy link
Member

setup-deno/src/installer.ts

Lines 193 to 194 in 482dc73

const gzPzth = await io.which("gzip");
await exec.exec(gzPzth, ["-d", gzFile]);

Is there gzip in self-hosted?

@axetroy
Copy link
Member

axetroy commented Jul 17, 2020

setup-deno/src/installer.ts

Lines 193 to 194 in 482dc73

const gzPzth = await io.which("gzip");
await exec.exec(gzPzth, ["-d", gzFile]);

Is there gzip in self-hosted?

This is indeed a problem, we should use the gzip implemented in pure nodejs

@davivcgarcia
Copy link
Author

davivcgarcia commented Jul 17, 2020

setup-deno/src/installer.ts

Lines 193 to 194 in 482dc73

const gzPzth = await io.which("gzip");
await exec.exec(gzPzth, ["-d", gzFile]);

Is there gzip in self-hosted?

Yes, there is.

[root@ip-172-31-52-214 ec2-user]# rpm -qa | grep gzip
gzip-1.9-9.el8.x86_64
[root@ip-172-31-52-214 ec2-user]# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.2 (Ootpa)

@davivcgarcia
Copy link
Author

What are the other packages required for this action? I can check if all of them are properly installed.

@zhmushan
Copy link
Member

I just tested self-hosted, using Linux x64 environment, and successfully executed setup-deno🤔

@davivcgarcia
Copy link
Author

I just tested self-hosted, using Linux x64 environment, and successfully executed setup-denothinking

What distribution did you use? I'm using a CentOs/RHEL 8 minimum install.

@jameskerr
Copy link

I too am experiencing this same error on a centos:8 docker container.

 /usr/bin/docker exec  1ac4a3ce3754dfaeeb0c7d6f38d7328f4d0621d78d43bf54890ebd4ab7adea87 sh -c "cat /etc/*release | grep ^ID"
##[error]Parameter 'commandLine' cannot be null or empty.

davivcgarcia added a commit to davivcgarcia/demo-ansible-github that referenced this issue Jul 21, 2020
@jameskerr
Copy link

Is the issue that on Centos 8 containers, await io.which("gzip") is returning an empty string?
Then when that empty string is passed to exec.exec() we get that argument error?

setup-deno/src/installer.ts

Lines 193 to 194 in 482dc73

const gzPzth = await io.which("gzip");
await exec.exec(gzPzth, ["-d", gzFile]);

@zhmushan
Copy link
Member

Is the issue that on Centos 8 containers, await io.which("gzip") is returning an empty string?
Then when that empty string is passed to exec.exec() we get that argument error?

setup-deno/src/installer.ts

Lines 193 to 194 in 482dc73

const gzPzth = await io.which("gzip");
await exec.exec(gzPzth, ["-d", gzFile]);

I suspect yes, I need to verify on CentOS, but it will take a few days.
Anyway, gzip implemented using pure nodejs is necessary

@jameskerr
Copy link

I found a way to get this action to work on Centos 8 containers. Before running this action, install the unzip package using dnf.

dnf install -y unzip

The workflow file that worked for me was:

name: Deno Install Test
on: [push]

jobs:
  install:
    name: "Deno Install"
    runs-on: ubuntu-18.04
    container:
      image: centos:8
    steps:
      - run: dnf install -y unzip
      - uses: denolib/setup-deno@v2
        with:
          deno-version: v1.x
      - run: deno --version

@zhmushan
Copy link
Member

setup-deno/src/installer.ts

Lines 186 to 197 in e4ecee2

} else if (semver.lte(version, "0.38.0")) {
if (process.platform === "win32") {
extPath = await tc.extractZip(archiveFilepath);
} else {
extPath = path.join(archiveFilepath, "..", uuidV4());
const gzFile = path.join(extPath, "deno.gz");
await io.mv(archiveFilepath, gzFile);
const gzPzth = await io.which("gzip");
await exec.exec(gzPzth, ["-d", gzFile]);
fs.chmodSync(path.join(extPath, "deno"), "755");
}
} else {

Setup the 1.x version of Deno, this code is not executed at all, a confusing error...

@zhmushan
Copy link
Member

See: https://github.com/actions/toolkit/blob/905b2c7b0681b11056141a60055f1ba77358b7e9/packages/tool-cache/src/tool-cache.ts#L235-L242

Since we rely on @actions/tool-cache, and it eventually calls tar, this is an issue of @actions/tool-cache

@MVEMCJSUNPE
Copy link

I don't think there's anything wrong with setup-deno: it's just that self-hosted runners don't have a lot of the same binaries that Github runners do. act has a similar issue: command not found

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants