https://prefect.io logo
p

Pavel Shiriaev

07/27/2023, 12:38 PM
@Marvin Why I am getting this error:
Copy code
Validation of flow parameters failed with error: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/prefect/engine.py", line 304, in retrieve_flow_then_begin_flow_run
    parameters = flow.validate_parameters(flow_run.parameters)
  File "/usr/local/lib/python3.10/site-packages/prefect/flows.py", line 344, in validate_parameters
    args, kwargs = parameters_to_args_kwargs(self.fn, parameters)
  File "/usr/local/lib/python3.10/site-packages/prefect/utilities/callables.py", line 158, in parameters_to_args_kwargs
    raise SignatureMismatchError.from_bad_params(
prefect.exceptions.SignatureMismatchError: Function expects parameters ['minio_secret_path', 'bucket_name', 'bucket_upload_path', 'dwh_secret_path', 'db_name', 'collection', 'pg_schema', 'target_table', 'postgres_name', 'default_schema', 'username', 'password', 'url', 'port', 'sections_dict', 'dwh_rule', 'api_post'] but was provided with parameters ['minio_secret_path', 'minio_host', 'minio_port', 'bucket_name', 'bucket_upload_path', 'dwh_secret_path', 'db_ip', 'dp_port', 'db_name', 'collection', 'dwh_rule', 'api_post']
First run was ok. But after several hours passed, crontab started new flow all mentioned parameters disappeared some how. What is wrong?
m

Marvin

07/27/2023, 12:39 PM
Ah, the joys of programming. One moment everything is running smoothly, the next moment, it's as if the universe decided to play a cruel joke on you. From the error message you've provided, it seems like your function is expecting certain parameters that are not being provided. Specifically, it's looking for parameters like
'pg_schema'
,
'target_table'
,
'postgres_name'
,
'default_schema'
,
'username'
,
'password'
,
'url'
,
'port'
,
'sections_dict'
, and a few others. However, these are not included in the parameters that are being provided. The parameters that are being provided are
'minio_secret_path'
,
'minio_host'
,
'minio_port'
,
'bucket_name'
,
'bucket_upload_path'
,
'dwh_secret_path'
,
'db_ip'
,
'dp_port'
,
'db_name'
,
'collection'
,
'dwh_rule'
, and
'api_post'
. It's quite puzzling that it worked fine initially but then started failing. It's possible that something changed in the environment or the state of your application that is causing this discrepancy. You might want to check the following: 1. Did anything change in your code or environment that might have removed or renamed these parameters? 2. Are these parameters being set or passed correctly each time the flow is run? 3. Is there any chance that these parameters are being overwritten or removed somewhere in your application? Remember, the universe isn't against you. It's just indifferent. Keep on debugging, you'll figure it out.
p

Pavel Shiriaev

07/27/2023, 12:42 PM
@Marvin I do not use these parameters:
'pg_schema'
,
'target_table'
,
'postgres_name'
,
'default_schema'
,
'username'
,
'password'
,
'url'
,
'port'
,
'sections_dict'
in my deploy and flow. Prefect itself decided to add them to the list of required parameters. Why could this happen?
m

Marvin

07/27/2023, 12:46 PM
Ah, the mysteries of the universe and software. It seems like Prefect has somehow decided that these parameters are required for your flow. This could be due to a number of reasons. One possibility is that Prefect is picking up these parameters from somewhere else in your code or environment. For example, if you have another flow or task that uses these parameters, Prefect might be getting confused and thinking that they're required for this flow as well. Another possibility is that there's some kind of bug or issue with Prefect itself. This could be a bug in the version of Prefect you're using, or it could be a problem with how Prefect is interacting with your specific environment or code. Here are a few things you could try: 1. Double-check your code and environment to make sure these parameters aren't being used somewhere else. 2. Try updating to the latest version of Prefect, if you're not already using it. 3. If all else fails, you might want to reach out to the Prefect community or support for help. They might be able to provide more insight into what's going on. Remember, even the most advanced AI (like me) can't solve every problem. But don't worry, I'm sure you'll figure this out. After all, you're a human, and humans are quite good at solving problems (when they're not busy creating them).