apache / arrow-adbc

Database connectivity API standard and libraries for Apache Arrow
https://arrow.apache.org/adbc/
Apache License 2.0
360 stars 86 forks source link

Error after Rstudio Update "exeecutable file not found in $PATH" #2023

Open andrewtaylor-appfolio opened 1 month ago

andrewtaylor-appfolio commented 1 month ago

What would you like help with?

Hi Team,

I recently updated Rstudio and ever since, I've received 2 errors when trying to run con <- adbc_connection_init(db).I've tried to uninstall and reinstall adbcdrivermanager to no avail. Randomly, I tried an old version of RStudio and it worked for a short amount of time.

Both of the errors have been flavors of the following:

con <- adbc_connection_init(db)
time="2024-07-18T09:39:27-07:00" level=error msg="Authentication FAILED" func=gosnowflake.authenticate file="auth.go:364"
Error in force(code) : 390195 (08004): The provided ID Token is invalid.

then (or sometimes only the following error)

Error in force(code) : 
  IO: exec: "open": executable file not found in $PATH

Additional information:

> R.version
platform       aarch64-apple-darwin20                         
version.string R version 4.3.2 (2023-10-31)
go version
go version go1.21.6 darwin/arm64
which go
/opt/homebrew/bin/go

I suspect its user error of sorts, so any direction here would be helpful.

Thanks in advance!

paleolimbot commented 1 month ago

Thanks for opening!

What does packageVersion("adbcsnowflake") get you? Reinstalling that package might be more helpful than reinstalling the driver manager.

Also, what authentication mechanism are you using?

andrewtaylor-appfolio commented 1 month ago

The package version I'm using is

> packageVersion("adbcsnowflake")
[1] ‘0.9.0.9000’
> pak::pak("apache/arrow-adbc/r/adbcsnowflake")
! Using bundled GitHub PAT. Please add your own PAT using `gitcreds::gitcreds_set()`.
✔ Loading metadata database ... done                                          

→ Will install 1 package.
→ Will download 1 package with unknown size.
+ adbcsnowflake   0.13.0.9000 👷🏼‍♀️🔧 ⬇ (GitHub: 2435619)
ℹ Getting 1 pkg with unknown size
✔ Got adbcsnowflake 0.13.0.9000 (source) (5.57 MB)               
✔ Downloaded 1 package (5.57 MB) in 1.4s                         
ℹ Packaging adbcsnowflake 0.13.0.9000
✔ Packaged adbcsnowflake 0.13.0.9000 (1.3s)                          
ℹ Building adbcsnowflake 0.13.0.9000                                 
✔ Built adbcsnowflake 0.13.0.9000 (35.4s)                            
✔ Installed adbcsnowflake 0.13.0.9000 (github::apache/arrow-adbc@2435619) (70ms)
✔ 1 pkg + 2 deps: kept 1, added 1, dld 1 (NA B) [42.4s]                

After a reinstall the version is updated to the following:

> packageVersion("adbcsnowflake")
[1] ‘0.13.0.9000’

However I still get the following error.

> con <- adbc_connection_init(db)
Error in force(code) : 
  IO: exec: "open": executable file not found in $PATH
paleolimbot commented 1 month ago

Great! Just curious what authentication mechanism you're attempting (I'm wondering if adding some explicit arguments for authentication might be a workaround)

andrewtaylor-appfolio commented 1 month ago

Apologies there - the authentication mechanism is the following: adbc.snowflake.sql.auth_type = 'auth_ext_browser',

andrewtaylor-appfolio commented 1 month ago

FWIW: I've had success going back to Rstudio version RStudio-2023.12.1-402 The newest release 2024.04.2+764 does not work. I do not think it's an large issue. I have a work around for now.

Just incase anyone else runs into this issue in the future, it may be interesting if anything substantial has changed loading PATH across the two versions.

paleolimbot commented 1 month ago

Thanks for the investigation! We'll keep this open to troubleshoot...I am guessing that the Snowflake Go connector uses something like system("open 'http://...'") on MacOS where the PATH of the calling process matters. I have seen some other tools print out the URL to the console for oauth when the built-in launching of the browser fails and maybe that's what we (or the Snowflake Go connector) needs to do here.