Bleala / Vdirsyncer-DOCKERIZED

Vdirsyncer - sync calendars and addressbooks between servers and the local filesystem. DOCKERIZED!
25 stars 5 forks source link

Multiple instances run at same time #15

Open kapitan-iglu opened 4 months ago

kapitan-iglu commented 4 months ago

Hi, recently I discovered weird behavior if sync job is constantly failing for long time. I'm using one way syncing of calendar events from one provider to another each 15 minutes. I've changed my password on source calendar provider and forgot to update also vdirsyncer config, so the jobs started to fail with error: Unknown error occurred for iw2nc/workcal: 401, message='Unauthorized (as expected). In meantime I restarted docker, so the container was fresh started and runs for 3 days with constantly failing job. After I missed some events in destination calendar I looked into vdirsyncer logs and there was 8 same jobs running each 15 minutes in parallel.

[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg=starting iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=5 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg=starting iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=4 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg=starting iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=6 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg=starting iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=1 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg=starting iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=7 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg=starting iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=0 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg=starting iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=2 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg=starting iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=3 job.schedule="*/15 * * * *"

[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg="Metasyncing iw2nc/workcal" channel=stderr iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=0 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg="Metasyncing iw2nc/workcal" channel=stderr iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=2 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg="Metasyncing iw2nc/workcal" channel=stderr iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=4 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg="Metasyncing iw2nc/workcal" channel=stderr iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=1 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg="Metasyncing iw2nc/workcal" channel=stderr iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=3 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg="Metasyncing iw2nc/workcal" channel=stderr iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=5 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg="Metasyncing iw2nc/workcal" channel=stderr iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=7 job.schedule="*/15 * * * *"
[2024-02-12 05:15:00] time="2024-02-12T05:15:00+01:00" level=info msg="Metasyncing iw2nc/workcal" channel=stderr iteration=241 job.command="/usr/local/bin/vdirsyncer -c /vdirsyncer/config metasync     && /usr/local/bin/vdirsyncer -c /vdirsyncer/config sync" job.position=6 job.schedule="*/15 * * * *"

So I updated password, then vdirsyncer discover iw2nc and watched logs. There was still 8 jobs trying to sync the same account, one started to succeed but rest 7 jobs was failing with errors like:

So I restarted container but same 8 jobs appeared again. I suppose that only one instance of vdirsyncer should be running each time.

Is that some feature of supercronic that failed jobs will run again on next period? How can I prevent to run multiple instances of vdirsyncer on same time?

kapitan-iglu commented 4 months ago

As there was no answer till now I have deleted the container and recreated it. Now there is only one job running at specified intervals so it behaves as expected.

I'm still curious what caused multiplying jobs. If same situation appears again, I will report.