Skip to content

Bug: unknown method LifecycleOnCreated #1999

Open
conduitio-labs/conduit-connector-elasticsearch
#105
@mm-zacharydavison

Description

@mm-zacharydavison

Bug description

I'm trialling Conduit for our use case of CDCing data from postgres -> elasticsearch.

Using:

I'm noticing this error on start:

ERR node stopped error="node postgres-to-elastic:elastic stopped with error: could not open destination connector: error while triggering lifecycle event \"created\": unknown method LifecycleOnCreated for service connector.v1.DestinationPlugin: method not implemented" component=lifecycle.Service node_id=postgres-to-elastic:elastic stack=[{"file":"/app/pkg/lifecycle/service.go","func":"github.com/conduitio/conduit/pkg/lifecycle.(*Service).runPipeline.func2","line":743},{"file":"/app/pkg/lifecycle/stream/destination.go","func":"github.com/conduitio/conduit/pkg/lifecycle/stream.(*DestinationNode).Run","line":81},{"file":"/app/pkg/connector/destination.go","func":"github.com/conduitio/conduit/pkg/connector.(*Destination).triggerLifecycleEvent","line":330}]

Looking at the code, it does look like the elasticsearch connector is old, and doesn't support the lifecycle methods, but I thought that Conduit was meant to allow backwards compatibility in those cases as per

defer func() {
if cerrors.Is(err, plugin.ErrUnimplemented) {

Steps to reproduce

Environment

Configuration

  • docker-compose.yaml
version: '3.8'

services:
  conduit:
    image: conduit.docker.scarf.sh/conduitio/conduit:latest
    volumes:
      - ./connectors:/app/connectors:rw
      - ./pipelines:/app/pipelines:rw
    network_mode: host

  postgres:
    image: postgres:16
    environment:
      - POSTGRES_DB=mydata
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
    volumes:
      - postgres_data:/var/lib/postgresql/data
      - ./postgresql.conf:/etc/postgresql/postgresql.conf
    command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
    network_mode: host

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.16.1
    environment:
      - discovery.type=single-node
    volumes:
      - elasticsearch_data:/usr/share/elasticsearch/data
    network_mode: host

volumes:
  postgres_data:
  elasticsearch_data:
  • ./pipelines/my-pipeline.yaml
version: "2.2"
pipelines:
  - id: postgres-to-elastic
    status: running
    name: "postgres-to-elastic"
    connectors:
      - id: postgres
        type: source
        plugin: "postgres"
        settings:
          url: 'postgresql://postgres:password@localhost:5432/mydata'
          tables: 'users'
          cdcMode: 'logrepl'
          logrepl.publicationName: 'demo'
          logrepl.slotName: 'demo'
      - id: elastic
        type: destination
        plugin: "standalone:elasticsearch"
        settings:
          version: 8
          host: 'http://localhost:9200'
          index: 'mydata'
          bulkSize: 1000
          retries: 100

Version

v0.12.3 x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions