Pekka
11/02/2022, 12:43 PMwith prefect.settings.temporary_settings(updates={prefect.settings.PREFECT_API_URL: prefect_api_url}):
block = prefect.filesystems.RemoteFileSystem(basepath=f"s3://{bucket_name}/",
settings={"client_kwargs": {"endpoint_url": endpoint_url}})
block.save("s3-testbucket", overwrite=True)
block.register_type_and_schema()
deployment = prefect.deployments.Deployment.build_from_flow(
flow=prefect_cc.coreflows.flows.mh_fi_etl_flow.the_flow,
name=deployment_name,
storage=block,
work_queue_name=work_queue_name
)
t = deployment.apply()
it's raising
E prefect.exceptions.PrefectHTTPStatusError: Client error '403 Forbidden' for url '<http://localhost:4200/api/block_types/27b5cbc1-88e9-4378-bd82-3adb9125b432>'
E Response: {'detail': 'protected block types cannot be updated.'}
E For more information check: <https://httpstatuses.com/403>
this happens regardless of the block.register_type_and_schema
or not -- I don't know how to debug
-- the offending line is the the line: deployment.apply()
even this breaks
block = prefect.filesystems.RemoteFileSystem.load("s3-testbucket")
# leaving the server running and making sure the block exists
deployment = prefect.deployments.Deployment.build_from_flow(
flow=prefect_cc.coreflows.flows.mh_fi_etl_flow.the_flow,
name=deployment_name,
storage=block,
work_queue_name=work_queue_name
)
t = deployment.apply()
-- both the Block (s3-testbucket
) and the Flow show up but there is no Deployment or Work Queue
INFO: 172.28.0.1:38624 - "PATCH /block_types/6701d78b-8719-4db5-9303-cfd648460183 HTTP/1.1" 403 Forbidden
-- https://docs.prefect.io/api-ref/rest-api/#/Block%20types/update_block_type_block_types__id__patch -- this is not documentedKalise Richmond
11/02/2022, 5:14 PMBianca Hoch
11/02/2022, 5:31 PMPekka
11/03/2022, 10:08 AMBianca Hoch
11/03/2022, 1:56 PM