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

Statistics are reset after each reboot #2661

Closed
3 tasks done
ammnt opened this issue Feb 10, 2021 · 13 comments
Closed
3 tasks done

Statistics are reset after each reboot #2661

ammnt opened this issue Feb 10, 2021 · 13 comments

Comments

@ammnt
Copy link

ammnt commented Feb 10, 2021

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • 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

  • Version of AdGuard Home server:
    • 0.105.0
  • How did you install AdGuard Home:
    • Github releases
  • If it's a router or IoT, please write device model:
    • VPS
  • Operating system and version:
    • Debian 10

Expected Behavior

Statistics are saved after reboot.

Actual Behavior

Statistics are reset after each reboot actually.

Additional Information

The logs is attached.

@ameshkov ameshkov added this to the v0.105.1 milestone Feb 11, 2021
@ameshkov ameshkov added the waiting for data Waiting for users to provide more data. label Feb 11, 2021
@ainar-g
Copy link
Contributor

ainar-g commented Feb 11, 2021

Hi, can you please show, what your statistics interval is set to? It's the statistics_interval setting in the configuration file.

@ammnt
Copy link
Author

ammnt commented Feb 11, 2021

@ainar-g, statistics_interval: 30. The difference in this installation was that I install the server under an unprivileged user via sudo. Possible need to check the installation script... It seemed to me that I had already created such a problem before, but I can not find it now in repo😪

adguard pushed a commit that referenced this issue Feb 11, 2021
Merge in DNS/adguard-home from 2661-imp-stats-logging to master

Updates #2661.

Squashed commit of the following:

commit 474735a
Author: Ainar Garipov <[email protected]>
Date:   Thu Feb 11 17:44:34 2021 +0300

    stats: imp err handling, logs
@ainar-g
Copy link
Contributor

ainar-g commented Feb 11, 2021

The current stats code seems to hide a lot of useful information, unfortunately. I've just pushed a623ac6, where I added more verbose logging to the code. Could you please update and collect the new logs? Thanks!

@ammnt
Copy link
Author

ammnt commented Feb 11, 2021

@ainar-g, unfortunately, that server is gone, but i tried to reproduce it on my VM and it looks fine now🤷🏻‍♂️ IDK how to help here🙄

@ammnt
Copy link
Author

ammnt commented Feb 13, 2021

@ainar-g, i found it:
#1785
May be useful😒

@ameshkov ameshkov removed this from the v0.105.1 milestone Feb 15, 2021
@ainar-g ainar-g closed this as completed Feb 15, 2021
@ammnt
Copy link
Author

ammnt commented Feb 16, 2021

@ainar-g, I have successfully reproduced the issue again on the latest edge version. The log attached - please, take a look. The also screenshots is as confirmation is attached:
2021-02-16_19-40-44
2021-02-16_19-42-58
The second screenshot - its after reboot. Thank you.

@ainar-g
Copy link
Contributor

ainar-g commented Feb 16, 2021

That's not statistics though, that's query log.

How exactly do you reboot the machine? AdGuard Home keeps a buffer of recent queries in the RAM, so if it is not shut down properly, that buffer could remain unflushed to the filesystem.

@ammnt
Copy link
Author

ammnt commented Feb 16, 2021

@ainar-g, via my hosting provider panel and this was not before on 0.102.0, 0.103.0 etc. version🤨

@ainar-g
Copy link
Contributor

ainar-g commented Feb 16, 2021

I don't think that that particular mechanism has changed much in the recent releases. At least I don't remember that. If you can, you should set up your machine to kill the AGH process with SIGINT, which should force flushing, and wait until it goes down. Alternatively, you could also set dns.querylog_size_memory to a lower value, so that the flushing happens more often.

@ammnt
Copy link
Author

ammnt commented Feb 16, 2021

@ainar-g, i set querylog_size_memory 10 instead 1000 and restart the server. All query logs and statistics are gone after that😂

@ainar-g
Copy link
Contributor

ainar-g commented Feb 16, 2021

Are you sure that your data/querylog.json is not deleted by some other entity? That's the file where the logs are kept. And the statistics data is also in the data/ directory.

@ammnt
Copy link
Author

ammnt commented Feb 16, 2021

@ainar-g, yes, i'm sure. Moreover, part of the statistics disappears, and not all.

@ainar-g
Copy link
Contributor

ainar-g commented Feb 16, 2021

I have no ideas besides the VPS's filesystem shenanigans. We've never seen anything similar. If you have a stable reproduction on a machine that is not on the same VPS, please let us know.

@ainar-g ainar-g added cannot reproduce and removed waiting for data Waiting for users to provide more data. labels Jul 29, 2021
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Merge in DNS/adguard-home from 2661-imp-stats-logging to master

Updates AdguardTeam#2661.

Squashed commit of the following:

commit 474735a
Author: Ainar Garipov <[email protected]>
Date:   Thu Feb 11 17:44:34 2021 +0300

    stats: imp err handling, logs
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

3 participants