{"action":"created","issue":{"url":"https://api.github.com/repos/facebookincubator/LogDevice/issues/62","repository_url":"https://api.github.com/repos/facebookincubator/LogDevice","labels_url":"https://api.github.com/repos/facebookincubator/LogDevice/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/facebookincubator/LogDevice/issues/62/comments","events_url":"https://api.github.com/repos/facebookincubator/LogDevice/issues/62/events","html_url":"https://github.com/facebookincubator/LogDevice/issues/62","id":395022598,"node_id":"MDU6SXNzdWUzOTUwMjI1OTg=","number":62,"title":"ldshell `logs show` is broken in OSS build","user":{"login":"MohamedBassem","id":2418637,"node_id":"MDQ6VXNlcjI0MTg2Mzc=","avatar_url":"https://avatars2.githubusercontent.com/u/2418637?v=4","gravatar_id":"","url":"https://api.github.com/users/MohamedBassem","html_url":"https://github.com/MohamedBassem","followers_url":"https://api.github.com/users/MohamedBassem/followers","following_url":"https://api.github.com/users/MohamedBassem/following{/other_user}","gists_url":"https://api.github.com/users/MohamedBassem/gists{/gist_id}","starred_url":"https://api.github.com/users/MohamedBassem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MohamedBassem/subscriptions","organizations_url":"https://api.github.com/users/MohamedBassem/orgs","repos_url":"https://api.github.com/users/MohamedBassem/repos","events_url":"https://api.github.com/users/MohamedBassem/events{/privacy}","received_events_url":"https://api.github.com/users/MohamedBassem/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-31T19:27:40Z","updated_at":"2019-01-02T16:23:07Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Steps to reproduce:\r\n\r\n- Start a local cluster using `ld-dev-cluster` using the ubuntu docker image\r\n- ldhsell into this cluster\r\n- Run `logs show`\r\n- It crashes with:\r\n```\r\nroot@/dev/shm/tmp/logdevice/IntegrationTestUtils.510e-92fc-9dcd-57c2/logdevice.conf> logs show\r\nError running command: 'ascii' codec can't encode character '\\u25bc' in position 5: ordinal not in range(128)\r\n------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.6/dist-packages/nubia/internal/cmdbase.py\", line 363, in run_interactive\r\n    ret = fn(**args_dict)\r\n  File \"/usr/local/lib/python3.6/dist-packages/ldshell/autoload/commands/logsconfig.py\", line 514, in show\r\n    node, max_depth=max_depth, log_groups=True, show_version=True\r\n  File \"/usr/local/lib/python3.6/dist-packages/ldshell/autoload/commands/logsconfig.py\", line 334, in _print_directory\r\n    return _print_directory_helper(0, directory, max_depth, log_groups, show_version)\r\n  File \"/usr/local/lib/python3.6/dist-packages/ldshell/autoload/commands/logsconfig.py\", line 309, in _print_directory_helper\r\n    cprint(space_shift + \"\\u25BC \" + directory.fully_qualified_name, \"green\")\r\n  File \"/usr/local/lib/python3.6/dist-packages/termcolor.py\", line 124, in cprint\r\n    print((colored(text, color, on_color, attrs)), **kwargs)\r\nUnicodeEncodeError: 'ascii' codec can't encode character '\\u25bc' in position 5: ordinal not in range(128)\r\n------------------------------------------------------------\r\n```"},"comment":{"url":"https://api.github.com/repos/facebookincubator/LogDevice/issues/comments/450909200","html_url":"https://github.com/facebookincubator/LogDevice/issues/62#issuecomment-450909200","issue_url":"https://api.github.com/repos/facebookincubator/LogDevice/issues/62","id":450909200,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDkwOTIwMA==","user":{"login":"calebmarchent","id":37041441,"node_id":"MDQ6VXNlcjM3MDQxNDQx","avatar_url":"https://avatars0.githubusercontent.com/u/37041441?v=4","gravatar_id":"","url":"https://api.github.com/users/calebmarchent","html_url":"https://github.com/calebmarchent","followers_url":"https://api.github.com/users/calebmarchent/followers","following_url":"https://api.github.com/users/calebmarchent/following{/other_user}","gists_url":"https://api.github.com/users/calebmarchent/gists{/gist_id}","starred_url":"https://api.github.com/users/calebmarchent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calebmarchent/subscriptions","organizations_url":"https://api.github.com/users/calebmarchent/orgs","repos_url":"https://api.github.com/users/calebmarchent/repos","events_url":"https://api.github.com/users/calebmarchent/events{/privacy}","received_events_url":"https://api.github.com/users/calebmarchent/received_events","type":"User","site_admin":false},"created_at":"2019-01-02T16:23:07Z","updated_at":"2019-01-02T16:23:07Z","author_association":"CONTRIBUTOR","body":"Logs Show is using hardcoded utf-8 charaters to render the tree; ▼ is \"\\u25BC\". But by default the docker container shell is configured without UTF-8 support. \r\nOne can work-around the issue by setting the locale in the terminal:\r\n\r\n```\r\nroot@af2893e7f15f:/# export LANG=C.UTF-8\r\nroot@af2893e7f15f:/# ldshell -c /dev/shm/tmp/logdevice/IntegrationTestUtils.5714-ed1a-5e36-c72b/logdevice.conf\r\nLogging to /tmp/ldshell-pcjjglrc\r\nLogging Level: WARNING\r\nroot@/dev/shm/tmp/logdevice/IntegrationTestUtils.5714-ed1a-5e36-c72b/logdevice.conf> logs show\r\n▼ /\r\n  Version: 1\r\n  Attributes:\r\n  - extra-copies: 0    (Overridden)\r\n  - synced-copies: 0    (Overridden)\r\n  - max-writes-in-flight: 1000    (Overridden)\r\n  - single-writer: False    (Overridden)\r\n  - sequencer-affinity: None    (Overridden)\r\n  - nodeset-size: None    (Overridden)\r\n  - backlog: None    (Overridden)\r\n  - delivery-latency: None    (Overridden)\r\n  - scd-enabled: False    (Overridden)\r\n  - local-scd-enabled: False    (Overridden)\r\n  - write-token: None    (Overridden)\r\n  - sticky-copysets: False    (Overridden)\r\n```\r\nDocker containers are intended to provide lean controlled environments for individual services to run in so the majority of the terminal things we are used to as developers are not present (e.g. an editor).\r\n\r\nIn terms of a solution: we could update the Docker container shell to have UTF-8 enabled. Or we could remove the UTF-8 characters from the ldshell UI, replacing \"▼\" with \"V\" and  \"▶\" with \">\".  "}}
{"actor":{"display_login":"calebmarchent"}}