Hello! I'm trying to run the sqlalchemy connector ...
# ask-community
j
Hello! I'm trying to run the sqlalchemy connector script
Copy code
from prefect_sqlalchemy import SqlAlchemyConnector, ConnectionComponents, SyncDriver
from prefect.blocks.system import Secret

connector = SqlAlchemyConnector(
    connection_info=ConnectionComponents(
        driver=SyncDriver.POSTGRESQL_PSYCOPG2,
        username="prefect",
        password=Secret.load("tradesys-db-password").get(),
        host="<http://xxx.xxx.xxx.xxx|xxx.xxx.xxx.xxx>",
        port=5432,
        database="prefect",
    )
)

connector.save("tradesys-db-connector")
and saving my connector keeps getting a 403 error. I am self hosted with prefect running in a docker on my server, and I am running this script from my laptop. Secrect.load() seems to be working, and I have been using my server with other scripts, so seems to just be an issue with this
Copy code
prefect.exceptions.PrefectHTTPStatusError: Client error '403 Forbidden' for url '<http://xxx.xxx.xxx.xxx:4200/api/block_types/>'
Response: {'detail': 'Missing CSRF token.'}
1
Prefect 2.16.6 and 2.16.4, not compatible. Upgrading to 2.16.6 on my laptop fixed it
🙌 1