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

Log goes too big #52

Open
hipik634 opened this issue Jul 27, 2023 · 21 comments
Open

Log goes too big #52

hipik634 opened this issue Jul 27, 2023 · 21 comments

Comments

@hipik634
Copy link

Hi, the current.log tends to gain all the free space on partition. Deleting from time to time solves that, but if you would clear it on boot, it will be better for all others. I can do it by cron, of course.

@mawi42
Copy link

mawi42 commented Dec 27, 2023

Config can also be used, setting e.g. LogLevel = ERROR and/or SignOfLifeLog to a high value

@johnyhravy
Copy link

Hello.
I have the same memory filling problem.

This is what my config looks like. ini:

[DEFAULT]
AccessType = OnPremise
SignOfLifeLog = 5
GridMeterBalancing = 1
LogLevel=INFO

[ONPREMISE]
Host=192.168.0.199
Username=
Password=

Should I still edit it? And please advise how.

Here's an extract from Shelly's directory:

root@raspberrypi4:/data/dbus-shelly-3em-smartmeter# du
du: ./current.log: Value too large for defined data type
220 ./img
84 ./docs
8 ./service/supervise
16 ./service
364 .

Can I request an order to erase the logs?
Thank you very much.

@mawi42
Copy link

mawi42 commented May 15, 2024

Hi,
yes, I would edit the file and as I wrote set e.g. LogLevel=ERROR
I used simple the vi editor to edit the file which is available on the device.
And I also just removed the log file.

Hope this helps

@johnyhravy
Copy link

Thank you for the quick reply.
Can I ask for the exact specification of that command to delete the file?
I'm not a complete expert.
Thank you.

@hipik634
Copy link
Author

i used crontab as follows before that 0 0 * * 0 rm /data/dbus-shelly-3em-smartmeter/current.log && /bin/bash /data/dbus-shelly-3em-smartmeter/restart.sh but each update removed it. You can use it to manually delete the log (it cannot be done while running)
So just run this and you should be fine "rm /data/dbus-shelly-3em-smartmeter/current.log && /bin/bash /data/dbus-shelly-3em-smartmeter/restart.sh"

@johnyhravy
Copy link

Thank you for answer.
Unfortunately it doesn't help me.
The answer in Putty is:

root@raspberrypi4:~# rm /data/dbus-shelly-3em-smartmeter/current.log && /bin/bash /data/dbus-shelly-3em-smartmeter/restart.sh
rm: can't stat '/data/dbus-shelly-3em-smartmeter/current.log': Value too large for defined data type

Please clarify what I am doing wrong.
Thank you.

@hipik634
Copy link
Author

hipik634 commented May 16, 2024 via email

@johnyhravy
Copy link

The command "du / - h" was very long and at the end this.
du: -: No such file or directory
du: h: No such file or directory

Then I used "du -d 3 /data | sort -nr"
root@raspberrypi4:~# du -d 3 /data | sort -nr
du: /data/dbus-shelly-3em-smartmeter/current.log: Value too large for defined data type

Thank you very much for your kind help.
Can you think of anything else?

@hipik634
Copy link
Author

hipik634 commented May 16, 2024 via email

@johnyhravy
Copy link

root@raspberrypi4:# cd /data/dbus-shelly-3em-smartmeter/current.log
-sh: cd: /data/dbus-shelly-3em-smartmeter/current.log: Not a directory
root@raspberrypi4:
# ls -l
-rw-r--r-- 1 root root 277 Sep 29 2022 installrelease.sh
-rw-r--r-- 1 root root 277 Oct 14 2022 installrelease.sh.1
-rw-r--r-- 1 root root 277 Nov 19 2022 installrelease.sh.2
-rw-r--r-- 1 root root 0 Mar 29 14:29 main.zip
-rw------- 1 root root 0 Feb 15 15:28 nano.save
-rw------- 1 root root 0 Feb 15 15:28 nano.save.1
-rw-r--r-- 1 root root 74135 Nov 27 2022 venus-data.tar.gz

@hipik634
Copy link
Author

hipik634 commented May 16, 2024 via email

@johnyhravy
Copy link

root@raspberrypi4:~# cd /data/dbus-shelly-3em-smartmeter/
root@raspberrypi4:/data/dbus-shelly-3em-smartmeter# ls -l
ls: ./current.log: Value too large for defined data type
-rw-r--r-- 1 root root 4284 Jan 7 2023 README.md
-rw-r--r-- 1 root root 142 May 16 05:00 config.ini
-rw-r--r-- 1 root root 12077 Jan 7 2023 dbus-shelly-3em-smartmeter.py
drwxrwxrwx 2 root root 4096 Jan 7 2023 docs
drwxrwxrwx 2 root root 4096 Jan 7 2023 img
-rwxr-xr-x 1 root root 866 Jan 7 2023 install.sh
-rwxr--r-- 1 root root 160 Jan 7 2023 restart.sh
drwxrwxrwx 3 root root 4096 Mar 5 19:07 service
-rwxr--r-- 1 root root 176 Jan 7 2023 uninstall.sh

@hipik634
Copy link
Author

hipik634 commented May 16, 2024 via email

@johnyhravy
Copy link

root@raspberrypi4:/data/dbus-shelly-3em-smartmeter# rm -rf current.log
rm: can't stat 'current.log': Value too large for defined data type
root@raspberrypi4:/data/dbus-shelly-3em-smartmeter# ./restart.sh

@hipik634
Copy link
Author

hipik634 commented May 16, 2024 via email

@johnyhravy
Copy link

But the current.log file doesn't have that code, so I can't use it...

root@raspberrypi4:/data/dbus-shelly-3em-smartmeter# ls -i
ls: ./current.log: Value too large for defined data type
391692 README.md 391703 install.sh
391693 config.ini 391704 restart.sh
391694 dbus-shelly-3em-smartmeter.py 391705 service
391695 docs 391707 uninstall.sh
391698 img

@hipik634
Copy link
Author

hipik634 commented May 16, 2024 via email

@johnyhravy
Copy link

root@raspberrypi4:/data/dbus-shelly-3em-smartmeter# fsck
fsck from util-linux 2.35.1
e2fsck 1.45.7 (28-Jan-2021)
/dev/mmcblk0p4 is mounted.
e2fsck: Cannot continue, aborting.

Thank you very much for your patience and detailed instructions. I'll try to get some help on how to clear the log so I don't have to uninstall Shelly. After these attempts, it seems that even the uninstall would fail due to the inaccessibility of the log.
In addition, I also use HomeAssistant and I really don't want to redo anything with my knowledge :)

@hipik634
Copy link
Author

hipik634 commented May 16, 2024 via email

@Kotty666
Copy link
Contributor

Kotty666 commented Jun 1, 2024

@johnyhravy try

# echo > /data/dbus-shelly-3em-smartmeter/current.log
# /bin/bash /data/dbus-shelly-3em-smartmeter/restart.sh

this should work. I've also fixed the problem with growing log files and waiting that the code will be merged ( PR #71 )

@johnyhravy
Copy link

Thank you very much for your answer.
About 2 weeks ago, with the help of experienced advisors, I managed to clear the entire memory. I don't even know how it happened, but 2 days after entering various commands, the memory was OK.
Thanks everyone for the advice.

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

4 participants