Error of Generated Python Source Connector

  • Is this your first time deploying Airbyte?: No
  • OS Version / Instance: CentOS7
  • Memory / Disk: 32Gb / 2 Tb
  • Deployment: Are you using Docker or Kubernetes deployment? Yes
  • Airbyte Version: latest
  • Source name/version: python source
  • Step: The issue is happening during creating the connection or a new source?
  • Description:
    Hi, I got an error when I run python main.py discover using the system generated python source generator. I used to follow the steps in the DOC successfully, but now it suddenly doesn’t work. These are my commands:
    cd airbyte-integrations/connector-templates/generator
    ./generate.sh
    cd …/…/connectors/source-test
    python -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
    python main.py spec
    python main.py check --config secrets/config.json
    python main.py discover --config secrets/config.json
(.venv) [root@cent7 source-test]# python main.py discover --config secrets/config.json
{"type": "LOG", "log": {"level": "FATAL", "message": "1 validation error for AirbyteStream\nsupported_sync_modes\n  field required (type=value_error.missing)\nTraceback (most recent call last):\n  File \"/home/airbyte/airbyte-integrations/connectors/source-test/main.py\", line 13, in <module>\n    launch(source, sys.argv[1:])\n  File \"/home/airbyte/airbyte-integrations/connectors/source-test/.venv/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py\", line 123, in launch\n    for message in source_entrypoint.run(parsed_args):\n  File \"/home/airbyte/airbyte-integrations/connectors/source-test/.venv/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py\", line 108, in run\n    catalog = self.source.discover(self.logger, config)\n  File \"/home/airbyte/airbyte-integrations/connectors/source-test/source_test/source.py\", line 72, in discover\n    streams.append(AirbyteStream(name=stream_name, json_schema=json_schema))\n  File \"pydantic/main.py\", line 341, in pydantic.main.BaseModel.__init__\npydantic.error_wrappers.ValidationError: 1 validation error for AirbyteStream\nsupported_sync_modes\n  field required (type=value_error.missing)"}}
{"type": "TRACE", "trace": {"type": "ERROR", "emitted_at": 1666170866546.541, "error": {"message": "Something went wrong in the connector. See the logs for more details.", "internal_message": "1 validation error for AirbyteStream\nsupported_sync_modes\n  field required (type=value_error.missing)", "stack_trace": "Traceback (most recent call last):\n  File \"/home/airbyte/airbyte-integrations/connectors/source-test/main.py\", line 13, in <module>\n    launch(source, sys.argv[1:])\n  File \"/home/airbyte/airbyte-integrations/connectors/source-test/.venv/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py\", line 123, in launch\n    for message in source_entrypoint.run(parsed_args):\n  File \"/home/airbyte/airbyte-integrations/connectors/source-test/.venv/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py\", line 108, in run\n    catalog = self.source.discover(self.logger, config)\n  File \"/home/airbyte/airbyte-integrations/connectors/source-test/source_test/source.py\", line 72, in discover\n    streams.append(AirbyteStream(name=stream_name, json_schema=json_schema))\n  File \"pydantic/main.py\", line 341, in pydantic.main.BaseModel.__init__\npydantic.error_wrappers.ValidationError: 1 validation error for AirbyteStream\nsupported_sync_modes\n  field required (type=value_error.missing)\n", "failure_type": "system_error"}}}

When I changed the python env to the previous generator, the above commands all succeeded, but after building the docker image, I still have the same problem using the docker command to run.

What am I missing?

Thank you.

Hello there! You are receiving this message because none of your fellow community members has stepped in to respond to your topic post. (If you are a community member and you are reading this response, feel free to jump in if you have the answer!) As a result, the Community Assistance Team has been made aware of this topic and will be investigating and responding as quickly as possible.
Some important considerations that will help your to get your issue solved faster:

  • It is best to use our topic creation template; if you haven’t yet, we recommend posting a followup with the requested information. With that information the team will be able to more quickly search for similar issues with connectors and the platform and troubleshoot more quickly your specific question or problem.
  • Make sure to upload the complete log file; a common investigation roadblock is that sometimes the error for the issue happens well before the problem is surfaced to the user, and so having the tail of the log is less useful than having the whole log to scan through.
  • Be as descriptive and specific as possible; when investigating it is extremely valuable to know what steps were taken to encounter the issue, what version of connector / platform / Java / Python / docker / k8s was used, etc. The more context supplied, the quicker the investigation can start on your topic and the faster we can drive towards an answer.
  • We in the Community Assistance Team are glad you’ve made yourself part of our community, and we’ll do our best to answer your questions and resolve the problems as quickly as possible. Expect to hear from a specific team member as soon as possible.

Thank you for your time and attention.
Best,
The Community Assistance Team

There is no sync field in the default generated Discover() function, I add these fileds and it worked well.

        supported_sync_modes=['full_refresh', 'incremental']
        source_defined_cursor= True
        default_cursor_field=['date']
        streams.append(AirbyteStream(name=stream_name, json_schema=json_schema,supported_sync_modes=supported_sync_modes,source_defined_cursor=source_defined_cursor,default_cursor_field=default_cursor_field))
1 Like

Thanks a lot for the update.

Thanks for your update.