Fails to fetch data when taskrc has a theme include directive
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
Are you using the Docker container? If so, I think it's probably because you didn't mount the file into the container.
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
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.
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.
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.
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
And in the logs I see
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
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
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
@myukselen, To use your already existing taskwarrior data, try :z labels. See here.
Also, even if you did, theme won't be apply.
@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
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