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

panic: runtime error: invalid memory address or nil pointer dereference #411

Open
xiaohaozifeifeifei opened this issue Feb 6, 2024 · 10 comments

Comments

@xiaohaozifeifeifei
Copy link

After running for a period of time, the following error always occurs, causing the program to exit abnormally.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x9a825c]

goroutine 46190 [running]:
github.com/iamseth/oracledb_exporter/collector.(*Exporter).scrape.func2()
/home/runner/work/oracledb_exporter/oracledb_exporter/collector/collector.go:315 +0xffc
created by github.com/iamseth/oracledb_exporter/collector.(*Exporter).scrape
/home/runner/work/oracledb_exporter/oracledb_exporter/collector/collector.go:321 +0x94e

@DanielGUO123
Copy link

I had the same problem using Oracle exporter 0.5.1 or 0.5.2 with OS version centos7.9

@biernatt
Copy link

Same here:

Oracle exporter 0.6.0
OS: "Red Hat Enterprise Linux 9.3 (Plow)"
Platform: OCP

53panic: runtime error: invalid memory address or nil pointer dereference 54[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x9faf69] 55 56goroutine 4544 [running]: 57github.com/iamseth/oracledb_exporter/collector.(*Exporter).scrape.func2() 58/home/runner/work/oracledb_exporter/oracledb_exporter/collector/collector.go:316 +0x13e9 59created by github.com/iamseth/oracledb_exporter/collector.(*Exporter).scrape in goroutine 36 60/home/runner/work/oracledb_exporter/oracledb_exporter/collector/collector.go:322 +0x776

@kellanfan
Copy link

I have the same problem, too.
docker: Oracle exporter 0.6.0
OS: CentOS Linux release 7.8.2003

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x9fb0e9]

goroutine 43866 [running]:
github.com/iamseth/oracledb_exporter/collector.(*Exporter).scrape.func2()
        /go/src/oracledb_exporter/collector/collector.go:316 +0x13e9
created by github.com/iamseth/oracledb_exporter/collector.(*Exporter).scrape in goroutine 43855
        /go/src/oracledb_exporter/collector/collector.go:322 +0x776

@HansK-p
Copy link
Contributor

HansK-p commented Jul 14, 2024

Seems this one might be solved by #460

@duj4
Copy link

duj4 commented Nov 8, 2024

@HansK-p The latest one is still 0.6.0 on Apr 6th, this commit was merged (Jul 29th) but not released, any update further?

@HansK-p
Copy link
Contributor

HansK-p commented Nov 8, 2024

We have had no issues after we took the patched version into use some months ago.

@duj4
Copy link

duj4 commented Nov 10, 2024

We have had no issues after we took the patched version into use some months ago.

Thanks @HansK-p , may I know where/how I could get the patched version?

@HansK-p
Copy link
Contributor

HansK-p commented Nov 10, 2024

I'm not very good with this, so my approach is probably not ideal. I cloned the repo, checked out v0.6.0, probably applied the small change manually based on #460, created the docker image and pushed it to our own container registry.

This might work:

git clone https://github.com/iamseth/oracledb_exporter.git
cd oracledb_exporter/
git checkout 0.6.0
vi collector/collector.go # apply PR changes manually
docker build --build-arg BASE_IMAGE=scratch --build-arg VERSION=0.6.0 --build-arg ORACLE_VERSION=19.14 -t oracledb_exporter:0.6.0-patched

Be aware that I haven't double check if the information above is correct, but at least I tried a docker build and it didn't fail. I have not tried to create oracledb_exporter binaries, only containers.

@duj4
Copy link

duj4 commented Nov 12, 2024

I'm not very good with this, so my approach is probably not ideal. I cloned the repo, checked out v0.6.0, probably applied the small change manually based on #460, created the docker image and pushed it to our own container registry.

This might work:

git clone https://github.com/iamseth/oracledb_exporter.git
cd oracledb_exporter/
git checkout 0.6.0
vi collector/collector.go # apply PR changes manually
docker build --build-arg BASE_IMAGE=scratch --build-arg VERSION=0.6.0 --build-arg ORACLE_VERSION=19.14 -t oracledb_exporter:0.6.0-patched
Be aware that I haven't double check if the information above is correct, but at least I tried a docker build and it didn't fail. I have not tried to create oracledb_exporter binaries, only containers.

We are running the exporter in VM, the docker version may not help, but thanks a lot for the details, I will open an issue for this.

@Fanduzi
Copy link

Fanduzi commented Dec 12, 2024

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x9c8949]
goroutine 247036 [running]:
github.com/iamseth/oracledb_exporter/collector.(*Exporter).scrape.func2()
/Users/TiM/Downloads/GolandProjects/oracledb_exporter/collector/collector.go:317 +0x1429

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants