zowe / zowe/api-layer

Onboarding and routing to a service with invalid serviceId

Open
#3,844 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Priority: High size/M V3
Dominant language
Java
Stars
92
Forks
81
Avg merge
1d 9h
Merged PRs (30d)
46

Description

Describe the bug

The invalid serviceId (against the conformance) has an unexpected behavior.

Steps to Reproduce

  1. register a service with serviceId service_test
  2. try to call an endpoint ie. /service_test/api/v1
  3. the response is 500

Expected behavior
It should route well or inform about wrong inputs

The root cause is that GW uses a load balancer. To identify the instance it uses a URI like lb://service_test. During the processing by the load balancer, it is necessary to parse the URI and it is a problem because the URI is not valid (for _ character - https://www.ietf.org/rfc/rfc0952.txt). It leads to internal server error 500.

Possible solution:

  1. reject onboarding with invalid serviceId (or potentially other values)
  • the DS could return 400 in this case
  • if the service logs the reason for error it could be displayed
  1. rename serviceId internally
  • use as service ID encoded string (ie by using -)
  • we need to provide the original serviceId in metadata to be possible to construct url for a routing rule
  1. update enabler to verify this value and at least log warn message or rather stop onboarding process

Details

  • Version and build number: 3.0.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the onboarding and routing flow using serviceId service_test, then inspect the serviceId validation, load-balancer URI handling, and downstream response path. The issue does not select a solution, so first confirm whether invalid IDs should be rejected or encoded. Done means the chosen behavior avoids the 500 response and has coverage for invalid service IDs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.