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

GET /api/tasks error when running with docker container (amd64)

Open bergercookie opened this issue 4 years ago • 10 comments

After docker-run-ing the container and pointing it to my .taskrc and .task file and directory respectively, and after navigating to localhost:8080, the tasks view is empty and I can see the folowing error when I open the developer tools:

GET http://localhost:8080/api/tasks [HTTP/1.1 400 Bad Request 0ms]

The full error in firefox is as follows:

uncaught (in promise) Error: Request failed with status code 400
    NuxtJS 35
        exports
        exports
        onreadystatechange
        exports
        exports
        exports
        promise callback*h.prototype.request
        t
        exports
        <anonymous>
        n
        v
        _invoke
        $/</<
        r
        l
        o
        o
        fetchTasks
        O
        dispatch
        dispatch
        setup
        setup
        data
        kt
        data
        data
        _data
        jn
        jn
        _init
        f
        componentInstance
        init
c713f9e.js:2:168229
    NuxtJS 31
        dispatch
        (Async: promise callback)
    dispatch
        dispatch
        dispatch
        setup
        setup
        data
        kt
        data
        data
        _data
        jn
        jn
        _init
        f
        componentInstance
        init
        n
        v
        v
        Co
        _update
        r
        get
        En
        mount
        $mount
        init
        v
        v
        Co

Doing the same via curl, leads to:

$ curl  http://localhost:8080/api/tasks
Task command error⏎

Locally I'm using taskwarrior 2.5.3 to manage my .task and .taskrc files

bergercookie avatar Sep 27 '21 10:09 bergercookie

Hello, thanks for your feedback. It seems there's something wrong with the nginx config. I have fixed it in the latest commit. You can check if it works now.

DCsunset avatar Sep 28 '21 00:09 DCsunset

Has a new docker image been generated for this change yet or do I have to generate it myself?

On Tue, 5 Oct 2021 at 16:10, DCsunset @.***> wrote:

Closed #17 https://github.com/DCsunset/taskwarrior-webui/issues/17.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DCsunset/taskwarrior-webui/issues/17#event-5411489150, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMMDD4DCKWGVBVVNLR5CXDUFMINBANCNFSM5E2HJKZQ .

-- Nikos Koukis @.***

bergercookie avatar Oct 05 '21 15:10 bergercookie

It has been generated and you can try the latest version now.

DCsunset avatar Oct 05 '21 18:10 DCsunset

Thanks for pushing the latest state to docker.io.

Unfortunately this still doesn't work for me.

I've verified that I've got the latest docker image ( running docker pull) and I end up in the same state (no tasks shown when connecting to the server). When running the dockerfile interactively (without detaching) I get the following:

> [email protected] start                  
> node ./dist/app.js                   
                                       
Server listening on http://0.0.0.0:3000
  <-- GET /tasks                       
TASKRC override: /.taskrc              
TASKDATA override: /.task              
  xxx GET /tasks 400 909ms -           

bergercookie avatar Oct 09 '21 19:10 bergercookie

I can repro the above running it in development mode.

However, creating a new taskrc and task directory under /test/ instead of copying my own task cofniguration seems to get past the 400 error code and actually shows me my tasks. So my issue is more about parsing my specific task configuration and tasks.

Any way to debug this and get more info about this error?

bergercookie avatar Oct 09 '21 20:10 bergercookie

Hi, could you run the following command (replace the paths) and see if any error occurs?

TASKRC=<your_taskrc> TASKDATA=<your_taskdir> task rc.confirmation=no rc.recurrence.confirmation=no rc.dependency.confirmation=no rc.json.depends.array=yes rc.bulk=0 export

DCsunset avatar Oct 09 '21 22:10 DCsunset

Sorry to say, I have the same error. Running the export (inside the container as well as on the host) passes well. Thanks for your work!

volodymyrss avatar Feb 02 '22 17:02 volodymyrss

I found that in my case it was because of many tasks. My case can be resolved by https://github.com/DCsunset/taskwarrior-lib/pull/1

volodymyrss avatar Feb 03 '22 09:02 volodymyrss

@volodymyrss Thanks for your feedback and fix.

I have updated taskwarrior-lib to the latest version and It should fix this issue.

DCsunset avatar Feb 08 '22 03:02 DCsunset

I just want to comment that I am not completely sure that the problem of @bergercookie if is the same as mine. The error message is quite generic and could mean different things, as I realized after my investigation. But it would be great if it also helped @bergercookie !

volodymyrss avatar Feb 08 '22 08:02 volodymyrss