taskwarrior-webui icon indicating copy to clipboard operation
taskwarrior-webui copied to clipboard

Not all tasks are visible

Open super-ben opened this issue 2 years ago • 2 comments

Hi,

I noticed this earlier but didn't tinker with it very much. Now as the webui works with iOS I tried again so it is a bit bigger deal for me. :)

The actual problem is:

  • when I set up and start the container, I can see less pending tasks on the webui than in my actual taskwarrior cli (currently 40 in cli vs. 31 in the webui)

My current docker-compose file:

version: '3.7'
services:
  taskwarrior-webui:
    image: dcsunset/taskwarrior-webui:latest
    container_name: taskwarrior-webui
    volumes:
      - $HOME/.taskrc:/.taskrc
      - $HOME/.task:/.task
    ports:
      - 5678:80
    restart: always

taskw

Any ideas, what am I doing wrong?

Bonus question, if I may: this way, I can see the tasks, but cannot sync, as it (correctly) doesn't find the CA under /.task, but when I mount it differently, say, - $HOME/.taskrc:/home/user/.taskrc (and .task similarly), the tasks don't appear on the webui as for some reason it cannot see them (when viewing the logs, it says overriding /.task, so seemingly ignoring my newly set path). How to set it up so I can see and sync the tasks, as well? I'm pretty sure this is something simple but can't seem to see it.

super-ben avatar Oct 22 '22 20:10 super-ben

Hi, can you try running taskwarrior cli inside the container to get some output? You can also try running sync command to see if there's a problem.

DCsunset avatar Oct 25 '22 18:10 DCsunset

Thank you for your answer and the tips. The current situation is 37 tasks on the cli and 32 on the webui in the browser (runnning the compose file above). When I take a look at the container, it gets interesting, as it shows 37 tasks.

docker exec -it taskwarrior-webui sh
/ # task
TASKRC override: /.taskrc
TASKDATA override: /.task
...
37 tasks

When I run a sync, though, I see the CA certificate error mentioned:

docker exec -it taskwarrior-webui sh
/ # task synchronize
TASKRC override: /.taskrc
TASKDATA override: /.task
CA certificate not found.

However..

/ # ls -l /.task |grep "ca"
-rw-------    1 1000     1000          1984 Oct 13 20:54 ca.cert.pem
-rw-------    1 1000     1000         10732 Oct 13 20:54 ca.key.pem
/ # 

When I reconfigure the compose file and mount it to /home/myuser/.task and /home/myuser/.taskrc, the webui doesn't show a thing, and when I look at the container I see this:

/ # task
TASKRC override: /.taskrc
TASKDATA override: /.task
No matches.
/ # task synchronize
TASKRC override: /.taskrc
TASKDATA override: /.task
Taskserver is not configured.

Sure thing, as it's not there but I don’t know why it wants to override. :)

super-ben avatar Oct 25 '22 19:10 super-ben

Thanks for your feedback. I already know why the certificate file doesn't work, but still have no clues on the wrong number of tasks. I'll try to fix the former issue first.

DCsunset avatar Oct 28 '22 02:10 DCsunset

Great, thank you!

super-ben avatar Oct 28 '22 16:10 super-ben

Hi, I think this issue should already be fixed in the latest version. You can set TASKRC and TASKDATA environment variables so that you can mount the config anywhere.

You can also check if this fixes the wrong number of tasks.

DCsunset avatar Nov 09 '22 19:11 DCsunset

Thank you for your efforts! I just tried and unfortunately I see the same results. At this point I tend to think that I'm doing something wrong:

  • when I enter the container and run the usual commands:
/ # task sync
TASKRC override: /.taskrc
TASKDATA override: /.task
CA certificate not found.
/ # task
TASKRC override: /.taskrc
TASKDATA override: /.task
...
26 tasks
  • while on the web interface I see 21 actual tasks (26 is the correct one)
  • just to make sure, I checked and I'm using the latest image indeed:
docker images |grep task
dcsunset/taskwarrior-webui   latest        b468bdb1c85d   3 hours ago    375MB

I didn't change a thing, everything is as in my opening post. I'm really grateful, though, and also out of ideas. If you could give me any pointers, I'll follow them. :)

super-ben avatar Nov 09 '22 19:11 super-ben

Could you show me your command to start the container? You can also run echo $TASKRC inside the container to check if the environment variables are set correctly..

DCsunset avatar Nov 09 '22 22:11 DCsunset

Sure thing, as I'm using the docker-compose file shown in the opening post, with a simple docker-compose up -d command.

And the echo:

/ # echo $TASKRC
/.taskrc

(naturally, I'm setting up the container with my actual user for this, and not with root :))

If I change the mount again to /home/myuser/.task and /home/myuser/.taskrc, the result is the same as before:

docker exec -it taskwarrior-webui sh
/ # task
TASKRC override: /.taskrc
TASKDATA override: /.task
No matches.
/ # task sync
TASKRC override: /.taskrc
TASKDATA override: /.task
Taskserver is not configured.

super-ben avatar Nov 10 '22 08:11 super-ben

I see. You'll need to override TASKRC and TASKDATA yourself if you want to mount them to a different location. This is because the container doesn't know your username and thus the default path is not the same as your host machine.

You can follow the new document (Configuration part) to set the env variables correctly.

DCsunset avatar Nov 10 '22 16:11 DCsunset

It may not be entirely correct, let me show you why, here's my modified compose file with very direct mapping among the environment variables:

version: '3.7'
services:
  taskwarrior-webui:
    image: dcsunset/taskwarrior-webui:latest
    container_name: taskwarrior-webui
    volumes:
      - /home/username/.taskrc:/home/username/.taskrc
      - /home/username/.task:/home/username/.task
    ports:
      - 5678:80
    restart: always

And it still doesn't see a thing and tries to override:

docker exec -it taskwarrior-webui sh
/ # task
TASKRC override: /.taskrc
TASKDATA override: /.task
No matches.
Recently upgraded to 2.6.0. Please run 'task news' to read highlights about the new release.
/ # task sync
TASKRC override: /.taskrc
TASKDATA override: /.task
Taskserver is not configured.

However, when I take a look inside, the mapping is correct:

docker exec -it taskwarrior-webui sh
/ # ls -hal /home/username/
total 16K    
drwxr-xr-x    3 root     root        4.0K Nov 10 17:34 .
drwxr-xr-x    1 root     root        4.0K Nov 10 17:34 ..
drwxr-xr-x    3 1000     1000        4.0K Oct 26 20:24 .task
-rw-rw-r--    1 1000     1000        2.3K Nov 10 09:08 .taskrc

I think after this I'll just let it go, if you don't have any hints. Thanks for the effort, though.

super-ben avatar Nov 10 '22 17:11 super-ben

No. What I mean is that you need to set the env variables for the container itself. In your case, the docker-compose.yml should be like this:

version: '3.7'
services:
  taskwarrior-webui:
    image: dcsunset/taskwarrior-webui:latest
    container_name: taskwarrior-webui
    enviroment:
      - TASKRC=/home/username/.taskrc
      - TASKDATA=/home/username/.task
    volumes:
      - /home/username/.taskrc:/home/username/.taskrc
      - /home/username/.task:/home/username/.task
    ports:
      - 5678:80
    restart: always

If you don't set those env variables, the container is not able to know the /home/username because its user should be root.

DCsunset avatar Nov 10 '22 20:11 DCsunset

Ah, okay, thanks, I misinterpreted your last message but I just tried this and works well. :)

The current different in the number of tasks remains, 24 vs 21 at the moment. I can't even say a pattern here, for example, I have a recurring task with 2 tasks currently on the list, one of them shows, one of them doesn't, so I don't even have a pointer for you. :(

super-ben avatar Nov 10 '22 20:11 super-ben

Hmm..the remaining 3 tasks in this case were on the "Waiting" page..I don't really know why (as tehy are note marked as Waiting in TW), but after seeing this I think I'll be able to figure out the difference. Thanks a lot again!

super-ben avatar Nov 10 '22 20:11 super-ben