Skip to content

Invalid memory address / bad endpoint '' ? #9

@na6vj

Description

@na6vj

Ran into invalid memory address or nil pointer dereference on version 0.62 :

yugabyte@cud1c-003828:(/home/yugabyte/scripts/promdump)# ./promdump --universe_name=CAS-UAT-PVS_Primary --start_time $PROMDUMP_STARTTIME --end_time $PROMDUMP_ENDTIME --yba_api_token=$API_TOKEN --yba_api_hostname=cud1c-003828.csdev.corp
2024/10/08 12:43:04 promdump version v0.6.2 from commit c9bb2d10a5cbced2387bf236f10870b9dfb8f559 built 2024-10-03T20:57:05+00:00
2024/10/08 12:43:04 main: using the following flags: --end_time=2024-10-07T23:20:00Z --start_time=2024-10-07T23:00:00Z --universe_name=CAS-UAT-PVS_Primary --yba_api_hostname=cud1c-003828.csdev.corp --yba_api_token=****
2024/10/08 12:43:04 main: logging to file 'promdump.log'
2024/10/08 12:43:04 The --yba_api_token flag is required when using the YBA API. See the YBA API documentation at: https://api-docs.yugabyte.com/
yugabyte@cud1c-003828:(/home/yugabyte/scripts/promdump)# ./promdump --universe_name=CAS-UAT-PVS-Primary --start_time $PROMDUMP_STARTTIME --end_time $PROMDUMP_ENDTIME --yba_api_token=$API_TOKEN --yba_api_hostname=cud1c-003828.csdev.corp
2024/10/08 12:43:27 promdump version v0.6.2 from commit c9bb2d10a5cbced2387bf236f10870b9dfb8f559 built 2024-10-03T20:57:05+00:00
2024/10/08 12:43:27 main: using the following flags: --end_time=2024-10-07T23:20:00Z --start_time=2024-10-07T23:00:00Z --universe_name=CAS-UAT-PVS-Primary --yba_api_hostname=cud1c-003828.csdev.corp --yba_api_token=****
2024/10/08 12:43:27 main: logging to file 'promdump.log'
2024/10/08 12:43:27 The --yba_api_token flag is required when using the YBA API. See the YBA API documentation at: https://api-docs.yugabyte.com/
yugabyte@cud1c-003828:(/home/yugabyte/scripts/promdump)# source /home/yugabyte/.yba_dev.tc
-bash: /home/yugabyte/.yba_dev.tc: No such file or directory
yugabyte@cud1c-003828:(/home/yugabyte/scripts/promdump)# source /home/yugabyte/.yba_dev.rc
yugabyte@cud1c-003828:(/home/yugabyte/scripts/promdump)# ./promdump --universe_name=CAS-UAT-PVS-Primary --start_time $PROMDUMP_STARTTIME --end_time $PROMDUMP_ENDTIME --yba_api_token=$API_TOKEN --yba_api_hostname=cud1c-003828.csdev.corp
2024/10/08 12:43:48 promdump version v0.6.2 from commit c9bb2d10a5cbced2387bf236f10870b9dfb8f559 built 2024-10-03T20:57:05+00:00
2024/10/08 12:43:48 main: using the following flags: --end_time=2024-10-07T23:20:00Z --start_time=2024-10-07T23:00:00Z --universe_name=CAS-UAT-PVS-Primary --yba_api_hostname=cud1c-003828.csdev.corp --yba_api_token=****
2024/10/08 12:43:48 main: logging to file 'promdump.log'
2024/10/08 12:43:48 main: Connecting to YBA API
2024/10/08 12:43:48 Using hostname 'cud1c-003828.csdev.corp' to connect to the YBA API
2024/10/08 12:43:48 Found customer UUID '311bddaf-f9c5-4c9a-a510-36562a800c07'
2024/10/08 12:43:48 Looking up Universe with name 'CAS-UAT-PVS-Primary' using the YBA API
2024/10/08 12:43:48 Found Universe 'CAS-UAT-PVS-Primary'
2024/10/08 12:43:48 Found node prefix 'yb-dev-CAS-UAT-PVS-Primary' for Universe 'CAS-UAT-PVS-Primary'
2024/10/08 12:43:48 main: Finished with YBA API
2024/10/08 12:43:48 main: not filtering by exported_instance
2024/10/08 12:43:48 main: collecting the following Yugabyte metrics: cql_export, master_export, node_export, platform, tserver_export, ysql_export
2024/10/08 12:43:48 main: skipping the following Yugabyte metrics: prometheus
2024/10/08 12:43:48 main: tar bundling enabled
2024/10/08 12:43:48 main: no --tar_filename specified; using filename 'promdump-yb-dev-CAS-UAT-PVS-Primary-20241008-124348.tar.gz'
2024/10/08 12:43:48 main: Beginning metric collection against Prometheus endpoint ''
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6ebb8c]
 
goroutine 1 [running]:
main.main()
        /home/runner/work/prometheus-remote-backfill/prometheus-remote-backfill/promdump/promdump.go:1256 +0x1b4c

I noticed this may be due to a bad endpoint:
Beginning metric collection against Prometheus endpoint ''

We got a successful promdump after adding --url https:/...:9090

This ticket requests a better error message when the URL is missing.
Also, it seems redundant to specify --yba_api_hostname and --url .. you should be able to derive one from the other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions