Closed JM-Lemmi closed 2 months ago
grep -rn /etc/ical-relay/calstore -e '^ID:'
findet den fehler auch
grep -l -rn /etc/ical-relay/calstore -e '^ID:'
<- all files with the error
sed -i 's/^ID:/UID:/'
<- fix error
grep -l -rn /etc/ical-relay/calstore -e '^ID:' | xargs -I '{}' sed -i 's/^ID:/UID:/' {}
<- all in one line
END:VCALENDAR
tritt am Ende der Timezone auf, mit dem ersten Event
Fehler scheint erstmal nicht wieder aufgetreten zu sein. Möglicherweise ein einmaliger Fehler dank Out Of Memory?
Closing this for now, most likely caused by a bad OOM crash of the server
The issue persists.
It looks to me, like the misplaced END:VCALENDAR
is directly following END:VTIMEZONE
. This element also seems wildly misplaced. Instead of the very beginning its somewhere in the middle.
root@j-bwc-cal:/home/debian# grep -rn /etc/ical-relay/calstore -e '^ID:'
/etc/ical-relay/calstore/TEL23D-past.ics:1451:ID:20231122T100555Z-384609001@group-e.dhbw-mannheim.de
/etc/ical-relay/calstore/TINF21CS1-past.ics:86:ID:20240320T090000Z-386958001@group-e.dhbw-mannheim.de
/etc/ical-relay/calstore/WWI23SCB-past.ics:799:ID:20240129T074346Z-390621001@group-e.dhbw-mannheim.de
grep for all files, where END:VCALENDAR appears twice
for f in *.ics; do echo -n "$f "; cat "$f" | grep "END:VCALENDAR" | wc -l; done | grep " 2"
replacing:
multiline sed or grep or awk is horrible, I couldnt do it. So here ismy other proposed fix:
we have a command that prints all the filenames, and we know that the first VCALENDAR is probably the wrong one, so we just match for that.
❗ this command is dangerous and might corrupt other files!
sed -i -z 's/END:VCALENDAR/BEGIN:VEVENT/' file.ics
<- replace in place the first occurence of END:VCALENDAR mit BEGIN:VEVENT. dass er nur das erste matcht liegt an dem fehlenden G.
Sanity check: sed -z 's/END:VCALENDAR/BEGIN:VEVENT/' TEL23D-past.ics | grep END:VCALENDAR -A5 -B5
ohne -i printet das auf stdout und mit dem grep danach sehen wir, ob es am ende noch steht und sonst nicht mehr auftacuht, genau wie wir es haben wollen.
wir bekommen die Liste mit dateinamen mit dem wc hinten dran zum filtern, der muss also wieder weg: sed 's/..$//'
der command muss im richtigen ordner ausgeführt werden, da er keine absoluten pfade enthält
for f in *.ics; do echo -n "$f "; cat "$f" | grep "END:VCALENDAR" | wc -l; done | grep " 2" | sed 's/..$//' | xargs -I '{}' sed -i -z 's/END:VCALENDAR/BEGIN:VEVENT/' {}
this seems to be an OOM error at some point. Not great, but more ram fixes it, so this will be a not-fix until it becomes relevant again.
history file includes a misplaced
END:VCALENDAR
somewhere in the middle, which leads to a parser error on the next history run.broken files can be found like this:
for f in *.ics; do echo -n "$f "; cat "$f" | grep "END:VCALENDAR" | wc -l; done;
instead of
BEGIN:VEVENT
anEND:VCALENDAR
is placed in the middle somwherefehler scheint am 27.12. zw 5 uhr und 12 uhr aufgetreten zu sein