Front page Forums General Accounts (git etc.) Token error

Tagged: 

This topic contains 6 replies, has 4 voices, and was last updated by  SZEPilot 2 weeks, 5 days ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29516

    ksivasan
    Participant

    Hello,

    I am trying to set my token using dts tok set <token> and ran into following error. Could you suggest me what should I do next?

    TypeError: the JSON object must be str, not ‘bytes’
    dts : Please report that you are using:
    :
    : duckietown-shell: 3.0.30
    : duckietown-shell-commands: 1.0.15
    : python: “3.5.2 (default, Nov 23 2017, 16:37:01) \n[GCC 5.4.0 20160609]”

    Thanks

    #29617

    Andrea Censi
    Keymaster

    Can you post the full output?

    #29624

    ksivasan
    Participant

    I am setting up the preliminaries following this link http://docs.duckietown.org/DT18/AIDO/out/cm_sw.html
    Hope this helps. I could not proceed without fixing token issue.

    ~$dts version

    INFO:dts:duckietown-shell 3.0.30

    dts : Problems with a command?
    :
    : Report here: https://github.com/duckietown/duckietown-shell-commands/issues
    :
    : Troubleshooting:
    :
    : – If some commands update fail, delete ~/.dt-shell/commands
    :
    : – To reset the shell to “factory settings”, delete ~/.dt-shell
    :
    : (Note: you will have to re-configure.)
    ERROR:dts:Traceback (most recent call last):
    File “/home/ksivasan/.local/lib/python3.5/site-packages/dt_shell/cli.py”, line 171, in check_commands_outdated
    data = json.loads(content)
    File “/usr/lib/python3.5/json/__init__.py”, line 312, in loads
    s.__class__.__name__))
    TypeError: the JSON object must be str, not ‘bytes’

    Duckietown Shell commands version 1.0.15
    dts version 3.0.30

    ~$ dts tok set
    INFO:dts:duckietown-shell 3.0.30

    dts : Problems with a command?
    :
    : Report here: https://github.com/duckietown/duckietown-shell-commands/issues
    :
    : Troubleshooting:
    :
    : – If some commands update fail, delete ~/.dt-shell/commands
    :
    : – To reset the shell to “factory settings”, delete ~/.dt-shell
    :
    : (Note: you will have to re-configure.)
    ERROR:dts:Traceback (most recent call last):
    File “/home/ksivasan/.local/lib/python3.5/site-packages/dt_shell/cli.py”, line 171, in check_commands_outdated
    data = json.loads(content)
    File “/usr/lib/python3.5/json/__init__.py”, line 312, in loads
    s.__class__.__name__))
    TypeError: the JSON object must be str, not ‘bytes’

    Duckietown Shell commands version 1.0.15

    dts : args: []

    Please enter your Duckietown token.

    It looks something like this:

    dt1-7vEuJsaxeXXXXX-43dzqWFnWd8KBa1yev1g3UKnzVxZkkTbfSJnxzuJjWaANeMf4y6XSXBWTpJ7vWXXXX

    To find your token, first login to duckietown.org, and open the page:

    Enter token: ****(correct token)

    dts : Traceback (most recent call last):
    : File “/home/ksivasan/.local/lib/python3.5/site-packages/dt_shell/__init__.py”, line 38, in cli_main
    : cli_main_()
    : File “/home/ksivasan/.local/lib/python3.5/site-packages/dt_shell/__init__.py”, line 106, in cli_main_
    : shell.onecmd(cmdline)
    : File “/usr/lib/python3.5/cmd.py”, line 217, in onecmd
    : return func(arg)
    : File “/home/ksivasan/.local/lib/python3.5/site-packages/dt_shell/cli.py”, line 409, in <lambda>
    : do_command_lam = lambda s, w: do_command(klass, s, w)
    : File “/home/ksivasan/.local/lib/python3.5/site-packages/dt_shell/dt_command_abs.py”, line 41, in do_command
    : cls.commands[word].do_command(cls.commands[word], shell, ‘ ‘.join(parts[1:]))
    : File “/home/ksivasan/.local/lib/python3.5/site-packages/dt_shell/dt_command_abs.py”, line 52, in do_command
    : cls.command(shell, args)
    : File “/home/ksivasan/.dt-shell/commands/tok/set/command.py”, line 45, in command
    : uid = get_id_from_token(s)
    : File “/home/ksivasan/.local/lib/python3.5/site-packages/dt_shell/duckietown_tokens.py”, line 94, in get_id_from_token
    : data = json.loads(token.payload)
    : File “/usr/lib/python3.5/json/__init__.py”, line 312, in loads
    : s.__class__.__name__))
    : TypeError: the JSON object must be str, not ‘bytes’

    dts : Please report that you are using:
    :
    : duckietown-shell: 3.0.30
    : duckietown-shell-commands: 1.0.15
    : python: “3.5.2 (default, Nov 23 2017, 16:37:01) \n[GCC 5.4.0 20160609]”

    • This reply was modified 1 month, 1 week ago by  ksivasan.
    #29630

    Andrea Daniele
    Participant

    This will be fixed in the Duckietown Shell v3.0.31, wait for it to be released, it should be online tomorrow.

    #29874

    ksivasan
    Participant

    Thanks, I will wait for the release.

    #30514

    SZEPilot
    Participant

    still having this issue in 3.0.31, can you please help?

    #30515

    SZEPilot
    Participant

    fixed, but always install with pip2 e.g. pip2 install –user –no-cache-dir -U duckietown-shell

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

Close Menu