# Build Error within aerospike-client-c-src-4.6.8

**URL:** <https://discuss.aerospike.com/t/build-error-within-aerospike-client-c-src-4-6-8/6820>\
**Category:** Node.js Client\
**Created:** [November 13, 2019, 12:40pm UTC](https://discuss.aerospike.com/t/build-error-within-aerospike-client-c-src-4-6-8/6820 "2019-11-13T12:40:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fschaeffler](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/fschaeffler/32/1301_2.png) [@fschaeffler](https://discuss.aerospike.com/u/fschaeffler)\
**Post date:** [November 13, 2019, 12:40pm UTC](https://discuss.aerospike.com/t/build-error-within-aerospike-client-c-src-4-6-8/6820/1 "2019-11-13T12:40:46Z")

</div>

I’m trying to put the Aerospike Node.js client into an alpine Docker container. This needs some building the client-c-src. The actual build process is split up into 3 different stages.

- Stage 1: Build Aerospike C client (this one succeeds)
- Stage 2: Build Aerospike Node.js client (this one fails)
- Stage 3: Aerospike Node.js Runtime (this one is skipped)

FYI: The Dockerfile and the build logs are attached to this post. [docker.tar.gz](https://discuss.aerospike.com/uploads/short-url/aJd1f3NnfeFSuJzPUKGZYx01dyL.gz) (16.9 KB)

Basically the issue is that node-gyp rebuild is failing at some point with the following error message.

```
../src/main/enums/status.cc: In function 'v8::Local<v8::Object> status()':
../src/main/enums/status.cc:90:49: error: 'AEROSPIKE_ERR_LARGE_ITEM_NOT_FOUND' was not declared in this scope
  set(obj, "AEROSPIKE_ERR_LARGE_ITEM_NOT_FOUND", AEROSPIKE_ERR_LARGE_ITEM_NOT_FOUND);
                                                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~../src/main/enums/status.cc:26:92: note: in definition of macro 'set'
 #define set( __obj,__ name, __value)__obj->Set(Nan::New(__name).ToLocalChecked(), Nan::New(__value))
                                                                                            ^ ~~~~~~../src/main/enums/status.cc:90:49: note: suggested alternative: 'AEROSPIKE_ERR_LUA_FILE_NOT_FOUND'
  set(obj, "AEROSPIKE_ERR_LARGE_ITEM_NOT_FOUND", AEROSPIKE_ERR_LARGE_ITEM_NOT_FOUND);
                                                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~../src/main/enums/status.cc:26:92: note: in definition of macro 'set'
 #define set( __obj,__ name, __value)__obj->Set(Nan::New(__name).ToLocalChecked(), Nan::New(__value))
                                                                                            ^ ~~~~~~

```

Has anyone stumbled upon a similar issue and can point me here in the right direction?

---

<div class="post-metadata">

**Author:** ![Jan](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/jan/32/1124_2.png) [@Jan](https://discuss.aerospike.com/u/Jan)\
**Post date:** [November 14, 2019, 6:01pm UTC](https://discuss.aerospike.com/t/build-error-within-aerospike-client-c-src-4-6-8/6820/2 "2019-11-14T18:01:19Z")

</div>

You need to use compatible Node.js & C client versions. The latest released Node.js client v3.13.0 requires C client v4.6.7: [aerospike-client-nodejs/aerospike-client-c.ini at v3.13.0 · aerospike/aerospike-client-nodejs · GitHub](https://github.com/aerospike/aerospike-client-nodejs/blob/v3.13.0/aerospike-client-c.ini)

Only the next Node.js client version (v3.14.0) will be compatible with v4.6.8 of the C client: [Update C client to v4.6.8 by jhecking · Pull Request #321 · aerospike/aerospike-client-nodejs · GitHub](https://github.com/aerospike/aerospike-client-nodejs/pull/321)

---

<div class="post-metadata">

**Author:** ![fschaeffler](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/fschaeffler/32/1301_2.png) [@fschaeffler](https://discuss.aerospike.com/u/fschaeffler)\
**Post date:** [November 27, 2019, 7:29am UTC](https://discuss.aerospike.com/t/build-error-within-aerospike-client-c-src-4-6-8/6820/3 "2019-11-27T07:29:13Z")

</div>

Sorry for the late response. However, thank you so much for the help @Jan. I’ll give it a try with the Node.js client 3.13.0 and the C client with 4.6.7.

---

<div class="post-metadata">

**Author:** ![fschaeffler](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/fschaeffler/32/1301_2.png) [@fschaeffler](https://discuss.aerospike.com/u/fschaeffler)\
**Post date:** [November 27, 2019, 8:31am UTC](https://discuss.aerospike.com/t/build-error-within-aerospike-client-c-src-4-6-8/6820/4 "2019-11-27T08:31:29Z")

</div>

Building the Dockerfile even when the version is set to 4.6.7 seems to fail with my setup. Actually the only thing I wanted to achieve was to base my Dockerfile on **node:10-alpine** and not **node:10-slim**. It seems that I did make it altogether too complicated.

I had a look at closed issues concerning Alpine on the GitHub repository for the Node.js client. Luckily, you were active there, too 🙂

So what’s working perfectly fine for me is your suggestion here [Docker alpine-10 with aerospike not working · Issue #299 · aerospike/aerospike-client-nodejs · GitHub](https://github.com/aerospike/aerospike-client-nodejs/issues/299#issuecomment-496062384).

**Edit:**

The only negative point is now the bit bigger size of all image layers for the created image which is now around 678 MB. For the approach with node:10-slim, I’m at 631 MB. This means I’ll stay with the following Dockerfile for my Node.js 10 with Yarn.

```auto
FROM node:10-slim

RUN apt-get update
RUN apt-get install python make g++ openssl libssl-dev libz-dev -y

RUN npm install -g yarn

WORKDIR /workdir
COPY package.json .
COPY yarn.lock .
COPY tools/preinstall.js tools/preinstall.js

RUN yarn install --production=true --pure-lockfile

COPY . .

EXPOSE 80
HEALTHCHECK CMD curl --fail http://0.0.0.0/ || exit 1

CMD ["yarn", "start"]

```

---

<div class="post-metadata">

**Author:** ![Jan](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/jan/32/1124_2.png) [@Jan](https://discuss.aerospike.com/u/Jan)\
**Post date:** [November 27, 2019, 11:22am UTC](https://discuss.aerospike.com/t/build-error-within-aerospike-client-c-src-4-6-8/6820/5 "2019-11-27T11:22:07Z")

</div>

> [@fschaeffler](#):
>
> So what’s working perfectly fine for me is your suggestion here [Docker alpine-10 with aerospike not working · Issue #299 · aerospike/aerospike-client-nodejs · GitHub](https://github.com/aerospike/aerospike-client-nodejs/issues/299#issuecomment-496062384).
> 
> The only negative point is now the bit bigger size of all image layers for the created image which is now around 678 MB. For the approach with node:10-slim, I’m at 631 MB.

Note that the Dockerfile I had posted in issue #299 on Github is not optimized for image size. For a real production build, you would probably want to remove both the C client repo as well as the whole C/C++ build toolchain again, once the C client SDK and Node.js client were build successfully. That should drastically reduce the final image size.
