Help with caldav, email reminders and task attachments

Dear Vikunja team, first of all thank you for your efforts, this seems a great todo app!
I have made to make it work (database, frontend, backend and proxy) using docker. I am running it locally with a static IP and custom port: http://192.168.9.36:8130/login

However, I am experiencing trouble with three features:

caldav
I know it’s experimental, but when I try to access the server using the address http://192.168.9.36:8130/dav/principals/myusername/ in a browser I get the message “internal server error”.

email reminders
I think I must add the configuration somewhere, but I don’t know where! Can it be added to my docker-compose file I used to lauch the Vikunja stack? Using environmental variables? If so, can you point me to what they should look like?

(I have found these but I don’t know if this is it: https://vikunja.io/docs/config-options/)

task attachments
When trying to add an attachment to a task using the frontend, I get on the lower left corner of the screen a red warning: “e is undefined”.

Not a clue on this one!

THANK YOU!

Hi! Thanks for the kind words - really appreciate it.

What version are you running? (frontend and api)

Is there anything in the logs?

To get email reminders, you need to configure the mailer. With env variables, that’d be something like

VIKUNJA_MAILER_ENABLED=true
VIKUNJA_MAILER_HOST=mail.example.com
VIKUNJA_MAILER_USERNAME=...

You can test if the mailer is set up correctly by sending a test email from the cli with vikunja testmail <your-email@example.com>.

If all of that is configured correctly, it could be time zone problem. That’s where it gets tricky. If your server and client are in the same time zone, it should not be a problem. You can check if it is by setting a reminder (after you know sending email is not the problem) to some 12h in the future, wait 24h and see when it arrives and when it was scheduled.
Also check what time zone you are in and what time zone you configured.

That sounds a lot like a bug. There have been bugs like this in the past which should be fixed now. Does it work for you on try? What does the browser console say?

1 Like

I’ve pulled the containers today using vikunja/api and vikunja/frontend images, so I believe they are the latest versions? (where can I find that info?)

Only this I think:
2021-01-15T20:00:18.977494538Z: WEB :arrow_forward: 192.168.144.4 GET 500 /dav/principals/myusername 170.509621ms - Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:84.0) Gecko/20100101 Firefox/84.0

Oh, ok, I will try that!

Yes, on the live demo I can upload a file, no problem. I will try to figure it out.
EDIT: must be a permission issue, got this on the log:

2021-01-15T20:03:37.129871911Z: ERROR :arrow_forward: v1/UploadTaskAttachment 22ac open files/4: permission denied

Thanks!

Fixed the attachment upload problem: for some reason the “files” directory inside the api container was owned by 1026:users. Had to fix permissions:
chown vikunja:vikunja files
Now I can upload files into tasks!

You can find the frontend version when opening the browser console, there should be a message “Vikunja frontend version …”. The api information is at /api/v1/info.

I’ve looked into it, it seems like there’s an issue somewhere in the caldav stuff. I’ll take a look.

Looks like you caught an edge case with the caldav thing. The route is not supposed to work in the browser, therefore no one noticed it throws an error when trying because it was not testet. Try putting that url into a caldav client, that should work.
I’ve pushed a fix to prevent the server error.

1 Like

My bad, I was using my namespace as user in my caldav app and not the email, so I wasn’t authenticating correctly. Tried with BusyCal for macOS and I could sync the lists but as for tasks I noticed the following:

  • if I create the task in the frontend, it will not sync to BusyCal for macOS;
  • if I create the task in BusyCal for macOS (with no dates) it will be pushed to the server, but then I go to the frontend in the browser, return to the webdav client, and the task disappears. I think it has something to do with parsing dates as I get this error in the api container console:

2021-01-16T17:37:51.300042328Z: WARNING ▶ caldav/caldavTimeToTimestamp c79 Error while parsing caldav time 20210116 to TimeStamp: parsing time "20210116" as "20060102T150405": cannot parse "" as "T"

So I think BusyCal for macOS in not compatible.

I also tried with macOS default reminders app, using the same credentials, but I get the error “not possible to confirm the account nor the password”. So it seems it is not possible to even add the account. But, Reminders app is not compatible with a lot of things from CalDAV I think.

The error caused by BusyCal looks like it could be easy to fix, although it is not standard behavior. Caldav is a complicated protocol to say the least…

Did you have a chance to try a different client?

I’ll see if I can get hands on another client, currently just have the default ones on macOS and iOS + busyCal for both macOS and iOS as well.

1 Like

Managed to get email reminders working! However, don’t know if is any misconfiguration, but the “OPEN TASK” blue button that appears on the email content does not work (i.e. link to the task).

The email also shows the message

If the button above doesn’t work, copy the url below and paste it in your browsers address bar:
tasks/8

As obvious the url does not work, what it should be presented (in my case that I am running on a NAS with IP) is http://192.168.9.36:8130/tasks/8

PS: the button has a weird url, something like this:

imap://my%2Eemail%2Ename%40gmail%2Ecom@imap.gmail.com:993/fetch%randomNumbersAndLetters%randomNumbersAndLetters/INBOX%randomNumbersAndLetters

Have you configured the Frontend url in the api configuration?

The weird url is probably caused by your email program.

Thank you for the quick reply. That was it, everything perfect now!

EDIT: almost perfect! When I click the button link or copy paste the URL I always end up having to login to Vikunja, so the direct access to the specific task is not achieved. Maybe it’s some config in my browser, will check it out.

Hi !
Digging out this threat to try and get some light.

How did you do ? Do you care sharing your docker-compose so I can compare it with mine ?

Sure. Here it is with some changes for privacy purposes :slight_smile:
I’m using Vikunja on local network only, acessible through VPN only; still I’m using a live server which hosts my email to send the email reminders; check for the VIKUNJA_MAILER_* variables below, hope it helps.

version: '2'

services:
  db:
    image: mariadb:10
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: vikunjaDB
    volumes:
      - /volume1/docker/vikunja/mysql:/var/lib/mysql
    restart: unless-stopped
    ports:
        - '1111:3306'
  api:
    image: vikunja/api
    environment:
      VIKUNJA_DATABASE_HOST: db
      VIKUNJA_DATABASE_PASSWORD: password
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: root
      VIKUNJA_DATABASE_DATABASE: vikunjaDB
      VIKUNJA_MAILER_ENABLED: "true"
      VIKUNJA_MAILER_HOST: mail.yourserver.com
      VIKUNJA_MAILER_USERNAME: mail@yourserver.com
      VIKUNJA_MAILER_PASSWORD: your_email_password
      VIKUNJA_MAILER_PORT: "465"
      VIKUNJA_MAILER_FORCESSL: "true"
      VIKUNJA_MAILER_FROMEMAIL: mail@yourserver.com
      VIKUNJA_MAILER_SKIPTLSVERIFY: "true"
      VIKUNJA_SERVICE_FRONTENDURL: "http://192.168.9.36:8130/"
    volumes: 
      - /volume1/docker/vikunja/files:/app/vikunja/files
    depends_on:
      - db
    restart: unless-stopped
  frontend:
    image: vikunja/frontend
    restart: unless-stopped
  proxy:
    image: nginx
    ports:
      - 8130:80
    volumes:
      - /volume1/docker/vikunja/nginx.conf:/etc/nginx/conf.d/default.conf:ro
    depends_on:
      - api
      - frontend
    restart: unless-stopped
1 Like

Thanks a lot for taking some time to answer.

This conforts me in my configuration, and I got mails working, but I don’t receive reminders notifications.
I see you don’t use VIKUNJA_SERVICE_ENABLEEMAILREMINDERS. Do you receive reminders emails ?

Reminders are enabled globally by default: Config options | Vikunja

You might need to enable them in your user settings though.

Thanks for your answer.

As I didn’t receive mail for reminders, I thought I had to add VIKUNJA_SERVICE_ENABLEEMAILREMINDERS.

I do have mails working (received a confirmation email and a reminder for overdue tasks this morning), but it looks like mail for reminders won’t get sent. I have the option checked in the settings.

I thought it could be related to a TZ problem, so I waited 24h+ and still got nothing.

I’m not sure where I should look at.

I’m receiving the email reminders with no problems. I’m using the docker-compose file that I’ve posted and have enabled the “Send me reminders for tasks via Email” in my settings. Are you running the latest version of the API? And are you setting the time for the reminder using the arrow keys in the GUI? (it will offset the hours by 1 and the minutes by 5).

Sorry for the late answer. Had a few really busy days.

Yes

I tried both. Didn’t change anything

Drives me crazy x)

Can you enable debug logging and check if you see any log messages prefixed with [Task Reminder Cron] in the logs after a minute?