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

[v4] Commit creating failed: ["Service not found: none"] #263

Closed
dfed opened this issue Feb 2, 2024 · 32 comments
Closed

[v4] Commit creating failed: ["Service not found: none"] #263

dfed opened this issue Feb 2, 2024 · 32 comments
Assignees

Comments

@dfed
Copy link

dfed commented Feb 2, 2024

I'm trying to migrate to v4 and I've encountered two errors on an ubuntu-latest runner.

First: same error message as codecov/codecov-action#1252, which I fixed by adding a Setup Python step to ensure that 3.10 was installed.

Second: Commit creating failed: ["Service not found: none"]

I haven't yet found a workaround for this second issue.

For what it's worth, my macOS runner is succeeding with v4.


[@thomasrockhu-codecov edit]
The root cause of this error is that all git calls made by the CLI here are failing. The error message is

fatal: detected dubious ownership in repository at '/__w/example-python/example-python'\nTo add an exception for this directory, call:

    git config --global --add safe.directory /__w/example-python/example-python

The repo example-python will of course be different for each repo.

This call SHOULD be made by the checkout step (see the previous comment issues tagged) and this log.
image

but we notice that this isn't happening.

A possible solution would be to have the CLI make this call (git config --global --add safe.directory <working_dir>), but not sure if that's the solution we want.

@jonhoo
Copy link

jonhoo commented Feb 3, 2024

I'm seeing the same thing in https://github.com/jonhoo/flurry/actions/runs/7765831951/job/21180957330, and I suspect the problem is related to the job running in a container. I have upgraded a bunch of other repos to v4 without issue (beyond having to set the CODECOV_TOKEN secret time and time again), but none of those have been using a container.

lambdalisue referenced this issue in vim-denops/deno-denops-std Feb 3, 2024
Not sure but it seems that the target repository must be checked out to the root directory.
Otherwise codecov-action@v4 fails with "Service not found: none" error.

https://github.com/codecov/codecov-action/issues/1253
@marekdedic
Copy link

I have the issue too, and also only for jobs running in a container :)

@valebes
Copy link

valebes commented Feb 5, 2024

I'm having this problem too.

@thomasrockhu-codecov
Copy link
Contributor

Currenlty working on a fix

@thomasrockhu-codecov
Copy link
Contributor

Hi all, I've figured out the root cause, but I don't have a forever solution. For now, a workaround is to add

git config --global --add safe.directory "$GITHUB_WORKSPACE"   # or similar directory

before running Codecov. I didn't expect this to be a problem since the checkout step from GitHub does run this, and you can see some issues actions/runner-images#6775 and actions/checkout#915

I'm looking to add this into the CLI, but I'm not yet 100% we will want this behavior there.

@thomasrockhu-codecov
Copy link
Contributor

The root cause of this error is that all git calls made by the CLI here are failing. The error message is

fatal: detected dubious ownership in repository at '/__w/example-python/example-python'\nTo add an exception for this directory, call:

    git config --global --add safe.directory /__w/example-python/example-python

The repo example-python will of course be different for each repo.

This call SHOULD be made by the checkout step (see the previous comment issues tagged) and this log.
image

but we notice that this isn't happening.

A possible solution would be to have the CLI make this call (git config --global --add safe.directory <working_dir>), but not sure if that's the solution we want.

@covecod covecod bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Feb 6, 2024
@thomasrockhu-codecov thomasrockhu-codecov transferred this issue from codecov/codecov-action Feb 6, 2024
valebes added a commit to valebes/ppl that referenced this issue Feb 6, 2024
@drazisil-codecov
Copy link

@drazisil-codecov drazisil-codecov moved this from Waiting for: Product Owner to Waiting for: Community in GitHub Issues with 👀 Feb 6, 2024
@dfed
Copy link
Author

dfed commented Feb 6, 2024

Workaround worked. Thanks!

@covecod covecod bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 Feb 6, 2024
@marekdedic
Copy link

Hi,
sorry, I am a little bit confused - is this issue actually solved? If there is merely a workaround, I don't think it should be closed...

dcpesses added a commit to dcpesses/vite-react-ts-gh that referenced this issue Feb 22, 2024
dcpesses added a commit to dcpesses/vite-react-ts-gh that referenced this issue Feb 22, 2024
dcpesses added a commit to dcpesses/vite-react-ts-gh that referenced this issue Feb 23, 2024
dcpesses added a commit to dcpesses/vite-react-ts-gh that referenced this issue Feb 23, 2024
@dcpesses
Copy link

In case this helps anyone, it seems codecov-actions@v4 requires the presence of a checked out repo within the same job in order to autodetect the proper values it needs to send when uploading.

In my workflow, the coverage get generated in a "Build & Test" job, which is then handed off to a separate "Coverage Analysis" job as an artifact (using actions/download-artifact@v4).

That setup had worked fine for v3, but when I upgraded to v4, I kept receiving the same "Service not found" error, even after applying the workaround discussed above. Once I added actions/checkout@v4 to the top of the Coverage Analysis job, it worked immediately.

Many thanks to this comment for the inspiration.

@thomasrockhu-codecov
Copy link
Contributor

@dfed it looks like the latest run you made is working, is that accurate?

@jonhoo thanks for sharing your repo, I have tested a fix out on a fork and it looks promising. The fix should be shipped sometime next week.

If you would like to see if this fix will work for you, please use this version of the action

codecov/codecov-action@036b81c4b4e8314b391265bc226440f9e2117e2a

@dfed
Copy link
Author

dfed commented Feb 24, 2024

@thomasrockhu-codecov I am unblocked because I used the git config workaround.

I just put up a PR to test your new codecov sha and we'll know if it worked in ~6 minutes

@thomasrockhu-codecov
Copy link
Contributor

@dfed ah! I totally missed that in the config, you're right

@dfed
Copy link
Author

dfed commented Feb 24, 2024

@thomasrockhu-codecov good news! codecov/codecov-action@036b81c4b4e8314b391265bc226440f9e2117e2a worked without the workaround!

@marekdedic
Copy link

Hi, I don't know if it was supposed to fix it, but I can report that version 4.0.2 does not fix the issue for me - see skaut/shared-drive-mover#1518

@kdarkhan
Copy link

kdarkhan commented Feb 26, 2024

@thomasrockhu-codecov can you take a look at this PR codecov/codecov-cli#376?

I thought that it might resolve the issue and it has not been reviewed for 3 weeks already.

@thomasrockhu-codecov
Copy link
Contributor

@marekdedic 4.0.2 does not include the fix mentioned above. 4.0.3 should

@thomasrockhu-codecov
Copy link
Contributor

@kdarkhan I don't believe that fixes the underlying cause, and will break for github_enterprise. This PR should fix the underlying issue for the action.

@kdarkhan
Copy link

Got it, thanks for taking a look. I am ok as long as the issue is fixed. I did notice that in the PR you mentioning that the issue will fix it for containers. In my case, I am not using any containers and safe.directory workaround mentioned above does not work for me. The issue I am facing is the one reported in codecov/codecov-action#1287

I am hoping that your PR will fix both issues.

@thomasrockhu-codecov
Copy link
Contributor

@kdarkhan that issue is on my list, thanks for bringing it up. Any more information you can bring to it would be helpful when tackling this week.

@thomasrockhu-codecov
Copy link
Contributor

Ok, a fix has been made in 4.1.0. @dfed you should be able to switch back to v4 with this fix in. fyi @marekdedic

@dfed
Copy link
Author

dfed commented Feb 26, 2024

Confirmed this is working for me with v4 and no workaround!

@marekdedic
Copy link

Confirming v4.1.0 fixes the issue for me as well, thanks! :)

@thomasrockhu-codecov
Copy link
Contributor

@kdarkhan can you take a look and see if 4.1.0 fixes your issue?

@kdarkhan
Copy link

kdarkhan commented Feb 26, 2024

The issue with the "service not found" is fixed but I am still facing an error with the upload file not being found. I think this is specific to running the coverage report in specific subdirectory, so let me move that conversation into codecov/codecov-action#1287

@bmulholland
Copy link

@kdarkhan I had to add with: -> working_directory: "path" to codecov's action

@thomasrockhu-codecov
Copy link
Contributor

Closing this out as the original issue has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting for: Product Owner
Development

No branches or pull requests

10 participants