UnboundLocalError: local variable 'domain_temp_map_file' referenced before assignment
Closed this issue · 0 comments
Dear:
I run the command below, the error occured:
Command:
./marathon_lb.py --marathon http://localhost:8080 --group external --health-check
Error log:
2018-04-27 11:17:26,766 marathon_lb: generating config
2018-04-27 11:17:26,766 marathon_lb: HAProxy dir is /etc/haproxy
2018-04-27 11:17:26,766 marathon_lb: reading running config from /etc/haproxy/haproxy.cfg
2018-04-27 11:17:26,766 marathon_lb: couldn't open config file for reading
2018-04-27 11:17:26,766 marathon_lb: running config is different from generated config - reloading
2018-04-27 11:17:26,767 marathon_lb: writing temp file /tmp/tmpKPtkGc that will replace /etc/haproxy/haproxy.cfg
2018-04-27 11:17:26,767 marathon_lb: checking config with command: ['haproxy', '-f', '/tmp/tmpKPtkGc', '-c']
[ALERT] 116/111726 (30405) : parsing [/tmp/tmpKPtkGc:65] : 'bind *:443' : unable to load SSL certificate file '/etc/ssl/cert.pem' file does not exist.
[ALERT] 116/111726 (30405) : Error(s) found in configuration file : /tmp/tmpKPtkGc
[ALERT] 116/111726 (30405) : Fatal errors found in configuration.
2018-04-27 11:17:26,772 marathon_lb: haproxy returned non-zero when checking config
2018-04-27 11:17:26,772 marathon_lb: Copying temp file /tmp/haproxy_temp_config_fail.2 to /tmp/haproxy_temp_config_fail.3
2018-04-27 11:17:26,772 marathon_lb: Copying temp file /tmp/haproxy_temp_config_fail.1 to /tmp/haproxy_temp_config_fail.2
2018-04-27 11:17:26,773 marathon_lb: Copying temp files /tmp/tmpKPtkGc to /tmp/haproxy_temp_config_fail.1
2018-04-27 11:17:26,773 marathon_lb: moving temp file /tmp/tmpKPtkGc to haproxy_tmp_conf_fail
Traceback (most recent call last):
File "./marathon_lb.py", line 2145, in
args.group_https_by_vhost)
File "./marathon_lb.py", line 1689, in regenerate_config
haproxy_map)
File "./marathon_lb.py", line 1393, in compareWriteAndReloadConfig
app_map_string, app_map_file, haproxy_map):
File "./marathon_lb.py", line 1245, in writeConfigAndValidate
removeTempFileIfExist(domain_temp_map_file)
UnboundLocalError: local variable 'domain_temp_map_file' referenced before assignmen