M3Coordinator should return more helperful errors than just 500s from m3db
Right now, it seems that if an error is returned from M3DB like "shard is not yet bootstrapped to read" m3coordinator just throws a 500 with no indication of what happened. It would be more helpful if m3db errors could be propagated or translated so that relevant context isn't lost.
Is this for read or write? At least for read, we do: https://github.com/m3db/m3/blob/master/src/query/api/v1/handler/prometheus/remote/read.go#L100:20
@arslanbekov Ok I re-read your message from gitter, and it looks like you were getting the 500 from Prometheus. There is not a whole lot we can do to propagate better errors there, but I believe if you check the m3coordinator logs you would have seen the error message.
@richardartoul thanks for the answer. Yes, in logs m3coordinator many errors like this:
2018-09-06T09:01:03.909Z ERROR Write error
{
"rqID": "d4733522-5532-472f-9d25-985a9c5d95a8",
"err": "failed to meet consistency level majority with 0/1 success, 1 nodes responded, errors: [error writing to host m3db_local: connection pool has no connections]"
}
we are still analyzing
So we can close this out ?
yeah I think so
@Arslanbekov what did you find out ? I've been getting the same error here.
2018-09-13T13:28:55.405Z ERROR Write error {"rqID": "d0623f76-00c2-4015-bed6-0d8bd4f2719f", "err": "M3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized\nM3DB session not yet initialized"}
13:29:23.248291[W] cluster connect with consistency any: timed out connecting, returning success
13:29:23.571775[I] successfully updated topology to 1 hosts
I can operate m3db and it is ok as I've followed the documentation
@weslleycamilo hi! Yes, work for me, check it out:
- Namespace in m3db?
- Placement in m3db?
- With what cluster_id in
clusters.client.config.seedNodes.initialCluster[].hostIDconfig m3coordinator, it coincides with the fact that in placement?
My configuration: namespace:
{
"name": "default",
"options": {
"bootstrapEnabled": true,
"flushEnabled": true,
"writesToCommitLog": true,
"cleanupEnabled": true,
"snapshotEnabled": false,
"repairEnabled": false,
"retentionOptions": {
"retentionPeriodDuration": "720h",
"blockSizeDuration": "12h",
"bufferFutureDuration": "1h",
"bufferPastDuration": "1h",
"blockDataExpiry": true,
"blockDataExpiryAfterNotAccessPeriodDuration": "5m"
},
"indexOptions": {
"enabled": true,
"blockSizeDuration": "12h"
}
}
}
placement:
{
"num_shards": 6,
"replication_factor": 1,
"instances": [
{
"id": "m3db_local",
"zone": "embedded",
"weight": 100,
"endpoint": "m3db-node01.example.com:9000",
"hostname": "m3db-node01.example.com",
"port": 9000
}
]
}
config m3coordinator:
listenAddress:
type: "config"
value: "0.0.0.0:7201"
metrics:
scope:
prefix: "coordinator"
prometheus:
handlerPath: /metrics
listenAddress: 0.0.0.0:7203 # until https://github.com/m3db/m3/issues/682 is resolved
sanitization: prometheus
samplingRate: 1.0
extended: none
clusters:
- namespaces:
- namespace: default
storageMetricsType: unaggregated
retention: 48h
client:
config:
service:
env: default_env
zone: embedded
service: m3db
cacheDir: /var/lib/m3kv
etcdClusters:
- zone: embedded
endpoints:
- 10.10.10.10:2379
seedNodes:
initialCluster:
- hostID: m3db_local
endpoint: http://10.10.10.10:2380
writeConsistencyLevel: majority
readConsistencyLevel: unstrict_majority
writeTimeout: 10s
fetchTimeout: 15s
connectTimeout: 20s
writeRetry:
initialBackoff: 500ms
backoffFactor: 3
maxRetries: 2
jitter: true
fetchRetry:
initialBackoff: 500ms
backoffFactor: 2
maxRetries: 3
jitter: true
backgroundHealthCheckFailLimit: 4
backgroundHealthCheckFailThrottleFactor: 0.5
Hi, I have the same issue when i try to run m3db with prometheus.
The error is :
07/11/2019 15:11:23{"level":"error","ts":1573135883.550667,"msg":"write error","remoteAddr":"10.42.205.248:52656","httpResponseStatusCode":500,"numRegularErrors":100,"numBadRequestErrors":0,"lastRegularError":"failed to meet consistency level majority with 0/1 success, 1 nodes responded, errors: [error writing to host m3db_local: connection pool has no connections]","lastBadRequestErr":""}
07/11/2019 15:11:23{"level":"error","ts":1573135883.657391,"msg":"write error","remoteAddr":"10.42.205.248:52656","httpResponseStatusCode":500,"numRegularErrors":100,"numBadRequestErrors":0,"lastRegularError":"failed to meet consistency level majority with 0/1 success, 1 nodes responded, errors: [error writing to host m3db_local: connection pool has no connections]","lastBadRequestErr":""}
07/11/2019 15:11:23{"level":"error","ts":1573135883.764195,"msg":"write error","remoteAddr":"10.42.205.248:52656","httpResponseStatusCode":500,"numRegularErrors":100,"numBadRequestErrors":0,"lastRegularError":"failed to meet consistency level majority with 0/1 success, 1 nodes responded, errors: [error writing to host m3db_local: connection pool has no connections]","lastBadRequestErr":""}
07/11/2019 15:11:23{"level":"error","ts":1573135883.8710737,"msg":"write error","remoteAddr":"10.42.205.248:52656","httpResponseStatusCode":500,"numRegularErrors":100,"numBadRequestErrors":0,"lastRegularError":"failed to meet consistency level majority with 0/1 success, 1 nodes responded, errors: [error writing to host m3db_local: connection pool has no connections]","lastBadRequestErr":""}
Does anyone have an idea about how to handle this ?
Thank's ;)
I had this error when I tried to run prometheus with M3 using single node deployment. It was until I created DB using /api/v1/database/create (see mentioned manual).
maybe you should flow this: https://github.com/m3db/m3/blob/master/docs/how_to/cluster_hard_way.md#create-namespace-and-initialize-topology
if this doesn't work, just try config m3coordinator with writeWorkerPoolPolicy.
writeWorkerPoolPolicy:
grow: true
size: 1024
shards: 64
killProbability: 0.01