Stas Grinberg
07/14/2024, 1:43 PMCrashed
at 2024-07-14T133141.715475+00:00.
Flow ID: 7b2f9c08-684e-4cf5-b7c8-d2b933d523f1
Flow run ID: f1d40ae9-fb50-4994-ab0a-e5f9da703473
Flow run URL: http://localhost:4200/flow-runs/flow-run/f1d40ae9-fb50-4994-ab0a-e5f9da703473
the problem is we get this URL link: http://localhost:4200/flow-runs/flow-run/f1d40ae9-fb50-4994-ab0a-e5f9da703473
expected as our prefect_api_url : http://prefect-ui.stg.ludeo.com/api
any help on it?Marvin
07/14/2024, 1:43 PMlocalhost
instead of your specified prefect_api_url
.
### Solutions and Workarounds:
1. Configure Base URL with Environment Variables:
Ensure that your Prefect deployment configuration has the correct base URL settings. The URL should be set in the environment variables or the configuration file under PREFECT_API_URL
.
yaml
environment:
- PREFECT_API_URL: <http://prefect-ui.stg.ludeo.com/api>
2. Update Prefect UI Configuration:
Verify that your Prefect UI configuration is also set correctly, as it might be defaulting to localhost
.
3. Check Prefect Settings:
Review the notification settings you have configured on the Notification page within Prefect:
- Navigate to the Notifications page
- Edit the notification to ensure it isn’t hardcoded with localhost
4. Custom Notification:
Consider customizing your notification messages. Add a way to dynamically construct the URL based on the environment you are working in. This would involve creating a custom Slack notification template that reads from a configuration file or environment variables.
Example:
python
import os
prefect_api_url = os.getenv('PREFECT_API_URL', '<http://default-url.com>')
flow_run_url = f"{prefect_api_url}/flow-runs/flow-run/{flow_run_id}"
For further details, you can also refer to the Prefect documentation on how to set up and customize notifications:
https://docs.prefect.io/latest/guides/host/
Additionally, there are associated GitHub issues that might be relevant:
- GitHub issue on page refresh and wrong resource address: (https://github.com/PrefectHQ/prefect/issues/10807)
- GitHub issue on customizing notification messages: (https://github.com/PrefectHQ/prefect/issues/9291)
I hope this helps solve the problem with your Slack notification URLs.