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: index out of range [7] with length 1 #3506

Closed
3 tasks done
ovizii opened this issue Aug 27, 2021 · 5 comments
Closed
3 tasks done

panic: runtime error: index out of range [7] with length 1 #3506

ovizii opened this issue Aug 27, 2021 · 5 comments
Assignees
Milestone

Comments

@ovizii
Copy link

ovizii commented Aug 27, 2021

This adguard home instance was running just fine for many months. I just recently noticed I did not have it on autostart so it was down for a while.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Issue Details

I noticed my adguard instance wasn't running for a while so I manually did a docker-compose up -d and got this error:

docker-compose up -d Creating adguardhome ... done docker-compose logs -f Attaching to adguardhome adguardhome | 2021/08/27 08:08:49.224778 [info] AdGuard Home, version v0.106.3 adguardhome | 2021/08/27 08:08:49.251370 [info] Initializing auth module: /opt/adguardhome/work/data/sessions.db adguardhome | 2021/08/27 08:08:49.251991 [info] auth: initialized. users:1 sessions:0 adguardhome | 2021/08/27 08:08:49.252015 [info] Initialize web module adguardhome | panic: runtime error: index out of range [7] with length 1 adguardhome | adguardhome | goroutine 1 [running]: adguardhome | encoding/binary.bigEndian.Uint64(...) adguardhome | encoding/binary/binary.go:125 adguardhome | github.com/AdguardTeam/AdGuardHome/internal/stats.btoi(...) adguardhome | github.com/AdguardTeam/AdGuardHome/internal/stats/unit.go:233 adguardhome | github.com/AdguardTeam/AdGuardHome/internal/stats.createObject.func1(0x7f0060ac4030, 0x1, 0x1, 0x0, 0x0, 0x7f0060a49000) adguardhome | github.com/AdguardTeam/AdGuardHome/internal/stats/unit.go:98 +0x219 adguardhome | go.etcd.io/bbolt.(*Tx).ForEach.func1(0x7f0060ac4030, 0x1, 0x1, 0x7f0060ac4031, 0xd35, 0xd35, 0xd35, 0xa59cbf) adguardhome | go.etcd.io/bbolt@v1.3.5/tx.go:129 +0x8c adguardhome | go.etcd.io/bbolt.(*Bucket).ForEach(0xc000190398, 0xc00050cc78, 0xc00050cc90, 0xc000190380) adguardhome | go.etcd.io/bbolt@v1.3.5/bucket.go:390 +0xfe adguardhome | go.etcd.io/bbolt.(*Tx).ForEach(0xc000190380, 0xc00050cd48, 0x0, 0x0) adguardhome | go.etcd.io/bbolt@v1.3.5/tx.go:128 +0x67 adguardhome | github.com/AdguardTeam/AdGuardHome/internal/stats.createObject(0xc00012c0c0, 0x23, 0x5a, 0x0, 0x0, 0x13ac280, 0x13ac268, 0x0, 0x0, 0x0, ...) adguardhome | github.com/AdguardTeam/AdGuardHome/internal/stats/unit.go:116 +0x3f8 adguardhome | github.com/AdguardTeam/AdGuardHome/internal/stats.New(...) adguardhome | github.com/AdguardTeam/AdGuardHome/internal/stats/stats.go:35 adguardhome | github.com/AdguardTeam/AdGuardHome/internal/home.initDNSServer(0xc0001dec90, 0x0) adguardhome | github.com/AdguardTeam/AdGuardHome/internal/home/dns.go:41 +0x1d3 adguardhome | github.com/AdguardTeam/AdGuardHome/internal/home.run(0x0, 0x7ffccfdf2f2e, 0x26, 0x7ffccfdf2f63, 0x15, 0xc00020a030, 0x10, 0x10, 0x0, 0x0, ...) adguardhome | github.com/AdguardTeam/AdGuardHome/internal/home/home.go:335 +0xd8f adguardhome | github.com/AdguardTeam/AdGuardHome/internal/home.Main() adguardhome | github.com/AdguardTeam/AdGuardHome/internal/home/home.go:125 +0x1f9 adguardhome | main.main() adguardhome | github.com/AdguardTeam/AdGuardHome/main.go:10 +0x25 adguardhome exited with code 2

  • Version of AdGuard Home server:
    • v0.106.3
  • How did you install AdGuard Home:
    • Docker
  • How did you setup DNS configuration:
    • manually entered my adguardhome as DNS server for specific devices at home
  • CPU architecture:
    • AMD64
  • Operating system and version:
    • Debian 10 (latest)

Expected Behavior

docker-compose up -d starts the adguard home container and makes it usable

Actual Behavior

the container stops with the error message above

Additional Information

going as far back as v0.105.2 I get the same error as above until I hit v0.105.2 then the error changes:
2021/08/27 08:05:54 [info] AdGuard Home, version v0.105.2, channel release, arch linux amd64 │ │ 2021/08/27 08:05:54 [info] configuration file contains unknown schema_version, abort │ │ 2021/08/27 08:05:54 [fatal] configuration file contains unknown schema_version, abort

@ainar-g
Copy link
Contributor

ainar-g commented Aug 27, 2021

Hello, and thank you for your report! The unknown schema_version is because there were configuration changes between the releases. I've filed #3507 to document them.

The issue itself might be due to a bad migration as well. Considering that the statistics database doesn't contain any critical data, we probably can simply skip the incorrect records. We'll try to fix it before the release of v0.107.0-b.9.

@ainar-g ainar-g self-assigned this Aug 27, 2021
@ainar-g ainar-g added this to the v0.107.0 milestone Aug 27, 2021
@ovizii
Copy link
Author

ovizii commented Aug 27, 2021

Hello, and thank you for your report! The unknown schema_version is because there were configuration changes between the releases. I've filed #3507 to document them.

I figured that out and stopped trying to get an older version working :-)

The issue itself might be due to a bad migration as well. Considering that the statistics database doesn't contain any critical data, we probably can simply skip the incorrect records. We'll try to fix it before the release of v0.107.0-b.9.

Very likely that might be due to a bad migration, I use the :latest tag and have watchtower auto-upgrade adguardhome (while being aware of the risks of it breaking).

Thanks for taking ownership of this issue!

adguard pushed a commit that referenced this issue Aug 27, 2021
Updates #3506.

Squashed commit of the following:

commit 8e5a243
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Aug 27 14:34:37 2021 +0300

    stats: delete units with bad names
@ainar-g
Copy link
Contributor

ainar-g commented Aug 27, 2021

The latest edge build, v0.107.0-a.144+9f52adf3, should contain a fix. It will also be included into v0.107.0-b.9, which we plan to release early next week. Can you check if our solution works for you either now with the edge tag or later, with a beta one?

@ovizii
Copy link
Author

ovizii commented Aug 27, 2021

works with the edge tag.
Can you please give me some advice on how to proceed and keep using the regular tag i.e. latest? Can I just wait a few weeks then switch back to :latest?

btw. here is the log output with :edge in case its of interest to you. There's one fail and 2 errors in there

 docker-compose  logs -f
Attaching to adguardhome
adguardhome    | 2021/08/27 12:17:11.803630 [info] AdGuard Home, version v0.107.0-a.144+9f52adf3
adguardhome    | 2021/08/27 12:17:11.804304 [info] Upgrade yaml: 10 to 11
adguardhome    | 2021/08/27 12:17:11.804314 [info] Upgrade yaml: 11 to 12
adguardhome    | 2021/08/27 12:17:11.926843 [info] Initializing auth module: /opt/adguardhome/work/data/sessions.db
adguardhome    | 2021/08/27 12:17:11.927030 [info] auth: initialized.  users:1  sessions:0
adguardhome    | 2021/08/27 12:17:11.927058 [info] Initialize web module
adguardhome    | 2021/08/27 12:17:12.443342 [info] AdGuard Home is available at the following addresses:
adguardhome    | 2021/08/27 12:17:12.443463 [info] Go to http://127.0.0.1:80
adguardhome    | 2021/08/27 12:17:12.443467 [info] Go to http://172.17.0.5:80
adguardhome    | 2021/08/27 12:17:12.697981 [info] Starting the DNS proxy server
adguardhome    | 2021/08/27 12:17:12.698003 [info] Ratelimit is enabled and set to 20 rps
adguardhome    | 2021/08/27 12:17:12.698013 [info] The server is configured to refuse ANY requests
adguardhome    | 2021/08/27 12:17:12.698019 [info] DNS cache is enabled
adguardhome    | 2021/08/27 12:17:12.698052 [info] Creating the UDP server socket
adguardhome    | 2021/08/27 12:17:12.698261 [info] Listening to udp://[::]:53
adguardhome    | 2021/08/27 12:17:12.698274 [info] Creating a TCP server socket
adguardhome    | 2021/08/27 12:17:12.698303 [info] Listening to tcp://[::]:53
adguardhome    | 2021/08/27 12:17:12.698486 [info] Entering the UDP listener loop on [::]:53
adguardhome    | 2021/08/27 12:17:12.698542 [info] Entering the tcp listener loop on [::]:53
adguardhome    | 2021/08/27 12:17:12.884245 [info] Filter 1 has been updated: 754167 bytes, 38960 rules
adguardhome    | 2021/08/27 12:17:12.884258 [info] Saving filter 1 contents to: /opt/adguardhome/work/data/filters/1.txt
adguardhome    | 2021/08/27 12:17:12.998466 [info] Filter 2 has been updated: 303577 bytes, 8171 rules
adguardhome    | 2021/08/27 12:17:12.998482 [info] Saving filter 2 contents to: /opt/adguardhome/work/data/filters/2.txt
adguardhome    | 2021/08/27 12:17:13.502097 [info] Got status code 404 from URL https://hosts-file.net/ad_servers.txt, skipping
adguardhome    | 2021/08/27 12:17:13.502438 [info] Failed to update filter https://hosts-file.net/ad_servers.txt: got status code != 200: 404
adguardhome    |
adguardhome    | 2021/08/27 12:17:13.667948 [info] Filter 1582666443 has been updated: 2752215 bytes, 90168 rules
adguardhome    | 2021/08/27 12:17:13.667966 [info] Saving filter 1582666443 contents to: /opt/adguardhome/work/data/filters/1582666443.txt
adguardhome    | 2021/08/27 12:17:15.501024 [error] gob Decode: EOF
adguardhome    | 2021/08/27 12:17:15.599954 [info] Updated filter #1.  Rules: 37701 -> 38960
adguardhome    | 2021/08/27 12:17:15.599975 [info] Updated filter #2.  Rules: 8227 -> 8171
adguardhome    | 2021/08/27 12:17:15.599978 [info] Updated filter #1582666443.  Rules: 83000 -> 90168
adguardhome    | 2021/08/27 12:17:41.120335 [error] gob Decode: EOF

@ainar-g
Copy link
Contributor

ainar-g commented Aug 27, 2021

Can you please give me some advice on how to proceed and keep using the regular tag i.e. latest? Can I just wait a few weeks then switch back to :latest?

In theory, yes, that should be enough. As long as you have your persistent volumes, there shouldn't be any data loss.

adguardhome    | 2021/08/27 12:17:13.502438 [info] Failed to update filter https://hosts-file.net/ad_servers.txt: got status code != 200: 404`

This one just means that the filter list is gone now, which is probably not an AGH error.

adguardhome    | 2021/08/27 12:17:15.501024 [error] gob Decode: EOF
[…]
adguardhome    | 2021/08/27 12:17:41.120335 [error] gob Decode: EOF

These likely come from the same stats issues, and the errors don't look critical to AGH functioning.

Since the original bug is fixed, I'm going to close this issue. Please feel free to report any other bugs!

@ainar-g ainar-g closed this as completed Aug 27, 2021
@ainar-g ainar-g changed the title adguardhome | panic: runtime error: index out of range [7] with length 1 panic: runtime error: index out of range [7] with length 1 Aug 30, 2021
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Updates AdguardTeam#3506.

Squashed commit of the following:

commit 8e5a243
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Aug 27 14:34:37 2021 +0300

    stats: delete units with bad names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants