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

cf share-service fails with exit code 1 if it is already shared #2669

Open
4 tasks done
svenXY opened this issue Nov 20, 2023 · 2 comments
Open
4 tasks done

cf share-service fails with exit code 1 if it is already shared #2669

svenXY opened this issue Nov 20, 2023 · 2 comments
Assignees

Comments

@svenXY
Copy link

svenXY commented Nov 20, 2023

Please fill out the issue checklist below and provide ALL the requested information.

  • I reviewed open and closed github issues that may be related to my problem.
  • I tried updating to the latest version of the CF CLI to see if it fixed my problem.
  • I attempted to run the command with CF_TRACE=1 to help debug the issue.
  • I am reporting a bug that others will be able to reproduce.

Describe the bug and the command you saw an issue with

With cf cli v8, the command
cf share-service srv-name -o org -s space fails (FAILED) and exits with 1 if the service is already shared with the org/space

Until recently, it just reported that it is already shared (OK) and ended with exitcode 0.

Looking at other cli commands like e.g. cf create-service, I'm under he impression that for idempotence reasons, commands that would only try to produce a state that already exists should not fail.

What happened

Gitlab pipelines fail all of a sudden due to new version of cf cli tools

Expected behavior

Pipelines should continue to work. If failing is going to be the new behaviou (to which I'd highly disagree!), it should at least be mentioned in the documentation (that does not make any mention of exit codes at all). Furthermore, there is no possibility to find out if a sharing is already in place except by grepping the output of cf service...

Exact Steps To Reproduce
Steps to reproduce the behavior; include the exact CLI commands and verbose output:

  1. Run cf share-service srv-name -o org -s space on a service that is already shared with the named org/space
  2. See error
@svenXY
Copy link
Author

svenXY commented Nov 20, 2023

RESPONSE: [2023-11-20T15:53:35+01:00]
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json; charset=utf-8
Date: Mon, 20 Nov 2023 14:53:35 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: nginx
Vary: Accept
X-B3-Spanid: 533b6174dda84c69
X-B3-Traceid: 3642895499764d5d533b6174dda84c69
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Runtime: 0.051301
X-Vcap-Request-Id: 36428954-9976-4d5d-533b-6174dda84c69::6c4c873b-d255-4110-a1e1-aa02b9c3c17d
X-Xss-Protection: 1; mode=block
{
  "errors": [
    {
      "code": 10008,
      "detail": "A service instance called wac-redis-rls has already been shared with cheba-public.",
      "title": "CF-UnprocessableEntity"
    }
  ]
}


A service instance called wac-redis-rls has already been shared with cheba-public.
FAILED

@JakobFels
Copy link

It seems like a similar issue was fixed for create-service in v8.3.0
2b4e144

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

No branches or pull requests

4 participants