upload-artifact icon indicating copy to clipboard operation
upload-artifact copied to clipboard

Error: Unrecognized if-no-files-found input. Provided: . Available options: warn,error,ignore

Open zivkovic opened this issue 3 years ago • 7 comments

Describe the bug I'm running a self hosted runner and the workflow job is ran in a container. When a test fails and should upload the screenshots, the following error is displayed. As seen in screenshot below, I have set the if-no-files-found to ignore, but error still displays as if this was configured incorrectly.

Version

  • [ ] V1
  • [x] V2

Environment

  • [x] self-hosted
  • [ ] Linux
  • [ ] Windows
  • [ ] Mac

Screenshots

The displayed error message: image

The start of the workflow: image

If you require more info, let me know.

zivkovic avatar Oct 11 '21 08:10 zivkovic

I'm also facing the same issue

aljazkosir avatar Oct 17 '21 12:10 aljazkosir

We have similar issue, but as warning and looks like this "if-no-files-found" isn't working.

Warning: Unexpected input(s) 'if-no-files-found', valid inputs are ['name', 'path']
with:
    name: test-results
    path: target/surefire-reports
    if-no-files-found: ignore
Error: Path does not exist /some_path/target/surefire-reports
Error: Exit code 1 returned from process: file name '/home/runner/runners/2.283.3/bin/Runner.PluginHost', arguments 'action "GitHub.Runner.Plugins.Artifact.PublishArtifact, Runner.Plugins"'.

vafanasy avatar Nov 01 '21 15:11 vafanasy

I just want to add.. I'm experiencing this same issue. Also on a self-hosted linux based runner. Nothing I do seems to resolve the error. I've tried leaving the if-no-files-found field out, specified an explicit value, with and with out quotes. Even tried a numerical index. Tried @v2, @v3 and @main They all seem to show the same issue. It does appear to be related to running on a self-hosted runner. Changing only my "runs-on" from self-hosted to ubuntu-latest fixes the issue. For added reference, my self-hosted runner is just a set of simple ubuntu-server headless machine.

edit: update.. oddly enough, the upload succeeds! Despite the error.

Edit: Forked the main branch to try a test.
I modified input-helper.ts with the following. And it at least works now on my self-hosted runner. For some unknown reason, the noFileBehavior value is coming in as a blank, instead of the default 'warn'.

const ifNoFilesFound = core.getInput(Inputs.IfNoFilesFound)
  var noFileBehavior: NoFileOptions = NoFileOptions[ifNoFilesFound]

  if (!noFileBehavior) {
    noFileBehavior = NoFileOptions['warn']
    core.warning(
      `Unrecognized ${
        Inputs.IfNoFilesFound
      } input. Provided: ${ifNoFilesFound}. Available options: ${Object.keys(
        NoFileOptions
      )}. Defaulting to warn.`
    )
  }

shanepowell-ast avatar Apr 26 '22 14:04 shanepowell-ast

We are also experiencing this issue. Our configuration looks like the following:

- uses: actions/upload-artifact@v3
  with:
    name: <artifact-name>
    path: |
      path/to/file1
      path/to/file2
      path/to/file3

and exactly the below error is printed once this action runs:

Error: Unrecognized if-no-files-found input. Provided: . Available options: warn,error,ignore

I have tried the below configuration too, with the same error message.

- uses: actions/upload-artifact@v3
  with:
    name: <artifact-name>
    path: |
      path/to/file1
      path/to/file2
      path/to/file3
    if-no-files-found: warn

The odd thing is, the upload of files succeed. The problem is that this workflow looks to be failed because of this if-no-files-found issue.

umutozd avatar Sep 26 '22 08:09 umutozd

having the same issue, is there a fix ?

ameza avatar Mar 21 '23 07:03 ameza

same here!

raxden avatar May 15 '23 13:05 raxden

ain't this a beauty, I am already tired of countless github actions issues we are facing :) I hope it's the last time I ever use it.

wind57 avatar Sep 14 '23 17:09 wind57