Hello! :wave: I got this error while deleting a wo...
# replication-troubleshooting
a
Hello! 👋 I got this error while deleting a workspace through API. How can this be resolved? Response Status: 422
Copy code
{
  "message": "The provided configuration does not fulfill the specification. Errors: json schema validation failed when comparing the data to the json schema. \nErrors: $.webhookConfigs[0].authToken: object found, string expected \nSchema: \n{\n  \"$schema\" : \"<http://json-schema.org/draft-07/schema#>\",\n  \"$id\" : \"<https://github.com/airbytehq/airbyte/blob/master/airbyte-config/models/src/main/resources/types/WebhookOperationConfigs.yaml>\",\n  \"title\" : \"WebhookOperationConfigs\",\n  \"description\" : \"List of configurations for webhook operations\",\n  \"additionalProperties\" : false,\n  \"type\" : \"object\",\n  \"properties\" : {\n    \"webhookConfigs\" : {\n      \"type\" : \"array\",\n      \"items\" : {\n        \"type\" : \"object\",\n        \"required\" : [ \"id\", \"name\" ],\n        \"properties\" : {\n          \"id\" : {\n            \"type\" : \"string\",\n            \"format\" : \"uuid\"\n          },\n          \"name\" : {\n            \"type\" : \"string\",\n            \"description\" : \"human readable name for this webhook e.g., for UI display\"\n          },\n          \"authToken\" : {\n            \"type\" : \"string\",\n            \"airbyte_secret\" : true,\n            \"description\" : \"An auth token, to be passed as the value for an HTTP Authorization header. Note - must include prefix such as \\\"Bearer <credential>\\\".\"\n          }\n        }\n      }\n    }\n  }\n}",
  "exceptionClassName": "io.airbyte.server.errors.BadObjectSchemaKnownException",
  "exceptionStack": [
    "io.airbyte.server.errors.BadObjectSchemaKnownException: The provided configuration does not fulfill the specification. Errors: json schema validation failed when comparing the data to the json schema. ",
    "Errors: $.webhookConfigs[0].authToken: object found, string expected ",
    "Schema: ",
    "{",
    "  \"$schema\" : \"<http://json-schema.org/draft-07/schema#>\",",
    "  \"$id\" : \"<https://github.com/airbytehq/airbyte/blob/master/airbyte-config/models/src/main/resources/types/WebhookOperationConfigs.yaml>\",",
    "  \"title\" : \"WebhookOperationConfigs\",",
    "  \"description\" : \"List of configurations for webhook operations\",",
    "  \"additionalProperties\" : false,",
    "  \"type\" : \"object\",",
    "  \"properties\" : {",
    "    \"webhookConfigs\" : {",
    "      \"type\" : \"array\",",
    "      \"items\" : {",
    "        \"type\" : \"object\",",
    "        \"required\" : [ \"id\", \"name\" ],",
    "        \"properties\" : {",
    "          \"id\" : {",
    "            \"type\" : \"string\",",
    "            \"format\" : \"uuid\"",
    "          },",
    "          \"name\" : {",
    "            \"type\" : \"string\",",
    "            \"description\" : \"human readable name for this webhook e.g., for UI display\"",
    "          },",
    "          \"authToken\" : {",
    "            \"type\" : \"string\",",
    "            \"airbyte_secret\" : true,",
    "            \"description\" : \"An auth token, to be passed as the value for an HTTP Authorization header. Note - must include prefix such as \\\"Bearer <credential>\\\".\"",
    "          }",
    "        }",
    "      }",
    "    }",
    "  }",
    "}",
    "\tat io.airbyte.server.apis.ConfigurationApi.execute(ConfigurationApi.java:851)",
    "\tat io.airbyte.server.apis.ConfigurationApi.deleteWorkspace(ConfigurationApi.java:269)",
    "\tat java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)",
    "\tat java.base/java.lang.reflect.Method.invoke(Method.java:578)",
    "\tat org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)",
    "\tat org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)",
    "\tat org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)",
    "\tat org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:159)",
    "\tat org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)",
    "\tat org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469)",
    "\tat org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391)",
    "\tat org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80)",
    "\tat org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:253)",
    "\tat org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)",
    "\tat org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)",
    "\tat org.glassfish.jersey.internal.Errors.process(Errors.java:292)",
    "\tat org.glassfish.jersey.internal.Errors.process(Errors.java:274)",
    "\tat org.glassfish.jersey.internal.Errors.process(Errors.java:244)",
    "\tat org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)",
    "\tat org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232)",
    "\tat org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)",
    "\tat org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)",
    "\tat org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)",
    "\tat org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)",
    "\tat org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)",
    "\tat org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)",
    "\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:763)",
    "\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:569)",
    "\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)",
    "\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1377)",
    "\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)",
    "\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:507)",
    "\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)",
    "\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1292)",
    "\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)",
    "\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)",
    "\tat org.eclipse.jetty.server.Server.handle(Server.java:501)",
    "\tat org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)",
    "\tat org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)",
    "\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)",
    "\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)",
    "\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)",
    "\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)",
    "\tat org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)",
    "\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)",
    "\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)",
    "\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)",
    "\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)",
    "\tat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)",
    "\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)",
    "\tat org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)",
    "\tat java.base/java.lang.Thread.run(Thread.java:1589)",
    "Caused by: io.airbyte.validation.json.JsonValidationException: json schema validation failed when comparing the data to the json schema. ",
    "Errors: $.webhookConfigs[0].authToken: object found, string expected ",
    "Schema: ",
    "{",
    "  \"$schema\" : \"<http://json-schema.org/draft-07/schema#>\",",
    "  \"$id\" : \"<https://github.com/airbytehq/airbyte/blob/master/airbyte-config/models/src/main/resources/types/WebhookOperationConfigs.yaml>\",",
    "  \"title\" : \"WebhookOperationConfigs\",",
    "  \"description\" : \"List of configurations for webhook operations\",",
    "  \"additionalProperties\" : false,",
    "  \"type\" : \"object\",",
    "  \"properties\" : {",
    "    \"webhookConfigs\" : {",
    "      \"type\" : \"array\",",
    "      \"items\" : {",
    "        \"type\" : \"object\",",
    "        \"required\" : [ \"id\", \"name\" ],",
    "        \"properties\" : {",
    "          \"id\" : {",
    "            \"type\" : \"string\",",
    "            \"format\" : \"uuid\"",
    "          },",
    "          \"name\" : {",
    "            \"type\" : \"string\",",
    "            \"description\" : \"human readable name for this webhook e.g., for UI display\"",
    "          },",
    "          \"authToken\" : {",
    "            \"type\" : \"string\",",
    "            \"airbyte_secret\" : true,",
    "            \"description\" : \"An auth token, to be passed as the value for an HTTP Authorization header. Note - must include prefix such as \\\"Bearer <credential>\\\".\"",
    "          }",
    "        }",
    "      }",
    "    }",
    "  }",
    "}",
    "\tat io.airbyte.validation.json.JsonSchemaValidator.ensure(JsonSchemaValidator.java:83)",
    "\tat io.airbyte.config.persistence.SecretsRepositoryWriter.statefulUpdateSecrets(SecretsRepositoryWriter.java:153)",
    "\tat io.airbyte.config.persistence.SecretsRepositoryWriter.writeWorkspace(SecretsRepositoryWriter.java:337)",
    "\tat io.airbyte.server.handlers.WorkspacesHandler.persistStandardWorkspace(WorkspacesHandler.java:313)",
    "\tat io.airbyte.server.handlers.WorkspacesHandler.deleteWorkspace(WorkspacesHandler.java:140)",
    "\tat io.airbyte.server.apis.ConfigurationApi.lambda$deleteWorkspace$1(ConfigurationApi.java:270)",
    "\tat io.airbyte.server.apis.ConfigurationApi.execute(ConfigurationApi.java:845)",
    "\t... 51 more"
  ],
  "rootCauseExceptionClassName": "java.lang.Class",
  "rootCauseExceptionStack": [
    "io.airbyte.validation.json.JsonValidationException: json schema validation failed when comparing the data to the json schema. ",
    "Errors: $.webhookConfigs[0].authToken: object found, string expected ",
✍️ 1
i
Copy code
"Errors: $.webhookConfigs[0].authToken: object found, string expected ",
Are you using a
yml
? Could it be that you have a new line in the
authToken
item and it's being parsed as an object?
a
I am using this open api link https://airbyte-public-api-docs.s3.us-east-2.amazonaws.com/rapidoc-api-docs.html#post-/v1/workspaces/delete of airbyte and have deployed airbyte instance on my local machine. and this is the .yaml file that I see in the ui which is being used by default in the api https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-api/src/main/openapi/config.yaml Also I have turned the authentication off by specifying the username:password as empty strings in the .env file.
I am also getting the same error message while hitting the /v1/workspaces/update_name endpoint
e
Hi. Can you please provide the full curl command?
s
Hey @Adwait Chavan, did you manage to get this resolved? If not, can you post the full commands you used as mentioned above?
a
No Saj it hasn't resolved yet... As I mentioned above I used the api documentation of Airbyte from where we can create/ delete/list workspace/sources etc. I have attached the screenshot of it below. Also here is the command that I hit in postman along with the body that I used to delete the workspace...
METHOD: POST
localhost:8000/api/v1/workspaces/delete
body { "workspaceId": "eea356cf-8635-4jec-5716-f3623bffbn88" }
Hey Eli this is the curl command that I used
Copy code
curl -X POST "<http://localhost:8000/api/v1/workspaces/delete>" \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 -d '{"workspaceId":"eea356cf-8635-4jec-5716-f3623bffbn88"}' \
👀 1
e
Hi Thanks. The command is correct. This is the error you have
Copy code
\"description\" : \"An auth token, to be passed as the value for an HTTP Authorization header. Note - must include prefix such as \\\"Bearer <credential>\\\".\"",
It wants you to give it a bearer token in the authorization header Are you using postman? since you can do it without one in postman
a
Yes I am using postman. In which file will i need to configure the bearer token ?
e
.env
a
I commented the Basic authentication lines and added this line
Bearer="password"
in the .env file and restarted docker... and passed the bearer token as password in postman still got the same error. Note: Create/list workspace apis are still working fine even if I don't pass the bearer token
I am not sure if this is the right way to configure bearer token in the .env file. Can you please verify it
e
what airbyte versions are you using? latest? In any case you can try like this curl --location --request POST 'http://localhost:8000/api/v1/workspaces/list' \ --header 'Authorization: Bearer any_token'
the token could be any thing
Copy code
curl --location --request POST '<http://localhost:8000/api/v1/workspaces/list>' \
--header 'Authorization: Bearer afolgjnbasfkjganfgoikajsdfnbg98q35ruhg802945gub24'
a
I am on latest version
0.40.17
I am getting the same error even after using the above command
Copy code
curl -L -X POST "<http://localhost:8000/api/v1/workspaces/delete>" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer afolgjnbasfkjganfgoikajsdfnbg98q35ruhg802945gub24"  -d "{"""workspaceId""":"""21bc09f3-506d-4175-9a3d-1c545a776d2c"""}"
e
that is very odd can you delete the Bearer from .env?
a
I removed the Bearer from .env, restarted the app and ran the curl command still got the same error
e
got it last go: create basic auth credentials and pass them as url params
a
Tried this as well still getting the same error 😶. Thank you Eli for your help I appreciate the time you gave for helping me.
e
no worries. I am interested also as to why this happens.
Copy code
"Errors: $.webhookConfigs[0].authToken: object found, string expected ",
can you make sure it`s a string?
a
Yes I tried all the possible combinations while passing the bearer token in the curl command
-H "Authorization: Bearer afolgjnbasfkjganfgoikajsdfnbg98q35ruhg802945gub24"
-H "Authorization: Bearer """afolgjnbasfkjganfgoikajsdfnbg98q35ruhg802945gub24""""
-H "Authorization: """Bearer afolgjnbasfkjganfgoikajsdfnbg98q35ruhg802945gub24""""
to make sure that it was considered as a string but every single time I got the same error
I think there must be some file in which we need to configure the Bearer token mandatorily in order to delete a workspace or in the .env file itself but with a fixed variable name... so that it is read at other locations... and if we don't provide it with any bearer token it takes the bearer token as an empty object which leads to datatype mismatch...
e
it is very odd to me since we dont use a token
s
Could this be possibly due to the new airbyte-proxy component?https://github.com/airbytehq/airbyte/pull/17694 The default username and password is airbyte and password respectively.
a
I also have this error, did you come up with any solution?
o
Request 186747300023272 created. Replies to this thread will be added to your request.
s
Hello, did you manage to resolve this? I am getting the same error while creating a workspace using API. @Adwait Chavan