confluentinc / bottledwater-pg

Change data capture from PostgreSQL into Kafka
http://blog.confluent.io/2015/04/23/bottled-water-real-time-integration-of-postgresql-and-kafka/
Apache License 2.0
2 stars 149 forks source link

Bottledwater build broken #66

Closed Mobe91 closed 8 years ago

Mobe91 commented 8 years ago

When I run make docker-build on docker-machine, the build of bottledwater fails with the following error:

make[1]: Entering directory '/root/bottledwater/client'
gcc -c -std=c99 -D_POSIX_C_SOURCE=200809L -I/usr/include/postgresql -I/usr/include/postgresql/9.4/server -I/usr/local/include  -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security replication.c -o replication.o
In file included from protocol_client.h:4:0,
                 from replication.h:4,
                 from replication.c:5:
protocol.h:1:1: error: expected identifier or ‘(’ before ‘.’ token
 ../ext/protocol.h
 ^
In file included from replication.h:4:0,
                 from replication.c:5:
protocol_client.h:8:37: error: unknown type name ‘uint64_t’
 typedef int (*begin_txn_cb)(void *, uint64_t, uint32_t);
                                     ^
protocol_client.h:8:47: error: unknown type name ‘uint32_t’
 typedef int (*begin_txn_cb)(void *, uint64_t, uint32_t);
                                               ^
protocol_client.h:11:38: error: unknown type name ‘uint64_t’
 typedef int (*commit_txn_cb)(void *, uint64_t, uint32_t);
                                      ^
protocol_client.h:11:48: error: unknown type name ‘uint32_t’
 typedef int (*commit_txn_cb)(void *, uint64_t, uint32_t);
                                                ^
protocol_client.h:16:40: error: unknown type name ‘uint64_t’
 typedef int (*table_schema_cb)(void *, uint64_t, Oid,
                                        ^
protocol_client.h:16:50: error: unknown type name ‘Oid’
 typedef int (*table_schema_cb)(void *, uint64_t, Oid,
                                                  ^
protocol_client.h:17:23: error: unknown type name ‘size_t’
         const char *, size_t, avro_schema_t,
                       ^
protocol_client.h:17:31: error: unknown type name ‘avro_schema_t’
         const char *, size_t, avro_schema_t,
                               ^
protocol_client.h:18:23: error: unknown type name ‘size_t’
         const char *, size_t, avro_schema_t);
                       ^
protocol_client.h:18:31: error: unknown type name ‘avro_schema_t’
         const char *, size_t, avro_schema_t);
                               ^
protocol_client.h:23:38: error: unknown type name ‘uint64_t’
 typedef int (*insert_row_cb)(void *, uint64_t, Oid,
                                      ^
protocol_client.h:23:48: error: unknown type name ‘Oid’
 typedef int (*insert_row_cb)(void *, uint64_t, Oid,
                                                ^
protocol_client.h:24:23: error: unknown type name ‘size_t’
         const void *, size_t, avro_value_t *,
                       ^
protocol_client.h:24:31: error: unknown type name ‘avro_value_t’
         const void *, size_t, avro_value_t *,
                               ^
protocol_client.h:25:23: error: unknown type name ‘size_t’
         const void *, size_t, avro_value_t *);
                       ^
protocol_client.h:25:31: error: unknown type name ‘avro_value_t’
         const void *, size_t, avro_value_t *);
                               ^
protocol_client.h:31:38: error: unknown type name ‘uint64_t’
 typedef int (*update_row_cb)(void *, uint64_t, Oid,
                                      ^
protocol_client.h:31:48: error: unknown type name ‘Oid’
 typedef int (*update_row_cb)(void *, uint64_t, Oid,
                                                ^
protocol_client.h:32:23: error: unknown type name ‘size_t’
         const void *, size_t, avro_value_t *,
                       ^
protocol_client.h:32:31: error: unknown type name ‘avro_value_t’
         const void *, size_t, avro_value_t *,
                               ^
protocol_client.h:33:23: error: unknown type name ‘size_t’
         const void *, size_t, avro_value_t *,
                       ^
protocol_client.h:33:31: error: unknown type name ‘avro_value_t’
         const void *, size_t, avro_value_t *,
                               ^
protocol_client.h:34:23: error: unknown type name ‘size_t’
         const void *, size_t, avro_value_t *);
                       ^
protocol_client.h:34:31: error: unknown type name ‘avro_value_t’
         const void *, size_t, avro_value_t *);
                               ^
protocol_client.h:39:38: error: unknown type name ‘uint64_t’
 typedef int (*delete_row_cb)(void *, uint64_t, Oid,
                                      ^
protocol_client.h:39:48: error: unknown type name ‘Oid’
 typedef int (*delete_row_cb)(void *, uint64_t, Oid,
                                                ^
protocol_client.h:40:23: error: unknown type name ‘size_t’
         const void *, size_t, avro_value_t *,
                       ^
protocol_client.h:40:31: error: unknown type name ‘avro_value_t’
         const void *, size_t, avro_value_t *,
                               ^
protocol_client.h:41:23: error: unknown type name ‘size_t’
         const void *, size_t, avro_value_t *);
                       ^
protocol_client.h:41:31: error: unknown type name ‘avro_value_t’
         const void *, size_t, avro_value_t *);
                               ^
protocol_client.h:45:5: error: unknown type name ‘Oid’
     Oid                 relid;       /* Uniquely identifies a table, even when it is renamed */
     ^
protocol_client.h:46:5: error: unknown type name ‘avro_schema_t’
     avro_schema_t       key_schema;  /* Avro schema for the table's primary key or replica identity */
     ^
protocol_client.h:47:5: error: unknown type name ‘avro_schema_t’
     avro_schema_t       row_schema;  /* Avro schema for one row of the table */
     ^
protocol_client.h:48:5: error: unknown type name ‘avro_value_iface_t’
     avro_value_iface_t *key_iface;   /* Avro generic interface for creating key values */
     ^
protocol_client.h:49:5: error: unknown type name ‘avro_value_iface_t’
     avro_value_iface_t *row_iface;   /* Avro generic interface for creating row values */
     ^
protocol_client.h:50:5: error: unknown type name ‘avro_value_t’
     avro_value_t        key_value;   /* Avro key value, for encoding one key */
     ^
protocol_client.h:51:5: error: unknown type name ‘avro_value_t’
     avro_value_t        row_value;   /* Avro row value, for encoding one row */
     ^
protocol_client.h:52:5: error: unknown type name ‘avro_value_t’
     avro_value_t        old_value;   /* Avro row value, for encoding the old value (in updates, deletes) */
     ^
protocol_client.h:53:5: error: unknown type name ‘avro_reader_t’
     avro_reader_t       avro_reader; /* In-memory buffer reader */
     ^
protocol_client.h:58:5: error: unknown type name ‘begin_txn_cb’
     begin_txn_cb on_begin_txn;       /* Called to indicate that the following events belong to one transaction */
     ^
protocol_client.h:59:5: error: unknown type name ‘commit_txn_cb’
     commit_txn_cb on_commit_txn;     /* Called to indicate the end of events from a particular transaction */
     ^
protocol_client.h:60:5: error: unknown type name ‘table_schema_cb’
     table_schema_cb on_table_schema; /* Called when there is a new schema for a particular relation */
     ^
protocol_client.h:61:5: error: unknown type name ‘insert_row_cb’
     insert_row_cb on_insert_row;     /* Called when a row is inserted into a relation */
     ^
protocol_client.h:62:5: error: unknown type name ‘update_row_cb’
     update_row_cb on_update_row;     /* Called when a row in a relation is updated */
     ^
protocol_client.h:63:5: error: unknown type name ‘delete_row_cb’
     delete_row_cb on_delete_row;     /* Called when a row in a relation is deleted */
     ^
protocol_client.h:67:5: error: unknown type name ‘avro_schema_t’
     avro_schema_t frame_schema;      /* Avro schema of a frame, as defined by the protocol */
     ^
protocol_client.h:68:5: error: unknown type name ‘avro_value_iface_t’
     avro_value_iface_t *frame_iface; /* Avro generic interface for the frame schema */
     ^
protocol_client.h:69:5: error: unknown type name ‘avro_value_t’
     avro_value_t frame_value;        /* Avro value for a frame */
     ^
protocol_client.h:70:5: error: unknown type name ‘avro_reader_t’
     avro_reader_t avro_reader;       /* In-memory buffer reader */
     ^
protocol_client.h:75:40: error: unknown type name ‘uint64_t’
 int parse_frame(frame_reader_t reader, uint64_t wal_pos, char *buf, int buflen);
                                        ^
In file included from replication.h:6:0,
                 from replication.c:5:
/usr/include/postgresql/libpq-fe.h:227:2: error: unknown type name ‘Oid’
  Oid   tableid;  /* source table, if known */
  ^
/usr/include/postgresql/libpq-fe.h:230:2: error: unknown type name ‘Oid’
  Oid   typid;   /* type id */
  ^
/usr/include/postgresql/libpq-fe.h:364:11: error: unknown type name ‘Oid’
     const Oid *paramTypes,
           ^
/usr/include/postgresql/libpq-fe.h:371:11: error: unknown type name ‘Oid’
     const Oid *paramTypes);
           ^
/usr/include/postgresql/libpq-fe.h:385:13: error: unknown type name ‘Oid’
       const Oid *paramTypes,
             ^
/usr/include/postgresql/libpq-fe.h:392:12: error: unknown type name ‘Oid’
      const Oid *paramTypes);
            ^
/usr/include/postgresql/libpq-fe.h:455:8: error: unknown type name ‘Oid’
 extern Oid PQftable(const PGresult *res, int field_num);
        ^
/usr/include/postgresql/libpq-fe.h:458:8: error: unknown type name ‘Oid’
 extern Oid PQftype(const PGresult *res, int field_num);
        ^
/usr/include/postgresql/libpq-fe.h:463:8: error: unknown type name ‘Oid’
 extern Oid PQoidValue(const PGresult *res); /* new and improved */
        ^
/usr/include/postgresql/libpq-fe.h:469:8: error: unknown type name ‘Oid’
 extern Oid PQparamtype(const PGresult *res, int param_num);
        ^
/usr/include/postgresql/libpq-fe.h:542:34: error: unknown type name ‘Oid’
 extern int lo_open(PGconn *conn, Oid lobjId, int mode);
                                  ^
/usr/include/postgresql/libpq-fe.h:548:8: error: unknown type name ‘Oid’
 extern Oid lo_creat(PGconn *conn, int mode);
        ^
/usr/include/postgresql/libpq-fe.h:549:8: error: unknown type name ‘Oid’
 extern Oid lo_create(PGconn *conn, Oid lobjId);
        ^
/usr/include/postgresql/libpq-fe.h:549:36: error: unknown type name ‘Oid’
 extern Oid lo_create(PGconn *conn, Oid lobjId);
                                    ^
/usr/include/postgresql/libpq-fe.h:554:36: error: unknown type name ‘Oid’
 extern int lo_unlink(PGconn *conn, Oid lobjId);
                                    ^
/usr/include/postgresql/libpq-fe.h:555:8: error: unknown type name ‘Oid’
 extern Oid lo_import(PGconn *conn, const char *filename);
        ^
/usr/include/postgresql/libpq-fe.h:556:8: error: unknown type name ‘Oid’
 extern Oid lo_import_with_oid(PGconn *conn, const char *filename, Oid lobjId);
        ^
/usr/include/postgresql/libpq-fe.h:556:67: error: unknown type name ‘Oid’
 extern Oid lo_import_with_oid(PGconn *conn, const char *filename, Oid lobjId);
                                                                   ^
/usr/include/postgresql/libpq-fe.h:557:36: error: unknown type name ‘Oid’
 extern int lo_export(PGconn *conn, Oid lobjId, const char *filename);
                                    ^
In file included from /usr/include/postgresql/9.4/server/postgres_fe.h:25:0,
                 from replication.h:7,
                 from replication.c:5:
/usr/include/postgresql/9.4/server/c.h:344:9: error: unknown type name ‘Oid’
 typedef Oid regproc;
         ^
/usr/include/postgresql/9.4/server/c.h:421:2: error: unknown type name ‘Oid’
  Oid   elemtype;
  ^
/usr/include/postgresql/9.4/server/c.h:432:2: error: unknown type name ‘Oid’
  Oid   elemtype;
  ^
/usr/include/postgresql/9.4/server/c.h:435:2: error: unknown type name ‘Oid’
  Oid   values[1];  /* VARIABLE LENGTH ARRAY */
  ^
replication.c: In function ‘parse_xlogdata_message’:
replication.c:306:5: warning: implicit declaration of function ‘parse_frame’ [-Wimplicit-function-declaration]
     int err = parse_frame(stream->frame_reader, wal_pos, buf + hdrlen, buflen - hdrlen);
     ^
Makefile:31: recipe for target 'replication.o' failed
make[1]: Leaving directory '/root/bottledwater/client'
Makefile:6: recipe for target 'all' failed
make[1]: *** [replication.o] Error 1
make: *** [all] Error 2
The command '/bin/sh -c cd /root/bottledwater &&     make clean && make && make install && cd / &&     tar czf bottledwater-ext.tar.gz usr/lib/postgresql/9.4/lib/bottledwater.so usr/share/postgresql/9.4/extension/bottledwater* &&     cp /root/bottledwater/kafka/bottledwater /root/bottledwater/client/bwtest /usr/local/bin &&     tar czf bottledwater-bin.tar.gz usr/local/bin/bottledwater usr/local/bin/bwtest' returned a non-zero code: 2
Makefile:33: recipe for target 'docker-build' failed
make: *** [docker-build] Error 1
Mobe91 commented 8 years ago

Looks like this is a VirtualBox issue: https://www.virtualbox.org/ticket/14563 Trying updated version

Mobe91 commented 8 years ago

Update to VirtualBox 5.0.16 did the trick. Also be careful to not check out the repository under Windows or OS X into a VirtualBox mounted drive because it messes up the symlinks. Cloning the repo from within the VM worked fine.