theunraveler / taskwarrior-web

A web interface for the Taskwarrior todo application. Because being a neckbeard is only fun sometimes.
http://theunraveler.github.com/taskwarrior-web
MIT License
526 stars 63 forks source link

URI::InvalidURIError on specifying custom taskwarrior_web.uri file #125

Open paanvaannd opened 5 years ago

paanvaannd commented 5 years ago
$ task-web --version
rack 1.3
sinatra 2.0.5
vegas 0.1.11

I am trying to run multiple instances of taskwarrior-web and have each instance use a separate task database (i.e. different rc.data.location).

I am using RVM with 2 projects, each with their own gemset: taskwarrior-web and taskwarrior-web-objectives. Both are unmodified.

Running either of them without specifying custom log, PID, and URL files works fine. I copied the default log, PID, and URL files to the same directory (~/.vegas/taskwarrior_web/), slightly changing the filename (e.g. ~/.vegas/taskwarrior_web/taskwarrior_web.pid -> ~/.vegas/taskwarrior_web/taskwarrior_web-objectives.pid, etc.), and retained the file permissions of each. I modified the PID file to a numer 1 higher than the default (11129), the URL to a port 1 higher than the default (5679), and did not modify the log. Running either while trying to specify the aforementioned files results in a (URI::InvalieURIError) as follows:

$ cat ~/.vegas/taskwarrior_web/taskwarrior_web-objectives.pid
11129

$ cat ~/.vegas/taskwarrior_web/taskwarrior_web-objectives.url
http://0.0.0.0:5679

$ task-web --pid-file ~/.vegas/taskwarrior_web/taskwarrior_web-objectives.pid --log-file ~/.vegas/taskwarrior_web/taskwarrior_web-objectives.log --url-file ~/.vegas/taskwarrior_web/taskwarrior_web-objectives.url
[2019-04-11 15:49:10 -0400] Starting 'taskwarrior-web'...
/usr/share/rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/uri/rfc3986_parser.rb:67:in `split': bad URI(is not URI?): http://0.0.0.0:5679 (URI::InvalidURIError)
    from /usr/share/rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/uri/rfc3986_parser.rb:73:in `parse'
    from /usr/share/rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/uri/common.rb:227:in `parse'
    from /usr/share/rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/open-uri.rb:34:in `open'
    from /home/user/.rvm/gems/ruby-2.3.8@taskwarrior-web-objectives/gems/vegas-0.1.11/lib/vegas/runner.rb:146:in `port_open?'
    from /home/user/.rvm/gems/ruby-2.3.8@taskwarrior-web-objectives/gems/vegas-0.1.11/lib/vegas/runner.rb:160:in `check_for_running'
    from /home/user/.rvm/gems/ruby-2.3.8@taskwarrior-web-objectives/gems/vegas-0.1.11/lib/vegas/runner.rb:108:in `start'
    from /home/user/.rvm/gems/ruby-2.3.8@taskwarrior-web-objectives/gems/vegas-0.1.11/lib/vegas/runner.rb:77:in `initialize'
    from /home/user/.rvm/gems/ruby-2.3.8@taskwarrior-web-objectives/gems/taskwarrior-web-1.1.12/bin/task-web:9:in `new'
    from /home/user/.rvm/gems/ruby-2.3.8@taskwarrior-web-objectives/gems/taskwarrior-web-1.1.12/bin/task-web:9:in `<top (required)>'
    from /home/user/.rvm/gems/ruby-2.3.8@taskwarrior-web-objectives/bin/task-web:23:in `load'
    from /home/user/.rvm/gems/ruby-2.3.8@taskwarrior-web-objectives/bin/task-web:23:in `<main>'
    from /home/user/.rvm/gems/ruby-2.3.8@taskwarrior-web-objectives/bin/ruby_executable_hooks:24:in `eval'
    from /home/user/.rvm/gems/ruby-2.3.8@taskwarrior-web-objectives/bin/ruby_executable_hooks:24:in `<main>'
paanvaannd commented 5 years ago

P.S. Issuing the same command, but leaving out the --url-file ~/.vegas/taskwarrior_web/taskwarrior_web-objectives.url part and instead trying --port 5679 results in the following message:

$ task-web --pid-file ~/.vegas/taskwarrior_web/taskwarrior_web-objectives.pid --log-file ~/.vegas/taskwarrior_web/taskwarrior_web-objectives.log --port 5679                                                       
[2019-04-11 16:06:25 -0400] Starting 'taskwarrior-web'...
[2019-04-11 16:06:25 -0400] 'taskwarrior-web' is already running at http://0.0.0.0:5678
Couldn't get a file descriptor referring to the console

Why, if I specify a new log and PID file and port, can I not launch another instance of taskwarrior-web?

P.P.S. I will open a new issue for this if relevant, but how do I specify a new task data location for taskwarrior-web to use? E.g. the default location is ~/Documents/.tasks (as specified in ~/.taskrc), but I have a couple other locations (such as ~/Documents/.objectives) that I am trying to use in the OP for the new taskwarrior-web instances.