timeseries / qstudio

qStudio - Free SQL Analysis Tool
https://www.timestored.com/qstudio/
Apache License 2.0
416 stars 17 forks source link

qStudio 3.0.2 on macOS gives "Problem sending query to server" #44

Closed richb-hanover closed 1 month ago

richb-hanover commented 1 month ago

I'm using qStudio PRO 3.0.2 and Java 16.0.1 on macOS 12.7.5. I have prqlc 0.11.3 installed in /usr/local/bin/prqlc which is on my path. When I attempt to run a PRQL query, I see an error message "Problem sending query to server".

Some things are working:

What other troubleshooting information could I provide? Many thanks for this cool project!

√ ~ % java --version
java 16.0.1 2021-04-20
Java(TM) SE Runtime Environment (build 16.0.1+9-24)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)

√ ~ % which prqlc
/usr/local/bin/prqlc

√ ~ % prqlc --version
prqlc 0.11.3

 ~ % echo $PATH
/Users/richb/.local/bin:/Applications/Tools-Developer/Racket:/Users/richb/.pyenv/shims:/Users/richb/.pyenv/bin:/Users/richb/.deno/bin:/Users/richb/.pyenv/bin:/Users/richb/.nvm/versions/node/v20.9.0/bin:/Users/richb/.cargo/bin:/opt/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/usr/libexec:/Applications/Tools-Developer/Racket/bin:/Users/richb/.rvm/bin

√ ~ % echo 'from employees | filter has_dog | select salary' | prqlc compile
SELECT
  salary
FROM
  employees
WHERE
  has_dog

-- Generated by PRQL compiler version:0.11.3 (https://prql-lang.org)
ryanhamilton commented 1 month ago

Thanks Rich this is an excellent bug report. (Terrible bug!)

I've going to add better error reporting (image below) and investigate mac now.

image

ryanhamilton commented 1 month ago

Display any PRQL errors: image

ryanhamilton commented 1 month ago

Found the bug. I wasn't waiting for the process to finish. Turns out this is fine on windows but not mac. process.waitfor(). Now to check all my other code like that :)

image

ryanhamilton commented 1 month ago

Released fix in 3.03: https://www.timestored.com/qstudio/download @richb-hanover Please confirm it works for you

richb-hanover commented 1 month ago

Thanks for the speedy turnaround. Using 3.03, I get this message:

java.io.IOException: Cannot run program "prqlc": error=2, No such file or directory

image

FYI: I don't know if it matters, but I used this procedure to download and run 3.03:

PS I like that you remember the previous set of servers/open files/etc. I can just pick up where I left off...

ryanhamilton commented 1 month ago

That procedure looks correct, though I will need to look into making it nicer. Thanks for letting me know.

That error seems to suggest prqlc is not on your path. It looks the same as the error I had when I purposefully renamed prqlc. Can you try launching qstudio from the terminal:

  1. Go to the directory with qstudio.jar
  2. Run "prqlc" to make sure it's available.
  3. Then run "java -jar qstudio.jar". This should mean it gets launched with the same PATH settings.

If this fails let's either have a zoom call when suits you OR I will add PATH logging to the log output.

richb-hanover commented 1 month ago

@ryanhamilton Good news. Your hint suggesting run -jar qstudio.jar seems to have broken things free. (It also gives a bunch of debugging info. GREAT!) Things are working after I tweaked/adjusted a ton of things.

I am closing this report, and will write up another set of other observations/questions. THANK YOU!

ryanhamilton commented 1 month ago

Brilliant, glad it worked! Though I'm going to look at improving the mac experience soon.