Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-24859

Fixed Empty S3 Bucket - TypeError: cannot read property 'Bucket' of null

XMLWordPrintable

    • Icon: Patch request Patch request
    • Resolution: Fixed
    • Icon: Major Major
    • 6.0.33rc1, 7.0.3rc1, 7.2.0alpha1
    • 6.4.18rc1, 7.0.0, 7.2.0alpha1
    • Templates (T)
    • None
    • All
    • 0.5

      Steps to reproduce:

      1. Add and configure new AWS Discovery Host for AWS Account without a bucket
      2. Link AWS by HTTP Template

      3. Configure Macros to connect to account
      4. 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]

            egordymov Evgenii Gordymov
            bossiesa Riaan Olivier
            Team INT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: