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

Fails to fetch data when taskrc has a theme include directive

Open myukselen opened this issue 3 years ago • 12 comments

Hi,

I have just enabled a theme in .taskrc file and can not get any task data.

I think there is a missing documentation piece at least for my usecase. The theme file is in /usr/local/Cellar/task/2.6.2/share/doc/task/rc folder.

Thanks, -Murat

myukselen avatar Nov 21 '22 17:11 myukselen

Are you using the Docker container? If so, I think it's probably because you didn't mount the file into the container.

DCsunset avatar Nov 21 '22 19:11 DCsunset

Yes I am using Docker.

The include line is like this in .taskrc:

include solarized-dark-256.theme

Where should I map the /usr/local/Cellar/task/2.6.2/share/doc/task/rc folder so that it can used? I don't know which additional folders are being checked

myukselen avatar Nov 21 '22 20:11 myukselen

I'm not familiar with the include command so I may not be of great help. You can check the official document of taskwarrior. Besides, an easy way to debug it is to run the task command inside the container to see the error message.

DCsunset avatar Nov 22 '22 03:11 DCsunset

Hi @myukselen

may I ask what you are trying to achieve? If you want to change the colorscheme of the website the include of the .taskrc isn't of any help.

You'd need to fiddle with the css of the website.

Paraidomat avatar Jan 09 '23 14:01 Paraidomat

You can consider this as a bug. I wanted to use the dockerized application and followed the instructions. Issue subject line is a concise description.

I don't expect any behavior changes related to theme files or values.

myukselen avatar Jan 10 '23 21:01 myukselen

I have the same issue.

I made a docker-compose.yml and run the app

❯ cat docker-compose.yml
version: '3'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
    - 5679:80
    deploy:
      restart_policy:
        condition: always
    volumes:
    - ~/.taskrc:/.taskrc
    - ~/.task:/.task

The problem is that no tasks are visible on the page

image

And in the logs I see

image

bitroniq avatar Jun 26 '23 15:06 bitroniq

I fixed the problem simply by commenting out the theme from my .taskrc and restring the docker

❯ cat .taskrc | grep theme
# Color theme (uncomment one to use)
#include /usr/share/taskwarrior/light-16.theme
#include /usr/share/taskwarrior/light-256.theme
#include /usr/share/taskwarrior/dark-16.theme
#include /usr/share/taskwarrior/dark-256.theme
#include /usr/share/taskwarrior/dark-red-256.theme
#include /usr/share/taskwarrior/dark-green-256.theme
#include /usr/local/share/doc/task/rc/dark-green-256.theme
#include /usr/share/taskwarrior/dark-blue-256.theme
#include /usr/share/taskwarrior/dark-violets-256.theme
#include /usr/share/taskwarrior/dark-yellow-green.theme
#include /usr/share/taskwarrior/dark-gray-256.theme
#include /usr/share/taskwarrior/dark-gray-blue-256.theme
#include /usr/share/taskwarrior/solarized-dark-256.theme
#include /usr/share/taskwarrior/solarized-light-256.theme
#include /usr/share/taskwarrior/no-color.theme

Now the logs are ok

2023-06-26 17:09:47 
2023-06-26 17:09:47 > [email protected] start
2023-06-26 17:09:47 > node ./dist/app.js
2023-06-26 17:09:47 
2023-06-26 17:09:47 Server listening on http://0.0.0.0:3000
2023-06-26 17:09:51   <-- GET /tasks
2023-06-26 17:09:51   --> GET /tasks 200 86ms 385.95kb
2023-06-26 17:09:51 TASKRC override: /.taskrc
2023-06-26 17:09:51 TASKDATA override: /.task
2023-06-26 17:09:51 Configuration override rc.confirmation=no
2023-06-26 17:09:51 Configuration override rc.recurrence.confirmation=no
2023-06-26 17:09:51 Configuration override rc.dependency.confirmation=no
2023-06-26 17:09:51 Configuration override rc.json.depends.array=yes
2023-06-26 17:09:51 Configuration override rc.bulk=0

And I see the tasks on the page

bitroniq avatar Jun 26 '23 15:06 bitroniq

Thanks for the workaround. I will wait for a proper taskrc handling then. It can warn the user and create a copy without theme includes

myukselen avatar Jul 02 '23 12:07 myukselen

Based on the workaround, I think another easy way to solve this is to mount the /usr/share/taskwarrior into the container. Then you don't need to change the config file at all

DCsunset avatar Jul 03 '23 01:07 DCsunset

@myukselen, To use your already existing taskwarrior data, try :z labels. See here. Also, even if you did, theme won't be apply.

Constantin1489 avatar Jul 11 '23 10:07 Constantin1489

@bitroniq, I don't use docker-compose frequently but the answer seems the same.

To use your already existing taskwarrior data, try :z labels. See here.

# e.g.
    volumes:
    - ~/.taskrc:/.taskrc:z
    - ~/.task:/.task:z

Constantin1489 avatar Jul 11 '23 18:07 Constantin1489

using the :z will show your existing tasks, but only when you do not include a theme in .taskrc how to duplicate:

uncomment #include dark-blue-256.theme restart docker container -> no data visible adding the # again: restart docker container -> all data visible

Janov911 avatar Oct 15 '23 21:10 Janov911