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

[BUG] Error: 😭 error: File does not exist (1). #76

Open
VAllens opened this issue Feb 17, 2022 · 22 comments · Fixed by JustinWilkinson/DataTables.Blazor#17
Open

[BUG] Error: 😭 error: File does not exist (1). #76

VAllens opened this issue Feb 17, 2022 · 22 comments · Fixed by JustinWilkinson/DataTables.Blazor#17
Assignees
Labels
bug Something isn't working

Comments

@VAllens
Copy link

VAllens commented Feb 17, 2022

The push was successful, but I received an exception:

Error: 😭 error: File does not exist (1).

My publish.yml:

name: NuGet Publish

on:
  pull_request:
    branches: [ main ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Setup .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 6.0.x
    - name: Restore Obfuscation.Fody project dependencies
      run: dotnet restore src/Obfuscation.Fody/Obfuscation.Fody.csproj
    - name: Restore Obfuscation.Fody.NuGet project dependencies
      run: dotnet restore src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj
    - name: Build Obfuscation.Fody project
      run: dotnet build src/Obfuscation.Fody/Obfuscation.Fody.csproj --no-restore --configuration Release
    - name: Build Obfuscation.Fody.NuGet project
      run: dotnet build src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj --no-restore --configuration Release
    - name: Pack Obfuscation.Fody.NuGet project
      run: dotnet pack src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj --no-build --configuration Release
    - name: publish nuget package on version change
      uses: rohith/publish-nuget@v2
      with:
        PROJECT_FILE_PATH: src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj
        PACKAGE_NAME: Obfuscation.Fody
        VERSION_FILE_PATH: Directory.Build.props
        NUGET_KEY: ${{secrets.NUGET_API_KEY}}

console log:

Project Filepath: src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj
Version Filepath: Directory.Build.props
Version Regex: /^\s*<Version>(.*)<\/Version>\s*$/m
Version: 1.0.0
Package Name: Obfuscation.Fody
✨ found new version (1.0.0) of Obfuscation.Fody
NuGet Source: https://api.nuget.org
executing: [dotnet build -c Release src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj]
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  Obfuscation.Fody.NuGet -> /home/runner/work/Obfuscation.Fody/Obfuscation.Fody/src/Obfuscation.Fody.NuGet/bin/Release/Obfuscation.FodyHelper.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.94
executing: [dotnet pack  --no-build -c Release src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj -o .]
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Successfully created package '/home/runner/work/Obfuscation.Fody/Obfuscation.Fody/Obfuscation.Fody.1.0.0.nupkg'.
  OutputPackageDir: ../../packages
  NuPkgFiles: /home/runner/work/Obfuscation.Fody/Obfuscation.Fody/src/Obfuscation.Fody.NuGet/bin/Release/Obfuscation.Fody.1.0.0.nupkg
  Copy /home/runner/work/Obfuscation.Fody/Obfuscation.Fody/src/Obfuscation.Fody.NuGet/bin/Release/Obfuscation.Fody.1.0.0.nupkg to ../../packages successfully
Generated Package(s): Obfuscation.Fody.1.0.0.nupkg
executing: [dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k *** --skip-duplicate -n 1]
Pushing Obfuscation.Fody.1.0.0.nupkg to 'https://www.nuget.org/api/v2/package'...
  PUT https://www.nuget.org/api/v2/package/
  Created https://www.nuget.org/api/v2/package/ 704ms
Your package was pushed.
error: File does not exist (1).


Usage: dotnet nuget push [arguments] [options]

Arguments:
  [root]  Specify the path to the package and your API key to push the package to the server.

Options:
  -h|--help                      Show help information
  --force-english-output         Forces the application to run using an invariant, English-based culture.
  -s|--source <source>           Package source (URL, UNC/folder path or package source name) to use. Defaults to DefaultPushSource if specified in NuGet.Config.
  -ss|--symbol-source <source>   Symbol server URL to use.
  -t|--timeout <timeout>         Timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes).
  -k|--api-key <apiKey>          The API key for the server.
  -sk|--symbol-api-key <apiKey>  The API key for the symbol server.
  -d|--disable-buffering         Disable buffering when pushing to an HTTP(S) server to decrease memory usage.
  -n|--no-symbols                If a symbols package exists, it will not be pushed to a symbols server.
  --no-service-endpoint          Does not append "api/v2/package" to the source URL.
  --interactive                  Allow the command to block and require manual action for operations like authentication.
  --skip-duplicate               If a package and version already exists, skip it and continue with the next package in the push, if any.

Error: 😭 error: File does not exist (1).
/home/runner/work/_actions/rohith/publish-nuget/v2/index.js:23
        throw new Error(msg)
        ^

Error: error: File does not exist (1).
    at Action._printErrorAndExit (/home/runner/work/_actions/rohith/publish-nuget/v2/index.js:23:[15](https://github.com/VAllens/Obfuscation.Fody/runs/5226354030?check_suite_focus=true#step:9:15))
    at Action._pushPackage (/home/runner/work/_actions/rohith/publish-nuget/v2/index.js:73:18)
    at ClientRequest.<anonymous> (/home/runner/work/_actions/rohith/publish-nuget/v2/index.js:101:22)
    at Object.onceWrapper (events.js:300:26)
    at ClientRequest.emit (events.js:210:5)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:115:[17](https://github.com/VAllens/Obfuscation.Fody/runs/5226354030?check_suite_focus=true#step:9:17))
    at TLSSocket.socketOnData (_http_client.js:456:22)
    at TLSSocket.emit (events.js:[21](https://github.com/VAllens/Obfuscation.Fody/runs/5226354030?check_suite_focus=true#step:9:21)0:5)
    at addChunk (_stream_readable.js:[30](https://github.com/VAllens/Obfuscation.Fody/runs/5226354030?check_suite_focus=true#step:9:30)9:12)

here: https://github.com/VAllens/Obfuscation.Fody/runs/5226354030?check_suite_focus=true

@VAllens VAllens added the bug Something isn't working label Feb 17, 2022
@AddictedCS
Copy link

Got the same problem.

@Retrodad0001
Copy link

Retrodad0001 commented Feb 21, 2022

Got the same issue.. Nothing has changed in my action script

@capdiem
Copy link

capdiem commented Feb 22, 2022

Same issue

@capdiem
Copy link

capdiem commented Feb 22, 2022

NuGet/Home#11601
This seems to be a problem with nuget. I don't know what version of nuget the dotnet nuget command uses. If it is up-to-date every time, this problem may be solved with the update of the version of nuget.

@thomaswormald
Copy link

Same problem here. I have fixed it by removing references to this project and just pushing manually.

I previously had this in my workflow file:

    - name: Publish NuGet
      uses: brandedoutcast/publish-nuget@v2.5.5
      with:
        PROJECT_FILE_PATH: src/GrpcBrowser/GrpcBrowser.csproj
        PACKAGE_NAME: GrpcBrowser
        VERSION_FILE_PATH: src/GrpcBrowser/GrpcBrowser.csproj
        VERSION_REGEX: \s*<Version>(.*)<\/Version>\s*
        NUGET_KEY: ${{ secrets.NUGET_KEY }}

And I have replaced it with this:

    - name: Package
      run: dotnet pack -c Release -o . GrpcBrowser/GrpcBrowser.csproj
    - name: Publish
      run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json

@VAllens
Copy link
Author

VAllens commented Feb 24, 2022

Same problem here. I have fixed it by removing references to this project and just pushing manually.

I previously had this in my workflow file:

    - name: Publish NuGet
      uses: brandedoutcast/publish-nuget@v2.5.5
      with:
        PROJECT_FILE_PATH: src/GrpcBrowser/GrpcBrowser.csproj
        PACKAGE_NAME: GrpcBrowser
        VERSION_FILE_PATH: src/GrpcBrowser/GrpcBrowser.csproj
        VERSION_REGEX: \s*<Version>(.*)<\/Version>\s*
        NUGET_KEY: ${{ secrets.NUGET_KEY }}

And I have replaced it with this:

    - name: Package
      run: dotnet pack -c Release -o . GrpcBrowser/GrpcBrowser.csproj
    - name: Publish
      run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json

Missing git tag

@Retrodad0001
Copy link

Same problem here. I have fixed it by removing references to this project and just pushing manually.
I previously had this in my workflow file:

    - name: Publish NuGet
      uses: brandedoutcast/publish-nuget@v2.5.5
      with:
        PROJECT_FILE_PATH: src/GrpcBrowser/GrpcBrowser.csproj
        PACKAGE_NAME: GrpcBrowser
        VERSION_FILE_PATH: src/GrpcBrowser/GrpcBrowser.csproj
        VERSION_REGEX: \s*<Version>(.*)<\/Version>\s*
        NUGET_KEY: ${{ secrets.NUGET_KEY }}

And I have replaced it with this:

    - name: Package
      run: dotnet pack -c Release -o . GrpcBrowser/GrpcBrowser.csproj
    - name: Publish
      run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json

Missing git tag

Also checking if never version then check in else ignore?

@Retrodad0001
Copy link

Also fixed it with doing it manual like @VAllens.. I used this (for .net):

`name: Release Master NuGet

on:
push:
branches: [ master ]

jobs:
Release:
name: Release to Nuget
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out Repo
  uses: actions/checkout@v2

- name: Setup dotnet
  uses: actions/setup-dotnet@v1
  with:
    dotnet-version: 6.0.x

- name: Pack
  run: dotnet pack EasyDbMigrator\\EasyDbMigrator.csproj -c Release

- name: Publish to GitHub packages 
  run: dotnet nuget push /home/runner/work/EasyDbMigrator/EasyDbMigrator/EasyDbMigrator/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate`

@VAllens
Copy link
Author

VAllens commented Feb 28, 2022

还修复了它,像@VAllens一样手动完成。我用了这个(对于.net):

'名称: 发布主 NuGet

on: 推: 分支: [ 主 ]

作业: 发布: 名称: 发布到 Nuget 运行:ubuntu 最新超时分钟数: 10

steps:
- name: Check out Repo
  uses: actions/checkout@v2

- name: Setup dotnet
  uses: actions/setup-dotnet@v1
  with:
    dotnet-version: 6.0.x

- name: Pack
  run: dotnet pack EasyDbMigrator\\EasyDbMigrator.csproj -c Release

- name: Publish to GitHub packages 
  run: dotnet nuget push /home/runner/work/EasyDbMigrator/EasyDbMigrator/EasyDbMigrator/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate`

Good job.
Me too.

name: NuGet Publish

on:
  pull_request:
    types: [ closed ]
    branches: [ main ]

jobs:
  build:

    runs-on: ubuntu-latest
    if: github.event.pull_request.merged == true
    steps:
    - uses: actions/checkout@v2
    - name: Setup .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 6.0.x
    - name: Restore Obfuscation.Tasks project dependencies
      run: dotnet restore src/Obfuscation.Tasks/Obfuscation.Tasks.csproj
    - name: Build Obfuscation.Tasks project
      run: dotnet build src/Obfuscation.Tasks/Obfuscation.Tasks.csproj --no-restore --configuration Release
    - name: Pack Obfuscation.Tasks project
      run: dotnet pack src/Obfuscation.Tasks/Obfuscation.Tasks.csproj --no-build --configuration Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
    - name: Publish package to NuGet
      run: dotnet nuget push *.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source "https://api.nuget.org/v3/index.json" --skip-duplicate
    - name: publish package to GitHub
      run: dotnet nuget push *.nupkg --api-key ${{secrets.PUBLISH_TO_GITHUB_TOKEN}} --source "https://nuget.pkg.github.com/VAllens/index.json" --skip-duplicate

@Kurpanik
Copy link

Same issue here, however, the packaged was published successfully

@Peter-B-
Copy link

Peter-B- commented Mar 7, 2022

Same error message with the package being published successfully.

I recently changed from .net 5 to 6:

   steps:
    - name: Setup .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 5.0.x

to

   steps:
    - name: Setup .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 6.0.x

Maybe that triggered the error message.

@YounesCheikh
Copy link

For those having the same problem, It seems to be a dotnet 6 topic.
The problem is with the option -n (no symbols).
In previous versions of dotnet , using this parameter requires a value (true or false, 1 or 0). Since dotnet 6.0.102 -> 6.0.200 the value is not required anymore.

This is even written in the doc or on the help output for dotnet nuget push --help
-n|--no-symbols If a symbols package exists, it will not be pushed to a symbols server.

More info here

@Kurounin
Copy link

Kurounin commented Mar 11, 2022

You can use version 3.0.3 of this fork https://github.com/alirezanet/publish-nuget which among others includes a fix for this issue

@wbaldoumas
Copy link

You can use version 3.0.1 of this fork https://github.com/alirezanet/publish-nuget which among others includes a fix for this issue

There are a mountain of forks for this action. It would be really great if we identified and settled on one as the new "source of truth" for publishing to NuGet from GitHub Actions, since this repository seems to be abandoned.

@YounesCheikh
Copy link

You can use version 3.0.1 of this fork https://github.com/alirezanet/publish-nuget which among others includes a fix for this issue

There are a mountain of forks for this action. It would be really great if we identified and settled on one as the new "source of truth" for publishing to NuGet from GitHub Actions, since this repository seems to be abandoned.

I still don't see why use a Github action to push to nuget while you can achieve that by writing some lines? I abandoned the usage of this action and I'm using a native dotnet commands to push to nuget

@VAllens
Copy link
Author

VAllens commented Mar 21, 2022

您可以使用此分叉 https://github.com/alirezanet/publish-nuget 版本3.0.1,其中包括针对此问题的修复程序

这个动作有一堆叉子。如果我们确定并确定一个作为从 GitHub Actions 发布到 NuGet 的新"事实源",那将非常棒,因为此存储库似乎已被放弃。

我仍然不明白为什么使用Github操作来推送到nuget,而您可以通过编写一些行来实现这一点?我放弃了使用此操作,并且我正在使用本机dotnet命令推送到nuget

I'm now also using dotnet command to push to nuget.
The plugin, which has the advantage of Automatically git tag

@Kurounin
Copy link

You can use version 3.0.1 of this fork https://github.com/alirezanet/publish-nuget which among others includes a fix for this issue

There are a mountain of forks for this action. It would be really great if we identified and settled on one as the new "source of truth" for publishing to NuGet from GitHub Actions, since this repository seems to be abandoned.

I still don't see why use a Github action to push to nuget while you can achieve that by writing some lines? I abandoned the usage of this action and I'm using a native dotnet commands to push to nuget

The advantage is that it checks whether the version in .csproj was modified and only runs build, pack, publish and then git tag if necessary.

adriansinger87 pushed a commit to telescope-dotnet/telescope that referenced this issue Mar 30, 2022
update of action script to fix internal bug, see brandedoutcast/publish-nuget#76
@ThomasWillumsen
Copy link

This is still an issue.

@Kurpanik
Copy link

Kurpanik commented May 5, 2022

This is still an issue.

There is a good fork of it. Simply replace this part in your workflow with alirezanet/publish-nuget@v3.0.4 and your are done

@ThomasWillumsen
Copy link

Yeah I'll either do that or just drop it and use dotnet nuget push.
Thanks.

@Kurpanik
Copy link

Kurpanik commented May 5, 2022

If other functions of this workflow like tagging are not needed, using dotnet nuget push directly is of course a viable and probably a better option :)

cajuncoding added a commit to cajuncoding/LazyCacheHelpers that referenced this issue May 17, 2022
Per the Thread here, I kept getting "error: File does not exist (1)." but this other Fork resolves it as noted by the 11 Stars on it (vs many other random forks).
 - brandedoutcast/publish-nuget#76 (comment)
maartenjanvangool pushed a commit to orangebeard-io/dotnet-client that referenced this issue Jun 15, 2022
nor0x added a commit to nor0x/Maui.ColorPicker that referenced this issue Aug 22, 2022
EloyEspinosa added a commit to EloyEspinosa/Weather.NET that referenced this issue Aug 23, 2022
Changed the action used for CD, see brandedoutcast/publish-nuget#76, which was generating false fails.
@KursatSonmez
Copy link

KursatSonmez commented Aug 25, 2022

Problem solved for me. Your dotnet-version of the job is must be same to dotnet version of your project. dotnet version of my project is 5.0 but dotnet version in my job is 6.0.x. I changed version 6.0.x to 5.0.x in the job.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.