Federation with Java & DGS: Getting error while hitting query via router

Federation with Java & DGS: Getting error while hitting query via router. Hitting subgraph directly working fine.

I have checked apollo studio, everything is configured correctly.

Request:

query GetFeaturedPlaylists {
  featuredPlaylists {
    id
    name
    description
  }
}

Via router

{
    "data": null,
    "errors": [
        {
            "message": "HTTP fetch failed from 'soundtracks': 404: Not Found",
            "extensions": {
                "code": "SUBREQUEST_HTTP_ERROR",
                "service": "soundtracks",
                "reason": "404: Not Found",
                "http": {
                    "status": 404
                }
            }
        },
        {
            "message": "HTTP fetch failed from 'soundtracks': subgraph didn't return JSON (expected content-type: application/json or content-type: application/graphql-response+json; found content-type: text/html)",
            "extensions": {
                "code": "SUBREQUEST_HTTP_ERROR",
                "service": "soundtracks",
                "reason": "subgraph didn't return JSON (expected content-type: application/json or content-type: application/graphql-response+json; found content-type: text/html)",
                "http": {
                    "status": 404
                }
            }
        }
    ]
}

via directly subgraph:

{
    "data": {
        "featuredPlaylists": [
            {
                "id": "6Fl8d6KF0O4V5kFdbzalfW",
                "name": "Sweet Beats & Eats",
                "description": "Tooth-achingly sweet beats for your sweet eats"
            },
            {
                "id": "20RU4pHDte01QywpOL6ifh",
                "name": "Grilling Tunes",
                "description": "Set the barbecue mood. Upbeat and laid-back tracks complement the sizzle of the grill, turning your outdoor cooking sessions into a flavorful experience. For those who savor good music and great food, it's the perfect playlist"
            },
            {
                "id": "6LB6g7S5nc1uVVfj00Kh6Z",
                "name": "Zesty Culinary Harmony",
                "description": "Infuse flavor into your kitchen. This playlist merges zesty tunes with culinary vibes, creating a harmonious background for your cooking escapades. Feel the synergy between music and the zest of your creations."
            }
        ]
    }
}

Hey there @punjprakash - sorry to hear you were getting this error and for the late reply! Were you able to get it fixed? Happy to take a look at your code to try and reproduce the issue.

Hi Michelle, Yes I was able to fix it. When router calls subgraph, it was hitting 127.0.01:8080/graphQL. Somehow, 127.0.01:8080/graphQL was giving 404 ( I enabled router logs to get more info) . I restarted my computer and it worked.

I wish, there was better error message in the response.

Thanks,
Punj