-
Notifications
You must be signed in to change notification settings - Fork 51
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
Unable to specify multiple backend properties under NodeJS #267
Comments
@genaris @andrewwhitehead --thoughts on this one? |
Does this happen with SQLite or Postgres (or both)? And could you provide a minimal repository with a reproduction? So it's easy to reproduce your issue and debug? |
@TimoGlastra I've only tried this on Postgresql. I don't have a minimal repository but the reproduction steps are trivial. Here is the typescript code which can be used to replicate the error:
When running this typescript program you get inconsistent results. Sometimes you get an SSL connection error (which is expected because the program is not pointing at a real postgresql server) and at other times you get the 'invalid sslmode' error:
This same issue was happening when I used the 'sslmode' and 'sslrootcert' parameters. As soon as I removed the 'sslrootcert' parameter and instead set the root certificate using the PGSSLROOTCERT environment variable everything started working correctly. |
It seems weird to me, since in Credo we are specifying multiple parameters (as seen here) and we aren't experiencing this issue. However, we are not using those particular query parameters. If we do, we arrive at the same problem that you've described. It actually happens also if we put some parameters in the middle of 'sslmode' and 'badoption', like:
The error thrown is the same: "error with configuration: error with configuration: unknown value "verify-fullbadoption=xyz" for It would be good to test this specific configuration with Python wrapper to see if there is something wrong with JS layer or we need to analyze deeper in FFI/Rust/SQLX code. |
import asyncio
from aries_askar import Store, KeyAlg
from aries_askar.bindings import (
generate_raw_key,
)
async def main():
test_store_uri = "postgres://postgres:passw0rd@www.google.com:443/db?sslmode=verify-full&badoption=xyz"
key = generate_raw_key()
try:
store = await Store.open(test_store_uri, "raw", key)
print("Store opened successfully!")
except Exception as e:
print(f"An error occurred while opening the store: {e}")
finally:
if 'store' in locals():
await store.close()
print("Store closed.")
if __name__ == "__main__":
asyncio.run(main()) the output from this code is:
if I remove the code in finally block the error is:
@genaris I guess it's FFI/Rust/SQLX |
When using the NodeJS interface I want to be able to specify multiple parameters to the backend PostgreSQL interface. However, it looks like the '&' character cannot be used to seperate multiple parameters in the uri. For example, if I specify a URI of: 'postgres://postgres:passw0rd@postgres:5432/mydb?sslmode=verify-full&sslrootcert=mycert.pem' it sometimes ignores the parameters altogether and at other times fails with the following error:
The uri always work fine if I only specify a single parameter. However, as soon as I specify more than one parameter (separated by the '&' character) I get some inconsistent behaviour.
Is this a known issue, or am I simply specifying the URL incorrectly?
The text was updated successfully, but these errors were encountered: