Skip to content

[BUG] Running job from cron deletes all items from caldav #140

@tjex

Description

@tjex

Describe the bug

I have the simplest syncall command, that I run to just sync one project:

${XDG_DATA_HOME}/miniconda3/bin/tw_caldav_sync \
    --caldav-calendar inbox \
    --caldav-url https://dav.mailbox.org/caldav \
    --caldav-user <email> \
    --caldav-passwd-cmd "gopass show -o email/<email>" \
    -p inbox \
    -s mobile

Running this from the terminal works fine.
Running from a cron job deletes the tasks on the server side.

I've tested that cron is executing gopass and is finding environment variables correctly.
syncall is successfully pushing to the server in any case.

The problem is that tasks are being deleted.

Additionally, running from cron creates a completed.data and pending.data directory in my taskwarrior data dir.

To Reproduce

Steps to reproduce the behavior:

Create script as per the below example:

#!/usr/bin/env bash

${XDG_DATA_HOME}/miniconda3/bin/tw_caldav_sync \
    --caldav-calendar inbox \
    --caldav-url https://dav.mailbox.org/caldav \
    --caldav-user <email> \
    --caldav-passwd-cmd "gopass show -o email/<email>" \
    -p inbox \
    -s mobile

crontab -e:

* * * * * . ~/.zprofile; . ~/.config/shell/paths; ~/scripts/progs/tw-sync-tasks.sh > ~/cronout

Expected Behavior

The tasks get synced in their current state (completed, pending, deleted), instead of all being deleted on the server side.

Versions

OS Version (cat /etc/*-release; uname -a)

Fedora Asahi Remix release 40 (Forty)
NAME="Fedora Linux Asahi Remix"
VERSION="40 (Forty)"
ID=fedora-asahi-remix
ID_LIKE=fedora
VERSION_ID=40
VERSION_CODENAME=""
PLATFORM_ID="platform:f40"
PRETTY_NAME="Fedora Linux Asahi Remix 40 (Forty)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora-asahi-remix:40"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedora-asahi-remix.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f40/system-administrators-guide/"
SUPPORT_URL="https://discussion.fedoraproject.org/c/neighbors/asahi/asahi-help/94"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=40
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=40
Fedora Asahi Remix release 40 (Forty)
Fedora Asahi Remix release 40 (Forty)
Linux lappy 6.11.8-400.asahi.fc40.aarch64+16k #1 SMP PREEMPT_DYNAMIC Sat Nov 16 21:59:53 UTC 2024 aarch64 GNU/Linux

Python version (python --version; python3 --version)

Python 3.12.7
Python 3.12.7

--version of your executable

tw_caldav_sync, version <module 'syncall.__version__' from '/home/tjex/.local/share/venv/0/lib64/python3.12/site-packages/syncall/__version__.py'>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions