dbext hangs with sqlplus connection

31 views
Skip to first unread message

Dan Wierenga

unread,
Aug 4, 2017, 3:50:57 PM8/4/17
to vim_use
Hi,

I'm using the dbext plugin, and trying to get the results from an Oracle query.   However, dbext never returns a result.  The async job just runs forever (hangs?), and without any output.

If I set 
:DBSetOption display_cmd_line=1, 
and then copy the sqlplus command line to a shell prompt and execute it, it returns immediately with the results I expect, so I know I have all of my connection parameters correct, and the SQL file is syntactically valid. sqlplus exits with a return code of 0. 


On dbext version 25,  I get a line like:
dbext job status:run running time(ms):34000 DBJobStop to cancel

but it never completes, and the Result buffer never gets my results, it only has a line like (actual details redacted, but correct from my perspective):
Connection: T(ORA)  S(hostname:port/SID)  U(user)   at 12:17

I have to run DBJobStop every time.

On dbext version 25 if I set:
let g:dbext_default_use_jobs=0

then I get this error:

Error detected while processing function dbext#DB_execRangeSql[14]..dbext#DB_execSql[33]..dbext#DB_execFuncTypeWCheck[37]..<SNR>60_DB_ORA_execSql[33]..<SNR>60_DB_runCmd:
line   24:
E484: Can't open file /var/folders/lr/9cq0d96j3csbn8v66ppx_2fhg15kw1/T/vSz8MBg/2


I get the same error on version 24.

I've tried setting $TMPDIR to just plain 'tmp' and it results in the same error with a path in /tmp.  Copying the command line to a new shell and executing it once again works flawlessly.

Any tips on how to diagnose this?  I'm on MacOS Sierra using MacVim, although I get the same results from the command line vim from homebrew as well.   I'd like to get this solved using sqlplus and not DBI, as my perl installations are a mess - bash thinks it's using perl 5.18, brew vim is compiled with perl 5.26, and MacVim is compiled with perl 5.16.  I'd prefer to not have to sort that out with regards to DBI and DBD::Oracle.

brew vim is version 8.0.666
MacVim is 8.0.771

Thanks,
Dan

David Fishburn

unread,
Aug 4, 2017, 5:33:49 PM8/4/17
to vim_use
On Fri, Aug 4, 2017 at 3:50 PM, Dan Wierenga <dwie...@gmail.com> wrote:
Hi,

I'm using the dbext plugin, and trying to get the results from an Oracle query.   However, dbext never returns a result.  The async job just runs forever (hangs?), and without any output.



Hmm, I am seeing this periodically as well.  Will have to debug more on this.  First time with the async jobs.


On dbext version 25 if I set:
let g:dbext_default_use_jobs=0

I would leave that at zero, until I get a chance to find the async issue.

 
If I set 
:DBSetOption display_cmd_line=1, 
and then copy the sqlplus command line to a shell prompt and execute it, it returns immediately with the results I expect, so I know I have all of my connection parameters correct, and the SQL file is syntactically valid. sqlplus exits with a return code of 0. 


Error detected while processing function dbext#DB_execRangeSql[14]..dbext#DB_execSql[33]..dbext#DB_execFuncTypeWCheck[37]..<SNR>60_DB_ORA_execSql[33]..<SNR>60_DB_runCmd:
line   24:
E484: Can't open file /var/folders/lr/9cq0d96j3csbn8v66ppx_2fhg15kw1/T/vSz8MBg/2


When you show the display_cmd_line=1 and the error show above, can you paste what the command line was to compare the output.

Thanks,
David


Dan Wierenga

unread,
Aug 4, 2017, 6:34:01 PM8/4/17
to vim...@googlegroups.com
On Fri, Aug 4, 2017 at 2:33 PM, David Fishburn <dfishb...@gmail.com> wrote:


On dbext version 25 if I set:
let g:dbext_default_use_jobs=0

I would leave that at zero, until I get a chance to find the async issue.


Ok, will do.

 
When you show the display_cmd_line=1 and the error show above, can you paste what the command line was to compare the output.


Here, $TMPDIR was set to '/Users/dwierenga/vimtemp'  just to make sure there weren't any weird MacOS permission problems with special system folders.   It's purposefully in my home directory and mode 755.

For this error:

Error detected while processing function dbext#DB_execRangeSql[14]..dbext#DB_execSql[33]..dbext#DB_execFuncTypeWCheck[37]..<SNR>55_DB_ORA_execSql[32]..<SNR>55_DB_runCmdJobSupport[7]..<SNR>55_DB_runCmd:
line   24:
E484: Can't open file /Users/dwierenga/vimtemp/vf1hRyr/1

The actual command was (connection info redacted of course):
/Users/dwierenga/oracle/instantclient_12_1/sqlplus -S "username/password@hostname:port/SID" @/Users/dwierenga/vimtemp/vf1hRyr/dbext.sql

It looks like dbext thinks there's a file named "1" in that directory, but that directory only has dbext.sql inside it. 

Thanks for looking into this! 
 

Dan Wierenga

unread,
Aug 11, 2017, 1:20:17 PM8/11/17
to vim...@googlegroups.com
On Fri, Aug 4, 2017 at 3:33 PM, Dan Wierenga <dwie...@gmail.com> wrote:

It looks like dbext thinks there's a file named "1" in that directory, but that directory only has dbext.sql inside it. 

Any update on this?

David Fishburn

unread,
Aug 11, 2017, 2:11:54 PM8/11/17
to vim_use



On Fri, Aug 11, 2017 at 1:20 PM, Dan Wierenga <dwie...@gmail.com> wrote:

Any update on this?



Hey Dan.

I have been working away at improving the async job support.

I think I have made some good headway.  Would you be willing to try a pre-release and do some testing for me.  I will email you privately with a beta version.

Thanks,
David

Dan Wierenga

unread,
Aug 11, 2017, 2:34:34 PM8/11/17
to vim...@googlegroups.com
On Fri, Aug 11, 2017 at 11:11 AM, David Fishburn <dfishb...@gmail.com> wrote:
Hey Dan.

I have been working away at improving the async job support.

I think I have made some good headway.  Would you be willing to try a pre-release and do some testing for me.  I will email you privately with a beta version.

Thanks,
David

Sure thing, it would be my pleasure. 

Reply all
Reply to author
Forward
0 new messages