Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
richb-hanover opened this issue May 29, 2024 · 8 comments
Closed

Comments

@richb-hanover
Copy link
Contributor

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:

  • I opened a SQLite database, made a new query and used Cmd-E to execute select * from ScrapedData and the result pane shows the expected results, and the Console shows the correct number of rows.

  • prqlc seems to be on the path: echo 'from employees | filter has_dog | select salary' | prqlc compile displays the expected SQL commands.

  • I opened a new query, and typed a short PRQL query and saved it as junk.prql. That worked fine.

  • When I used Query -> Query Current Statement, I get the Problem sending query... message

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
Copy link
Collaborator

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
Copy link
Collaborator

Display any PRQL errors:
image

@ryanhamilton
Copy link
Collaborator

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
Copy link
Collaborator

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

@richb-hanover
Copy link
Contributor Author

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:

  • Download from site to get qstudio(2).jar in Downloads
  • Double-click it. Mac says no - unknown developer.
  • Open System Preferences, Security, click Open Anyway
  • Double-click qstudio(2).jar again. Get another security prompt, click Open
  • qStudio 3.03 opens as expected.

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

@ryanhamilton
Copy link
Collaborator

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
Copy link
Contributor Author

richb-hanover commented May 31, 2024

@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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants