wundergraph / cosmo

The open-source solution to building, maintaining, and collaborating on GraphQL Federation at Scale. An alternative to Apollo Studio and GraphOS.
https://cosmo-docs.wundergraph.com/
Apache License 2.0
573 stars 66 forks source link

wgc require token when docker run #782

Open khoahoang88 opened 2 weeks ago

khoahoang88 commented 2 weeks ago

Component(s)

router

Component version

0.53.2

wgc version

0.53.2

controlplane version

0.53.2

router version

0.53.2

What happened?

Description

I want to run docker image without login into Control Plan as guideline: https://github.com/wundergraph/cosmo-demo

Steps to Reproduce

  1. Run: docker run --rm -it --platform=linux/amd64 --name cosmo-router --env-file .env.local -v $(pwd)/config.json:/app/config.json -p 3001:3001 ghcr.io/wundergraph/cosmo/router:latest

    Expected Result

    Run Router image

    Actual Result

    {"level":"fatal","time":1715552705741,"msg":"Could not create app","hostname":"5bb5717a8db1","pid":1,"component":"@wundergraph/router","service_version":"0.85.2","error":"invalid token token is malformed: token contains an invalid number of segments","stacktrace":"github.com/wundergraph/cosmo/router/cmd.Main\n\tgithub.com/wundergraph/cosmo/router/cmd/main.go:73\nmain.main\n\t./main.go:8\nruntime.main\n\truntime/proc.go:267"}

Environment information

Environment

OS: Mac OS Sonoma 14.1 Package Manager: npm Compiler: npm 10.2.0

Router configuration

{"engineConfig":{"defaultFlushInterval":"500","datasourceConfigurations":[{"kind":"GRAPHQL","rootNodes":[{"typeName":"Post","fieldNames":["id","content","authorId"]},{"typeName":"Query","fieldNames":["posts","post"]}],"overrideFieldPathFromAlias":true,"customGraphql":{"fetch":{"url":{"staticVariableContent":"http://host.docker.internal:4001/graphql"},"method":"POST","body":{},"baseUrl":{},"path":{}},"subscription":{"enabled":true,"url":{"staticVariableContent":"http://host.docker.internal:4001/graphql"},"protocol":"GRAPHQL_SUBSCRIPTION_PROTOCOL_WS"},"federation":{"enabled":true,"serviceSdl":"type Post @key(fields: \"id\") {\n  id: ID!\n  content: String\n  authorId: ID!\n}\n\ntype Query {\n  posts: [Post!]!\n  post(id: ID!): Post\n}\n"},"upstreamSchema":{"key":"148cae0c5b5b812ee3ec8e368862577ba4bfd15d"}},"requestTimeoutSeconds":"10","id":"0","keys":[{"typeName":"Post","selectionSet":"id"}]},{"kind":"GRAPHQL","rootNodes":[{"typeName":"User","fieldNames":["id","name"]},{"typeName":"Post","fieldNames":["id","author"]},{"typeName":"Query","fieldNames":["users","user"]}],"overrideFieldPathFromAlias":true,"customGraphql":{"fetch":{"url":{"staticVariableContent":"http://host.docker.internal:4002/graphql"},"method":"POST","body":{},"baseUrl":{},"path":{}},"subscription":{"enabled":true,"url":{"staticVariableContent":"http://host.docker.internal:4002/graphql"},"protocol":"GRAPHQL_SUBSCRIPTION_PROTOCOL_WS"},"federation":{"enabled":true,"serviceSdl":"type User @key(fields: \"id\") {\n  id: ID!\n  name: String!\n}\n\ntype Post @key(fields: \"id\") {\n  id: ID!\n  authorId: ID! @external\n  author: User! @requires(fields: \"authorId\")\n}\n\ntype Query {\n  users: [User!]!\n  user(id: ID!): User\n}\n"},"upstreamSchema":{"key":"d7822358d4793d6bf395d1f186766d904591de4a"}},"requestTimeoutSeconds":"10","id":"1","keys":[{"typeName":"User","selectionSet":"id"},{"typeName":"Post","selectionSet":"id"}],"requires":[{"typeName":"Post","fieldName":"author","selectionSet":"authorId"}]}],"fieldConfigurations":[{"typeName":"Query","fieldName":"post","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"}]},{"typeName":"Query","fieldName":"user","argumentsConfiguration":[{"name":"id","sourceType":"FIELD_ARGUMENT"}]}],"graphqlSchema":"directive @tag(name: String!) repeatable on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION\n\ntype Post {\n  id: ID!\n  content: String\n  authorId: ID!\n  author: User!\n}\n\ntype Query {\n  posts: [Post!]!\n  post(id: ID!): Post\n  users: [User!]!\n  user(id: ID!): User\n}\n\ntype User {\n  id: ID!\n  name: String!\n}","stringStorage":{"148cae0c5b5b812ee3ec8e368862577ba4bfd15d":"schema {\n  query: Query\n}\n\ndirective @extends on INTERFACE | OBJECT\n\ndirective @external on FIELD_DEFINITION | OBJECT\n\ndirective @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @provides(fields: openfed__FieldSet!) on FIELD_DEFINITION\n\ndirective @requires(fields: openfed__FieldSet!) on FIELD_DEFINITION\n\ndirective @tag(name: String!) repeatable on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION\n\ntype Post @key(fields: \"id\") {\n  authorId: ID!\n  content: String\n  id: ID!\n}\n\ntype Query {\n  post(id: ID!): Post\n  posts: [Post!]!\n}\n\nscalar openfed__FieldSet","d7822358d4793d6bf395d1f186766d904591de4a":"schema {\n  query: Query\n}\n\ndirective @extends on INTERFACE | OBJECT\n\ndirective @external on FIELD_DEFINITION | OBJECT\n\ndirective @key(fields: openfed__FieldSet!, resolvable: Boolean = true) repeatable on INTERFACE | OBJECT\n\ndirective @provides(fields: openfed__FieldSet!) on FIELD_DEFINITION\n\ndirective @requires(fields: openfed__FieldSet!) on FIELD_DEFINITION\n\ndirective @tag(name: String!) repeatable on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION\n\ntype Post @key(fields: \"id\") {\n  author: User! @requires(fields: \"authorId\")\n  authorId: ID! @external\n  id: ID!\n}\n\ntype Query {\n  user(id: ID!): User\n  users: [User!]!\n}\n\ntype User @key(fields: \"id\") {\n  id: ID!\n  name: String!\n}\n\nscalar openfed__FieldSet"}},"subgraphs":[{"id":"0","name":"posts","routingUrl":"http://host.docker.internal:4001/graphql"},{"id":"1","name":"users","routingUrl":"http://host.docker.internal:4002/graphql"}]}

Router execution config

No response

Log output

No response

Additional context

No response

github-actions[bot] commented 2 weeks ago

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible. The roadmap is driven by our customers and we have to prioritize issues that are important to them. You can influence the priority by becoming a customer. Please contact us here.

jensneuse commented 2 weeks ago

Do you have a valid token in your .env.local file?