Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAProxy gives warnings about generated config #20

Open
ema-pe opened this issue Nov 20, 2024 · 0 comments
Open

HAProxy gives warnings about generated config #20

ema-pe opened this issue Nov 20, 2024 · 0 comments
Labels
dfaas-agent Related to the agent component dfaas-node Related to the agent node

Comments

@ema-pe
Copy link
Collaborator

ema-pe commented Nov 20, 2024

The /etc/haproxy/haproxy.cfg configuration file generated by the DFaaS agent contains some warnings that are issued when HAProxy is started or reloaded:

An example of the generated configuration
# HAProxy configuration file updated on 2024-11-20 14:56:00.031319314 +0000 UTC m=+88144.203715452

global
    stats socket /run/haproxy/admin.sock mode 666 level admin
    log stdout local0

defaults
    mode http

    log global
    option httplog

    timeout connect 5000
    timeout client 50000
    timeout server 50000

backend st_users_func_figlet
    stick-table type integer size 10 expire 1m0s store http_req_cnt,http_req_rate(1s)
backend st_users_func_ocr
    stick-table type integer size 10 expire 1m0s store http_req_cnt,http_req_rate(1s)
backend st_users_func_shasum
    stick-table type integer size 10 expire 1m0s store http_req_cnt,http_req_rate(1s)


frontend fe_main
    bind *:80

    stats enable
    stats auth admin:admin
    stats uri /haproxy?stats

    
    acl is_hdr_nodeID_known always_false
    
    

    http-request set-var(req.hdrcnt_nodeid) hdr_cnt(DFaaS-Node-ID)
    acl has_nodeid_hdr var(req.hdrcnt_nodeid),add(0) gt 0
    http-request capture str(hdrID:),concat(,req.hdrcnt_nodeid,) len 10

    acl is_path_root path /
    acl is_path_healthz path /healthz
    acl is_path_haproxy path_beg /haproxy
    acl is_path_system_funcs path /system/functions
    acl is_path_function path_beg /function/

    acl is_func_figlet path_beg /function/figlet
    acl is_func_ocr path_beg /function/ocr
    acl is_func_shasum path_beg /function/shasum
    
    
    http-request capture req.hdr(Host) len 50
    http-request capture req.hdr(DFaaS-Node-ID) len 50

    http-request deny unless is_path_root or is_path_healthz or is_path_haproxy or is_path_system_funcs or is_path_function

    http-request deny deny_status 403 if has_nodeid_hdr !is_hdr_nodeID_known
    
    use_backend be_ok if is_path_root
    use_backend be_healthz if is_path_healthz
    use_backend be_system_funcs if is_path_system_funcs
    use_backend be_myself if is_func_figlet has_nodeid_hdr
    use_backend be_figlet if is_func_figlet !has_nodeid_hdr
    use_backend be_myself if is_func_ocr has_nodeid_hdr
    use_backend be_ocr if is_func_ocr !has_nodeid_hdr
    use_backend be_myself if is_func_shasum has_nodeid_hdr
    use_backend be_shasum if is_func_shasum !has_nodeid_hdr
    

    http-request track-sc1 dst_port table st_users_func_figlet if is_func_figlet !has_nodeid_hdr
    http-request track-sc1 dst_port table st_users_func_ocr if is_func_ocr !has_nodeid_hdr
    http-request track-sc1 dst_port table st_users_func_shasum if is_func_shasum !has_nodeid_hdr
    

backend be_ok
    http-request return status 200 content-type "text/plain" string "This is a DFaaS node. Call a function with /function/<funcname>\n"

backend be_healthz
    option httpchk GET /healthz
    option http-server-close
    server healthz 127.0.0.1:8008 check

backend be_system_funcs
    option httpchk GET /
    option http-server-close
    server system_funcs 127.0.0.1:8080 check

backend be_myself
    option httpchk GET /healthz
    option forwardfor
    option http-server-close

    http-request add-header DFaaS-Node-ID QmdGb15XywKtG6BdjA3etoUYcfNh5U49bTbtSFnBpswhUn

    http-response set-header X-Server %s

    server 127.0.0.1 127.0.0.1:8080 check

backend be_figlet
    balance roundrobin

    option httpchk GET /healthz
    option forwardfor
    option http-server-close

    http-request add-header DFaaS-Node-ID QmdGb15XywKtG6BdjA3etoUYcfNh5U49bTbtSFnBpswhUn

    http-response set-header X-Server %s

    server 127.0.0.1 127.0.0.1:8080 weight 100 check
    
backend be_ocr
    balance roundrobin

    option httpchk GET /healthz
    option forwardfor
    option http-server-close

    http-request add-header DFaaS-Node-ID QmdGb15XywKtG6BdjA3etoUYcfNh5U49bTbtSFnBpswhUn

    http-response set-header X-Server %s

    server 127.0.0.1 127.0.0.1:8080 weight 100 check
    
backend be_shasum
    balance roundrobin

    option httpchk GET /healthz
    option forwardfor
    option http-server-close

    http-request add-header DFaaS-Node-ID QmdGb15XywKtG6BdjA3etoUYcfNh5U49bTbtSFnBpswhUn

    http-response set-header X-Server %s

    server 127.0.0.1 127.0.0.1:8080 weight 100 check

Reported warnings:

$ haproxy -Ws -f /etc/haproxy/haproxy.cfg -c
[NOTICE]   (66819) : haproxy version is 2.8.5-1ubuntu3.1
[NOTICE]   (66819) : path to executable is /usr/sbin/haproxy
[WARNING]  (66819) : config : unexpected character '0' after the timer value '1m0s', only (us=microseconds,ms=milliseconds,s=seconds,m=minutes,h=hours,d=days) are supported. This will be reported as an error in next versions.
[WARNING]  (66819) : config : unexpected character '0' after the timer value '1m0s', only (us=microseconds,ms=milliseconds,s=seconds,m=minutes,h=hours,d=days) are supported. This will be reported as an error in next versions.
[WARNING]  (66819) : config : unexpected character '0' after the timer value '1m0s', only (us=microseconds,ms=milliseconds,s=seconds,m=minutes,h=hours,d=days) are supported. This will be reported as an error in next versions.
[WARNING]  (66819) : config : parsing [/etc/haproxy/haproxy.cfg:70] : a 'http-request' rule placed after a 'use_backend' rule will still be processed before.
[WARNING]  (66819) : config : parsing [/etc/haproxy/haproxy.cfg:71] : a 'http-request' rule placed after a 'use_backend' rule will still be processed before.
[WARNING]  (66819) : config : parsing [/etc/haproxy/haproxy.cfg:72] : a 'http-request' rule placed after a 'use_backend' rule will still be processed before.
Warnings were found.
Configuration file is valid
@ema-pe ema-pe added dfaas-agent Related to the agent component dfaas-node Related to the agent node labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dfaas-agent Related to the agent component dfaas-node Related to the agent node
Projects
None yet
Development

No branches or pull requests

1 participant