I cannot add domain via dashboard ui. it says invalid route
{
"code":"validation_error",
"message":"Invalid route",
"detail":{
"type":"http",
"parent_ref":"controller/apps/7db3cfc4-8325-4803-ba6c-eebfb1aced06",
"service":"knife-web",
"leader":false,
"created_at":"0001-01-01T00:00:00Z",
"updated_at":"0001-01-01T00:00:00Z",
"domain":"back.domain.com",
"path":"/"
},
"retry":false
}
I am able to add routes via flynn cli though
flynn-host version: v20180516.0-4e64441
this fixed the issue in dashboard but API still does not work. weird thing is, it works on one app and does not on the other. I used the exact same request for those two.
I found app uuid by getting the list of apps, just to make sure nothing else is wrong.
request body:
{
"type": "http",
"service": "react-web",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z",
"domain": "example.kamva.ir"
}
error for this one:
{
"code": "validation_error",
"message": "Invalid route",
"detail": {
"type": "http",
"parent_ref": "controller/apps/0c164e33-88ee-4935-8e2c-67db0c2f7a05",
"service": "kangaroo-web",
"leader": false,
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z",
"domain": "example.kamva.ir"
},
"retry": false
}
for this app, adding routes work just fine! note no difference in request
{
"type": "http",
"service": "shop-web",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z",
"domain": "example.kamva.ir"
}
response:
{
"type": "http",
"id": "7221fb4c-ec47-4505-8d5c-9e06a5ddb44e",
"parent_ref": "controller/apps/ab87cb4f-3702-4067-b968-1ec130c04171",
"service": "shop-app-web",
"leader": false,
"created_at": "2018-08-28T08:11:47.237399Z",
"updated_at": "2018-08-28T08:11:47.237399Z",
"domain": "example.kamva.ir"
}
by the way, the docs says format domain like this "domain": "http://example.com"
which is wrong.
@hadifarnoud try adding "drain_backends": true
to the request body. There's a fairly new database constraint preventing any routes from being created with a different value for drain_backends
than any existing routes for the app. As the default route creating with the app sets this value to true
, I suspect it's presence is what's causing the request to fail. We need to update the error message to be more descriptive and document drain_backends
. This field indicates that the scheduler is to wait until all routes have completed before stopping jobs when it is set to true
.
by the way, the docs says format domain like this "domain": "http://example.com" which is wrong.
Thanks! Having accurate documentation is important.
thanks @jvatic. I can confirm that fixed the issue