-
Patch request
-
Resolution: Fixed
-
Major
-
6.4.18rc1, 7.0.0, 7.2.0alpha1
-
None
-
All
-
0.5
Steps to reproduce:
Add and configure new AWS Discovery Host for AWS Account without a bucketLink AWS by HTTP Template
- Configure Macros to connect to account
- Manually run the Discovery and see the failure
Result:
See screenshot ![]()
See log file...
zabbix_js -s aws.s3.discovery.js -i test/params.json -l 4
zabbix_js [763240]: DEBUG: In execute_script()
zabbix_js [763240]: DEBUG: In zbx_es_init_env()
zabbix_js [763240]: DEBUG: End of zbx_es_init_env():SUCCEED
zabbix_js [763240]: DEBUG: In zbx_es_compile()
zabbix_js [763240]: DEBUG: End of zbx_es_compile():SUCCEED
zabbix_js [763240]: DEBUG: In zbx_es_execute() param:{
"auth_type": "access_key",
"AccessKeyId": "ACCESSKEY",
"SecretAccessKey": "SECRETKEY",
"region_match": "CHANGE_IF_NEEDED",
"region_not_match": "CHANGE_IF_NEEDED",
"account": "Test",
}
zabbix_js [763240]: DEBUG: [ AWS S3 ] Sending request: https://s3.us-east-1.amazonaws.com/?Action=ListBuckets&Version=2006-03-01
zabbix_js [763240]: DEBUG: content_type 'application/xml'
zabbix_js [763240]: DEBUG: [ AWS S3 ] Received response with status code 200: <?xml version="1.0" encoding="UTF-8"?>
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>ID</ID><DisplayName>NAME</DisplayName></Owner><Buckets/></ListAllMyBucketsResult>
zabbix_js [763240]: Warning: [ AWS S3 ] ERROR: TypeError: cannot read property 'Bucket' of null.
zabbix_js [763240]: DEBUG: zbx_es_execute() output:'\{"error":"TypeError: cannot read property 'Bucket' of null."}'
zabbix_js [763240]: DEBUG: End of zbx_es_execute():SUCCEED allocated memory: 114878 max allocated or requested memory: 152039 max allowed memory: 536870912
zabbix_js [763240]: DEBUG: In zbx_es_destroy_env()
zabbix_js [763240]: DEBUG: End of zbx_es_destroy_env():SUCCEED
zabbix_js [763240]: DEBUG: End of execute_script():SUCCEED
{"error":"TypeError: cannot read property 'Bucket' of null."}
Expected:
See logfile
zabbix_js -s aws.s3.discovery.js -i test/params.json -l 4
zabbix_js [763551]: DEBUG: In execute_script()
zabbix_js [763551]: DEBUG: In zbx_es_init_env()
zabbix_js [763551]: DEBUG: End of zbx_es_init_env():SUCCEED
zabbix_js [763551]: DEBUG: In zbx_es_compile()
zabbix_js [763551]: DEBUG: End of zbx_es_compile():SUCCEED
zabbix_js [763551]: DEBUG: In zbx_es_execute() param:{
"auth_type": "access_key",
"AccessKeyId": "ACCESSKEY",
"SecretAccessKey": "SECRETKEY",
"region_match": "CHANGE_IF_NEEDED",
"region_not_match": "CHANGE_IF_NEEDED",
"account": "Test",
}
zabbix_js [763551]: DEBUG: [ AWS S3 ] Sending request: https://s3.us-east-1.amazonaws.com/?Action=ListBuckets&Version=2006-03-01
zabbix_js [763551]: DEBUG: content_type 'application/xml'
zabbix_js [763551]: DEBUG: [ AWS S3 ] Received response with status code 200: <?xml version="1.0" encoding="UTF-8"?>
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>ID</ID><DisplayName>NAME</DisplayName></Owner><Buckets/></ListAllMyBucketsResult>
zabbix_js [763551]: DEBUG: zbx_es_execute() output:'[]'
zabbix_js [763551]: DEBUG: End of zbx_es_execute():SUCCEED allocated memory: 114910 max allocated or requested memory: 153678 max allowed memory: 536870912
zabbix_js [763551]: DEBUG: In zbx_es_destroy_env()
zabbix_js [763551]: DEBUG: End of zbx_es_destroy_env():SUCCEED
zabbix_js [763551]: DEBUG: End of execute_script():SUCCEED
[]
See pull Request [PlaceHolder]