blackbox_exporter icon indicating copy to clipboard operation
blackbox_exporter copied to clipboard

msg="Error loading config" err="error parsing config file: yaml: unmarshal errors:\n line 6: field vaild_http_versions not found in type config.plain\n line 7: field vaild_status_codes not found in type config.plain"

Open doing-cr7 opened this issue 3 years ago • 2 comments

this is my deployment.yaml

kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: blackbox-exporter
  namespace: kube-system
  labels:
    app: blackbox-exporter
  annotations:
    deployment.kubernetes.io/revision: 1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: blackbox-exporter
  template:
    metadata:
      labels:
        app: blackbox-exporter
    spec:
      volumes:
      - name: config
        configMap:
          name: blackbox-exporter
          defaultMode: 420
      containers:
      - name: blackbox-exporter
        image: harbor.od.com/public/blackbox-exporter:v0.15.1
        imagePullPolicy: IfNotPresent
        args:
        - --config.file=/etc/blackbox-exporter/blackbox.yml
        - --log.level=info
        - --web.listen-address=:9115
        ports:
        - name: blackbox-port
          containerPort: 9115
          protocol: TCP
        resources:
          limits:
            cpu: 200m
            memory: 256Mi
          requests:
            cpu: 100m
            memory: 50Mi
        volumeMounts:
        - name: config
          mountPath: /etc/blackbox_exporter
        readinessProbe:
          tcpSocket:
            port: 9115
          initialDelaySeconds: 5
          timeoutSeconds: 10
          successThreshold: 1
          failureThreshold: 3

this is status CrashLoopBackOff

[root@hdss7-21 ~]# kubectl get pod -n kube-system
NAME                                    READY   STATUS             RESTARTS   AGE
blackbox-exporter-79d6977f8d-q25cs      0/1     CrashLoopBackOff   1          10s

this is my log

[root@hdss7-21 ~]# kubectl logs -f blackbox-exporter-79d6977f8d-q25cs -n kube-system
level=info ts=2021-02-12T02:35:45.352Z caller=main.go:212 msg="Starting blackbox_exporter" version="(version=0.15.1, branch=HEAD, revision=7dd86a593b5a2270e738be1654d9c112509e46ce)"
level=info ts=2021-02-12T02:35:45.353Z caller=main.go:213 msg="Build context" (gogo1.13,userroot@626ba8fd110c,date20190917-12:31:25)=(MISSING)
level=error ts=2021-02-12T02:35:45.354Z caller=main.go:216 msg="Error loading config" err="error parsing config file: yaml: unmarshal errors:\n  line 6: field vaild_http_versions not found in type config.plain\n  line 7: field vaild_status_codes not found in type config.plain"
[root@hdss7-21 ~]#

doing-cr7 avatar Feb 12 '21 03:02 doing-cr7

What does the configuration file look like?

The blackbox_exporter binary can validate the config passing --config.file=path and --config.check on the command line.

mem avatar Feb 15 '21 23:02 mem

please see https://github.com/prometheus/blackbox_exporter/blob/master/CONFIGURATION.md to learn more about available config options.

electron0zero avatar Mar 01 '21 13:03 electron0zero

This error is occurring after cloning the repo and following the basic directions on running from docker. If other things are needed to run this correctly ( still not sure what this error is complaining about ), it should be added to the readme.

elliottb303 avatar Aug 15 '22 18:08 elliottb303

For questions/help/support please use our community channels. There are more people available to potentially respond to your request and the whole community can benefit from the answers provided.

SuperQ avatar Aug 15 '22 19:08 SuperQ

@elliottb303 Where you able to resolve it? I'm facing the similar issue after cloning the repo and running make docker-generate:

"Error generating config netsnmp" err="error parsing yml config: yaml: unmarshal errors:\n line 3: field version not found in type main.Config\n line 5: field auths not found in type main.Config"

antonprokopovich avatar Jul 19 '23 21:07 antonprokopovich

@doing-cr7 I you have not provided the "valid_http_versions" value in your config, for reference can you check this: Note: do mind the indentations here, can't put it with proper ones here :)

http_200: prober: "http" timeout: 5s http: preferred_ip_protocol: "ip4" fail_if_ssl: true no_follow_redirects: true valid_status_codes: [200] valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]

also @antonprokopovich can you check this configs, you might be missing something from here: https://github.com/prometheus/blackbox_exporter/blob/master/CONFIGURATION.md#:~:text=the%20configured%20credentials.-,authorization,-%3A%0A%20%20%20%20%23%20Sets

sansingh-zuora avatar Apr 02 '24 12:04 sansingh-zuora