kevinpapst/kimai2-console

kimai start error 400 when activity got slash char

sotornien opened this issue · 4 comments

Hi,

my commands look like these:

kimai start --customer 'Customer-X' --project 'Project X' --activity 'Training/Study' --description 'Any description' --tags ''

Please note the different String Parameter:

  • customer uses a dash, which is working
  • project uses a space, which is also working
  • activity uses a slash which results in a error 400 - Bad request
    kimai2

However this is working:

kimai start --customer 'Customer-X' --project 'Project X' --activity '10' --description 'Any description' --tags ''

I switched from activity 'Training/Study' to '10', the ID of this activity -> This is working. Other activity string-parameter like 'Meeting' or 'Docs' is also working

Kimai Version:
Kimai 2 - 1.7 stable (Ayumi) by Kevin Papst and contributors.
Kimai 2 - Remote Console version 0.3.3 2020-01-27 17:22:30 UTC (#5546282)

OS:
DISTRIB_ID=ManjaroLinux
DISTRIB_RELEASE=20.0.3
DISTRIB_CODENAME=Lysia
DISTRIB_DESCRIPTION="Manjaro Linux"

But your screenshot says that the "term" parameter has the backslash.
Nevertherless: does it work when you use the select list (using kimai start only) instead of submitting the params?

Hi Kevin,
wow quick response :) Sorry for the misunderstanding, it is about a normal forward slash (I've corrected it in my post)
If I'm just using kimai start with the interactive menu it is working.

Internally the Kimai binary AFAIR (its too long ago that I touched this project ) loads a list of activities and compares the given name against the list and then uses the found ID for the actual "start" call. So maybe it is the bash escaping that is a problem?

And again:

But your screenshot says that the "term" parameter has the backslash.

Having a problem in the search term is different from the activity.
Maybe I am wrong with my initial assumption that the activity name is used to find the activity ID, but the screenshot is unfortunately missing the important $ kimai start line.

Hi Kevin,
Maybe this screenshot explains it better?
kimai