weixin_39534759
weixin_39534759
2020-12-02 17:19

Error starting Vdebug: <class 'UnicodeDecodeError'>

I have had vdebug v1 working for a long time. I updated vim, which looks like it set up python 3 support (has('python3')) and removed python 2 support (has('python')) by default. I upgrade vdebug as well, which brought in the v2-integration changes. Now when I start listening with vdebug (F5), start xdebug via a cookie, and load the right page, I get this error:

screen shot 2018-03-12 at 11 55 56 am

Sometimes it shows up like this instead

screen shot 2018-03-12 at 12 10 06 pm

Versions

MacOS 10.13.3

Vim (from brew install vim --with-override-system-vi):


VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 12 2018 12:02:38)
macOS version
Included patches: 1-1553
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +farsi             +mouse_sgr         -tag_any_white
+arabic            +file_in_path      -mouse_sysmouse    -tcl
+autocmd           +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    -gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          -toolbar
+cindent           +insert_expand     +path_extra        +user_commands
-clientserver      +job               +perl              +vertsplit
+clipboard         +jumplist          +persistent_undo   +virtualedit
+cmdline_compl     +keymap            +postscript        +visual
+cmdline_hist      +lambda            +printer           +visualextra
+cmdline_info      +langmap           +profile           +viminfo
+comments          +libcall           -python            +vreplace
+conceal           +linebreak         +python3           +wildignore
+cryptv            +lispindent        +quickfix          +wildmenu
+cscope            +listcmds          +reltime           +windows
+cursorbind        +localmap          +rightleft         +writebackup
+cursorshape       -lua               +ruby              -X11
+dialog_con        +menu              +scrollbind        -xfontset
+diff              +mksession         +signs             -xim
+digraphs          +modify_fname      +smartindent       -xpm
-dnd               +mouse             +startuptime       -xsmp
-ebcdic            -mouseshape        +statusline        -xterm_clipboard
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_save
+eval              -mouse_gpm         +syntax
+ex_extra          -mouse_jsbterm     +tag_binary
+extra_search      +mouse_netterm     +tag_old_static
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -framework AppKit   -mmacosx-version-min=10.13 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.26.1/lib/perl5/5.26.1/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -lpython3.6m -framework CoreFoundation  -lruby.2.5.0 -lobjc

Vdebug: master - 6b2b2bac8947f6f5c72ca3a75401270d52b740b4

Vdebug config

let g:vdebug_options:


{
  "auto_start": 1,
  "background_listener": 1,
  "break_on_open": 1,
  "continuous_mode": 1,
  "debug_file": "/tmp/vdebug.log",
  "debug_file_level": 2,
  "debug_window_level": 0,
  "ide_key": "",
  "marker_closed_tree": "▸",
  "marker_default": "⬦",
  "marker_open_tree": "▾",
  "on_close": "stop",
  "path_maps": {
    "/path/on/remote": "/path/on/local"
  },
  "port": 9000,
  "server": "",
  "timeout": 30,
  "watch_window_style": "compact",
  "window_arrangement": ["DebuggerWatch", "DebuggerStack", "DebuggerStatus"],
  "window_commands": {
    "DebuggerStack": "belowright new",
    "DebuggerStatus": "belowright new",
    "DebuggerWatch": "vertical belowright new"
  }
}

Logs

/tmp/vdebug.log:


- [Debug] {Mon 12 2018 12:06:16} Setting buffer for DebuggerWatch: ['']
- [Debug] {Mon 12 2018 12:06:16} Setting buffer for DebuggerStack: ['']
- [Debug] {Mon 12 2018 12:06:16} Setting buffer for DebuggerStatus: ['']
- [Info] {Mon 12 2018 12:06:16} Closing the connection
- [Debug] {Mon 12 2018 12:06:16} Command: stop -i 1
- [Info] {Mon 12 2018 12:06:16} Connection has been closed
- [Debug] {Mon 12 2018 12:06:16} Closing the socket
- [Debug] {Mon 12 2018 12:06:16} Creating hidden buffer: ['']
- [Debug] {Mon 12 2018 12:06:16} Creating hidden buffer: ['']
- [Debug] {Mon 12 2018 12:06:16} Creating hidden buffer: ['']
- [Debug] {Mon 12 2018 12:06:16} Creating hidden buffer: []
- [Debug] {Mon 12 2018 12:06:16} Creating hidden buffer: []
- [Debug] {Mon 12 2018 12:06:16} Creating hidden buffer: []
- [Debug] {Mon 12 2018 12:06:16} Closing the socket

/tmp/xdebug.log:


Log opened at 2018-03-12 19:07:47
I: Connecting to configured address/port: 10.0.2.2:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///path/to/index.php" language="PHP" xdebug:language_version="7.0.26" protocol_version="1.0" appid="31" idekey="{my_ide_key}"><engine version="2.5.5"></engine><author></author><url></url><copyright></copyright></init>

 <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stop" transaction_id="1" status="stopped" reason="ok"></response>

该提问来源于开源项目:vim-vdebug/vdebug

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

15条回答

  • weixin_39795971 weixin_39795971 5月前

    I'm sorry I cannot reproduce this issue, using dinghy wrapper for docker-machine everything seems to work for me

    screenshot_20180322_223606

    Using macOS 10.13.3

    screenshot_20180322_224127

    点赞 评论 复制链接分享
  • weixin_39795971 weixin_39795971 5月前

    ~~~ PHP 7.1.15-1+0~20180306120016.15+stretch~1.gbp78327e (cli) (built: Mar 6 2018 12:00:19) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.1.15-1+0~20180306120016.15+stretch~1.gbp78327e, Copyright (c) 1999-2018, by Zend Technologies with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans ~~~

    ~~~ /etc/php/7.1/cli/conf.d/20-xdebug.ini, xdebug xdebug support => enabled xdebug.auto_trace => Off => Off xdebug.cli_color => 0 => 0 xdebug.collect_assignments => Off => Off xdebug.collect_includes => On => On xdebug.collect_params => 0 => 0 xdebug.collect_return => Off => Off xdebug.collect_vars => Off => Off xdebug.coverage_enable => On => On xdebug.default_enable => On => On xdebug.dump.COOKIE => no value => no value xdebug.dump.ENV => no value => no value xdebug.dump.FILES => no value => no value xdebug.dump.GET => no value => no value xdebug.dump.POST => no value => no value xdebug.dump.REQUEST => no value => no value xdebug.dump.SERVER => no value => no value xdebug.dump.SESSION => no value => no value xdebug.dump_globals => On => On xdebug.dump_once => On => On xdebug.dump_undefined => Off => Off xdebug.extended_info => On => On xdebug.file_link_format => no value => no value xdebug.filename_format => no value => no value xdebug.force_display_errors => Off => Off xdebug.force_error_reporting => 0 => 0 xdebug.gc_stats_enable => Off => Off xdebug.gc_stats_output_dir => /tmp => /tmp xdebug.gc_stats_output_name => gcstats.%p => gcstats.%p xdebug.halt_level => 0 => 0 xdebug.idekey => no value => no value xdebug.max_nesting_level => 1000 => 1000 xdebug.max_stack_frames => -1 => -1 xdebug.overload_var_dump => 2 => 2 xdebug.profiler_aggregate => Off => Off xdebug.profiler_append => Off => Off xdebug.profiler_enable => Off => Off xdebug.profiler_enable_trigger => Off => Off xdebug.profiler_enable_trigger_value => no value => no value xdebug.profiler_output_dir => /tmp => /tmp xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p xdebug.remote_addr_header => no value => no value xdebug.remote_autostart => Off => Off xdebug.remote_connect_back => On => On xdebug.remote_cookie_expire_time => 3600 => 3600 xdebug.remote_enable => On => On xdebug.remote_handler => dbgp => dbgp xdebug.remote_host => localhost => localhost xdebug.remote_log => no value => no value xdebug.remote_mode => req => req xdebug.remote_port => 9000 => 9000 xdebug.remote_timeout => 200 => 200 xdebug.scream => Off => Off xdebug.show_error_trace => Off => Off xdebug.show_exception_trace => Off => Off xdebug.show_local_vars => Off => Off xdebug.show_mem_delta => Off => Off xdebug.trace_enable_trigger => Off => Off xdebug.trace_enable_trigger_value => no value => no value xdebug.trace_format => 0 => 0 xdebug.trace_options => 0 => 0 xdebug.trace_output_dir => /tmp => /tmp xdebug.trace_output_name => trace.%c => trace.%c xdebug.var_display_max_children => 128 => 128 xdebug.var_display_max_data => 512 => 512 xdebug.var_display_max_depth => 3 => 3 ~~~

    点赞 评论 复制链接分享
  • weixin_39795971 weixin_39795971 5月前

    Maybe there is something in your application that might trigger the error?

    点赞 评论 复制链接分享
  • weixin_39795971 weixin_39795971 5月前

    could you test if https://github.com/vim-vdebug/vdebug/pull/340 fixes this for you? I think its caused by the same issue

    点赞 评论 复制链接分享
  • weixin_39534759 weixin_39534759 5月前

    works great! Thanks!!

    点赞 评论 复制链接分享
  • weixin_39757122 weixin_39757122 5月前

    I have run in the same issue while trying to start vdebug for PHP using Neovim Using Kali install under Window Subsystem for Linux I am trying with simple phpinfo() file

    Error

    
    Vdebug will wait for a connection in the background
    Found connection, starting debugger
    Error starting Vdebug: <class>
    </class>

    ` /tmp/xebug.log

    
    og opened at 2018-04-17 15:42:57
    I: Connecting to configured address/port: 127.0.0.1:9000.
    I: Connected to client. :-)
    -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///home/nexus/workspace/apraagency/phpinfo.php" language="PHP" xdebug:language_version="7.1.13-1" protocol_version="1.0" appid="8076" idekey="NEOVIM"><engine version="2.6.0"></engine><author></author><url></url><copyright></copyright></init>
    
    

    Vdebug

    
    commit 5e1d263424283eb5b735e9efc933ca31a0ec0672 (grafted, HEAD -> master, origin/master, origin/HEAD)
    Author: Ike Devolder <ike.devolder.com>
    Date:   Sun Apr 8 11:39:21 2018 +0200
        Merge pull request #346 from vim-vdebug/issue-312-expand-properties-in-dict-unicode-error
        Issue 312 expand properties in dict unicode error
    </ike.devolder.com>

    Vdebug config

    
    let g:vdebug_options= {
     \    "port" : 9000,
     \    "continuous_mode" : 1,
     \    "server" : '',
     \    "timeout" : 60,
     \    "on_close" : 'detach',
     \    "break_on_open" : 0,
     \    "ide_key" : 'NEOVIM',
     \    "debug_window_level" : 0,
     \    "debug_file_level" : 0,
     \    "debug_file" : "/tmp/xdebug.log",
     \    "watch_window_style" : 'compact'
    \ }
    

    OS Linux 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 GNU/Linux

    bash
    DISTRIB_ID=Kali
    DISTRIB_RELEASE=kali-rolling
    DISTRIB_CODENAME=kali-rolling
    DISTRIB_DESCRIPTION="Kali GNU/Linux Rolling"
    PRETTY_NAME="Kali GNU/Linux Rolling"
    NAME="Kali GNU/Linux"
    ID=kali
    VERSION="2018.1"
    

    Neovim

    
    NVIM v0.2.2
    Build type: RelWithDebInfo
    LuaJIT 2.1.0-beta3
    Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-VavapE/neovim-0.2.2=. -fstack-protector-strong -Wformat -Werror=format-secu
    rity -Wdate-time -D_FORTIFY_SOURCE=2 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=2 -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM
    _MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-protot
    ypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURC
    E -I/build/neovim-VavapE/neovim-0.2.2/build/config -I/build/neovim-VavapE/neovim-0.2.2/src -I/usr/include -I/usr/include -I/usr/include -I/u
    sr/include -I/usr/include -I/usr/include -I/usr/include -I/build/neovim-VavapE/neovim-0.2.2/build/src/nvim/auto -I/build/neovim-VavapE/neovi
    m-0.2.2/build/include
    Compiled by pkg-vim-maintainers.alioth.debian.org
    
    Features: +acl +iconv +jemalloc +tui
    

    PHP

    
    PHP 7.1.15-1 (cli) (built: Mar  6 2018 10:50:10) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.1.15-1, Copyright (c) 1999-2018, by Zend Technologies
        with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
    

    php -i | grep xdebug

    
    ❯ php -i | grep xdebug
    /etc/php/7.1/cli/conf.d/20-xdebug.ini,
    xdebug
    xdebug support => enabled
    xdebug.auto_trace => Off => Off
    xdebug.cli_color => 0 => 0
    xdebug.collect_assignments => Off => Off
    xdebug.collect_includes => On => On
    xdebug.collect_params => 0 => 0
    xdebug.collect_return => Off => Off
    xdebug.collect_vars => Off => Off
    xdebug.coverage_enable => On => On
    xdebug.default_enable => On => On
    xdebug.dump.COOKIE => no value => no value
    xdebug.dump.ENV => no value => no value
    xdebug.dump.FILES => no value => no value
    xdebug.dump.GET => no value => no value
    xdebug.dump.POST => no value => no value
    xdebug.dump.REQUEST => no value => no value
    xdebug.dump.SERVER => no value => no value
    xdebug.dump.SESSION => no value => no value
    xdebug.dump_globals => On => On
    xdebug.dump_once => On => On
    xdebug.dump_undefined => Off => Off
    xdebug.extended_info => On => On
    xdebug.file_link_format => no value => no value
    xdebug.filename_format => no value => no value
    xdebug.force_display_errors => Off => Off
    xdebug.force_error_reporting => 0 => 0
    xdebug.gc_stats_enable => Off => Off
    xdebug.gc_stats_output_dir => /tmp => /tmp
    xdebug.gc_stats_output_name => gcstats.%p => gcstats.%p
    xdebug.halt_level => 0 => 0
    xdebug.idekey => no value => no value
    xdebug.max_nesting_level => 256 => 256
    xdebug.max_stack_frames => -1 => -1
    xdebug.overload_var_dump => 2 => 2
    xdebug.profiler_aggregate => Off => Off
    xdebug.profiler_append => Off => Off
    xdebug.profiler_enable => Off => Off
    xdebug.profiler_enable_trigger => Off => Off
    xdebug.profiler_enable_trigger_value => no value => no value
    xdebug.profiler_output_dir => /tmp => /tmp
    xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
    xdebug.remote_addr_header => no value => no value
    xdebug.remote_autostart => On => On
    xdebug.remote_connect_back => Off => Off
    xdebug.remote_cookie_expire_time => 3600 => 3600
    xdebug.remote_enable => On => On
    xdebug.remote_handler => dbgp => dbgp
    xdebug.remote_host => 127.0.0.1 => 127.0.0.1
    xdebug.remote_log => /tmp/xdebug.log => /tmp/xdebug.log
    xdebug.remote_mode => req => req
    xdebug.remote_port => 9000 => 9000
    xdebug.remote_timeout => 200 => 200
    xdebug.scream => Off => Off
    xdebug.show_error_trace => Off => Off
    xdebug.show_exception_trace => Off => Off
    xdebug.show_local_vars => Off => Off
    xdebug.show_mem_delta => Off => Off
    xdebug.trace_enable_trigger => Off => Off
    xdebug.trace_enable_trigger_value => no value => no value
    xdebug.trace_format => 0 => 0
    xdebug.trace_options => 0 => 0
    xdebug.trace_output_dir => /tmp => /tmp
    xdebug.trace_output_name => trace.%c => trace.%c
    xdebug.var_display_max_children => 128 => 128
    xdebug.var_display_max_data => 512 => 512
    xdebug.var_display_max_depth => 3 => 3
    
    点赞 评论 复制链接分享
  • weixin_39795971 weixin_39795971 5月前

    could you maybe open a new ticket for this, since on windows it will be a lot harder for me to test since I'm hardly ever using windows

    点赞 评论 复制链接分享
  • weixin_39757122 weixin_39757122 5月前

    OK I'll try first to reproduce it on another machine so to understand what is happening and if I have the same problem will open new ticket

    点赞 评论 复制链接分享
  • weixin_39795971 weixin_39795971 5月前

    Thanks that would be great

    点赞 评论 复制链接分享
  • weixin_39795971 weixin_39795971 5月前

    I currently have no MacOS available. Are you running PHP on a linux VM or directly on your Mac?

    点赞 评论 复制链接分享
  • weixin_39534759 weixin_39534759 5月前

    I'm running php in a docker container

    php -v

    
    PHP 7.0.26 (cli) (built: Dec 12 2017 06:45:58) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
        with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
    

    php -i | grep xdebug

    
    /usr/local/etc/php/conf.d/xdebug.ini
    xdebug
    xdebug support => enabled
    xdebug.auto_trace => Off => Off
    xdebug.cli_color => 0 => 0
    xdebug.collect_assignments => Off => Off
    xdebug.collect_includes => On => On
    xdebug.collect_params => 0 => 0
    xdebug.collect_return => Off => Off
    xdebug.collect_vars => Off => Off
    xdebug.coverage_enable => On => On
    xdebug.default_enable => On => On
    xdebug.dump.COOKIE => no value => no value
    xdebug.dump.ENV => no value => no value
    xdebug.dump.FILES => no value => no value
    xdebug.dump.GET => no value => no value
    xdebug.dump.POST => no value => no value
    xdebug.dump.REQUEST => no value => no value
    xdebug.dump.SERVER => no value => no value
    xdebug.dump.SESSION => no value => no value
    xdebug.dump_globals => On => On
    xdebug.dump_once => On => On
    xdebug.dump_undefined => Off => Off
    xdebug.extended_info => On => On
    xdebug.file_link_format => no value => no value
    xdebug.force_display_errors => Off => Off
    xdebug.force_error_reporting => 0 => 0
    xdebug.halt_level => 0 => 0
    xdebug.idekey => no value => no value
    xdebug.max_nesting_level => 256 => 256
    xdebug.max_stack_frames => -1 => -1
    xdebug.overload_var_dump => 2 => 2
    xdebug.profiler_aggregate => Off => Off
    xdebug.profiler_append => Off => Off
    xdebug.profiler_enable => Off => Off
    xdebug.profiler_enable_trigger => Off => Off
    xdebug.profiler_enable_trigger_value => no value => no value
    xdebug.profiler_output_dir => /tmp => /tmp
    xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
    xdebug.remote_addr_header => no value => no value
    xdebug.remote_autostart => Off => Off
    xdebug.remote_connect_back => Off => Off
    xdebug.remote_cookie_expire_time => 3600 => 3600
    xdebug.remote_enable => On => On
    xdebug.remote_handler => dbgp => dbgp
    xdebug.remote_host => 10.0.2.2 => 10.0.2.2
    xdebug.remote_log => /tmp/xdebug.log => /tmp/xdebug.log
    xdebug.remote_mode => req => req
    xdebug.remote_port => 9000 => 9000
    xdebug.scream => Off => Off
    xdebug.show_error_trace => Off => Off
    xdebug.show_exception_trace => Off => Off
    xdebug.show_local_vars => Off => Off
    xdebug.show_mem_delta => Off => Off
    xdebug.trace_enable_trigger => Off => Off
    xdebug.trace_enable_trigger_value => no value => no value
    xdebug.trace_format => 0 => 0
    xdebug.trace_options => 0 => 0
    xdebug.trace_output_dir => /tmp => /tmp
    xdebug.trace_output_name => trace.%c => trace.%c
    xdebug.var_display_max_children => 128 => 128
    xdebug.var_display_max_data => 512 => 512
    xdebug.var_display_max_depth => 3 => 3
    
    点赞 评论 复制链接分享
  • weixin_39534759 weixin_39534759 5月前

    Also relevant: php -i | grep default_charset

    
    default_charset => UTF-8 => UTF-8
    
    点赞 评论 复制链接分享
  • weixin_39795971 weixin_39795971 5月前

    So I'm going to assume you run 'native' docker on mac

    点赞 评论 复制链接分享
  • weixin_39534759 weixin_39534759 5月前

    No, I use docker-machine with virtualbox driver. docker-machine -v:

    
    docker-machine version 0.13.0, build 9ba6da9
    
    点赞 评论 复制链接分享
  • weixin_39795971 weixin_39795971 5月前

    thanks

    点赞 评论 复制链接分享

相关推荐