Remote gsql client closes my terminal

I have now adapted to use the remote gsql client to interact with the GSQL server. One strange thing is that the client closes my terminal every time a simple error like the one below occurs. Has anyone run into this issue?

921 I@20210127 13:47:06.270 tigergraph|127.0.0.1:33130|00000000018 (CatalogManager.java:633) getCatalog: null
922 I@20210127 13:47:06.270 tigergraph|127.0.0.1:33130|00000000018 (Catalog.java:3813) Semantic Check Fails: The vertex name device is used by another object! Please use a different name.
923 I@20210127 13:47:06.270 tigergraph|127.0.0.1:33130|00000000018 (QueryBlockHandler.java:158) exit on error 0
924 I@20210127 13:47:06.272 tigergraph|127.0.0.1:33130|00000000018 (BaseHandler.java:167) Failed|POST|/gsql/file|text/plain; charset=UTF-8|17ms
925 I@20210127 13:47:06.301 tigergraph|127.0.0.1:33130|00000000018 (BaseHandler.java:133) Received|POST|/gsql/abortclientsession|18
926 I@20210127 13:47:06.302 tigergraph|127.0.0.1:33130|00000000018 (AbortClientSessionHandler.java:34) AbortSession added for session = 00000000018
927 I@20210127 13:47:06.303 tigergraph|127.0.0.1:33130|00000000018 (SessionManager.java:234) Interrupt thread ‘pool-4-thread-16’ in session: 00000000018
928 I@20210127 13:47:06.303 tigergraph|127.0.0.1:33130|00000000018 (BaseHandler.java:167) Failed|POST|/gsql/abortclientsession|text/plain; charset=UTF-8|3ms

can you please provide some additional information : OS , Terminal used , and wether you’re running it from within terminal or as Shell/Bash script
Thanks!

OS: Ubuntu 16.04.5 LTS
Terminal: Tmux
I run it from a shell script (see below)

#!/bin/bash
set -x
set -e
time gsql schema-xgraph.gsql
time gsql load-xgraph.gsql

And I invoke the script using the command below since non-interactive shell doesn’t expand alias.

. run.sh

I see the error , it’s
set -e # Exit on error <> 0
you can remove it or force the terminal to stay opened by changing it “-” by “+”

set +e

1 Like

Thanks @Mohamed_Zrouga. Since I need “set -e”, I made gsql a function in my script instead to work around the limitation that alias doesn’t work in shell scripts.

1 Like

You might want to use SET exit_on_error = FALSE|TRUE in the GSQL scripts to control what should happen in case of GSQL execution error (TRUE is the default). See Session Parameters for more info.