# Keeping cht-couch2pg updated

**URL:** <https://forum.communityhealthtoolkit.org/t/keeping-cht-couch2pg-updated/4617>\
**Category:** Product\
**Created:** [February 3, 2025, 10:33pm UTC](https://forum.communityhealthtoolkit.org/t/keeping-cht-couch2pg-updated/4617 "2025-02-03T22:33:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrjones](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrjones/32/681_2.png) [@mrjones](https://forum.communityhealthtoolkit.org/u/mrjones)\
**Post date:** [February 3, 2025, 10:33pm UTC](https://forum.communityhealthtoolkit.org/t/keeping-cht-couch2pg-updated/4617/1 "2025-02-03T22:33:55Z")

</div>

Hey @andra @diana and @twier - what do you think about keeping the [cht-couch2pg repository](https://github.com/medic/cht-couch2pg) updated? I made a very [small PR](https://github.com/medic/cht-couch2pg/pull/149) to update the readme to use `docker compose` instead of the outdated `docker-compose`.

CI then [failed](https://github.com/medic/cht-couch2pg/actions/runs/13063778276/job/36452372638) because CI itself no longer can work with `docker-compose` (oh, the irony!!):

```shell
Run docker-compose -f docker-compose.test.yml build --build-arg node_version=8 cht-couch2pg
  docker-compose -f docker-compose.test.yml build --build-arg node_version=8 cht-couch2pg
  shell: /usr/bin/bash -e {0}
/home/runner/work/_temp/6f6b08a4-8c91-444e-99a7-de5e01bf8aea.sh: line 1: docker-compose: command not found
Error: Process completed with exit code 127.

```

When I fixed that though it’s brought up another error I [cited in the PR](https://github.com/medic/cht-couch2pg/pull/149#issuecomment-2631595621):

```shell
 Container cht-couch2pg-couch-1 Started
 Container cht-couch2pg-postgres-1 Started
/usr/local/lib/node_modules/grunt-cli/node_modules/v8flags/index.js:84
  var flags = Array.from(process.allowedNodeEnvironmentFlags);
                    ^

TypeError: Cannot convert undefined or null to object
    at Function.from (native)
    at getFlags (/usr/local/lib/node_modules/grunt-cli/node_modules/v8flags/index.js:84:21)
    at /usr/local/lib/node_modules/grunt-cli/node_modules/v8flags/index.js:142:5
    at /usr/local/lib/node_modules/grunt-cli/node_modules/v8flags/index.js:70:14
    at FSReqWrap.oncomplete (fs.js:135:15)
Error: Process completed with exit code 1.

```

Given I’m trying to make a very small change in the docs, and now instead I’m knee deep in refactoring CI, I wanted to check in this was a path we should go down given we marked the repo as [deprecated 5mo ago](https://forum.communityhealthtoolkit.org/t/sunsetting-couch2pg-and-cht-couch2pg/4121)?

My vote is we fix CI and keep it status quo (no new features, but working as is). This is because there’s still a number of CHT Core instances still using this as their main workflow - including just about every Medic hosted CHT instance.

(Posting over here in the forums for maybe little more exposure than just in the CHT couch2pg repo, and trying the whole “community first” approach. Feedback on this approach welcome!)

---

<div class="post-metadata">

**Author:** ![twier](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/twier/32/2856_2.png) [@twier](https://forum.communityhealthtoolkit.org/u/twier)\
**Post date:** [February 4, 2025, 7:05am UTC](https://forum.communityhealthtoolkit.org/t/keeping-cht-couch2pg-updated/4617/2 "2025-02-04T07:05:40Z")

</div>

> My vote is we fix CI and keep it status quo (no new features, but working as is).

I agree

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [February 4, 2025, 7:46am UTC](https://forum.communityhealthtoolkit.org/t/keeping-cht-couch2pg-updated/4617/3 "2025-02-04T07:46:33Z")

</div>

> [@mrjones](#):
>
> My vote is we fix CI and keep it status quo (no new features, but working as is). This is because there’s still a number of CHT Core instances still using this as their main workflow - including just about every Medic hosted CHT instance.

Completely agree with this!

---

<div class="post-metadata">

**Author:** ![mrjones](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrjones/32/681_2.png) [@mrjones](https://forum.communityhealthtoolkit.org/u/mrjones)\
**Post date:** [February 4, 2025, 3:49pm UTC](https://forum.communityhealthtoolkit.org/t/keeping-cht-couch2pg-updated/4617/4 "2025-02-04T15:49:35Z")

</div>

Thanks you two!

As such, I welcome any tips on how to [debug my issue](https://github.com/medic/cht-couch2pg/pull/149#issuecomment-2631595621) 😅

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [February 6, 2025, 7:43am UTC](https://forum.communityhealthtoolkit.org/t/keeping-cht-couch2pg-updated/4617/5 "2025-02-06T07:43:27Z")

</div>

It looks like the `grunt-cli` version that gets installed is not compatible with Node 8 - which is one suite for our e2e tests, it looks like the target node versions are 8, 10 and 12.

The error that you’re seeing is:

```auto
/usr/local/lib/node_modules/grunt-cli/node_modules/v8flags/index.js:84
  var flags = Array.from(process.allowedNodeEnvironmentFlags);
                    ^

TypeError: Cannot convert undefined or null to object
    at Function.from (native)
    at getFlags (/usr/local/lib/node_modules/grunt-cli/node_modules/v8flags/index.js:84:21)
    at /usr/local/lib/node_modules/grunt-cli/node_modules/v8flags/index.js:142:5
    at /usr/local/lib/node_modules/grunt-cli/node_modules/v8flags/index.js:70:14
    at FSReqWrap.oncomplete (fs.js:135:15)

```

And `process.allowedNodeEnvironmentFlags` was only added in Node 10: [Process | Node.js v23.7.0 Documentation](https://nodejs.org/api/process.html#processallowednodeenvironmentflags)

So the `grunt-cli` code is basically doing `Array.from(undefined)` and this fails in any node version (as expected).

It seems that we just install a random version of `grunt-cli` in our docker image: [cht-couch2pg/Dockerfile at main · medic/cht-couch2pg · GitHub](https://github.com/medic/cht-couch2pg/blob/main/Dockerfile#L16) instead of the “locked” one in our package.json, so I’m assuming that at some point, `grunt-cli` became incompatible with Node 8.

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [February 6, 2025, 7:45am UTC](https://forum.communityhealthtoolkit.org/t/keeping-cht-couch2pg-updated/4617/6 "2025-02-06T07:45:32Z")

</div>

The solution can be:

- make sure we use a version of `grunt-cli` that is compatible with Node 8
- drop Node 8 support from cht-couch2pg

Dropping Node 8 support is quite easy and only requires a small change in the CI test runner. Locking to a specific version of grunt needs a bit more effort but is the better long term solution.

---

<div class="post-metadata">

**Author:** ![mrjones](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrjones/32/681_2.png) [@mrjones](https://forum.communityhealthtoolkit.org/u/mrjones)\
**Post date:** [February 6, 2025, 11:50pm UTC](https://forum.communityhealthtoolkit.org/t/keeping-cht-couch2pg-updated/4617/7 "2025-02-06T23:50:38Z")

</div>

awesome! I’ll try and dive into this in the coming few days - thanks for the tips!!

---

<div class="post-metadata">

**Author:** ![mrjones](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrjones/32/681_2.png) [@mrjones](https://forum.communityhealthtoolkit.org/u/mrjones)\
**Post date:** [February 11, 2025, 11:27pm UTC](https://forum.communityhealthtoolkit.org/t/keeping-cht-couch2pg-updated/4617/8 "2025-02-11T23:27:59Z")

</div>

Hello again!

After many hours of trying to get this PR to get CI to a passing state, and after getting some second opinions - I’ve closed [the PR in question](https://github.com/medic/cht-couch2pg/pull/149). It looks like CI hasn’t run in `main` for a release [since 2021](https://github.com/medic/cht-couch2pg/releases/tag/3.3.0) (though I do some passing CI in [Actions tab](https://github.com/medic/cht-couch2pg/actions)) .

Certainly a quick “make `docker-compose` be `docker compose`” is not worth hours I put in!

My vote is that we actually hard archive this so no further changes can be made to double down on the [soft archive we’ve already done](https://github.com/medic/cht-couch2pg/commit/00663eaae9f82b83b4ac4117ca88b941b21bcf3f).

Sorry to re-open this - but what do you think of hard archiving the [cht-couch2pg repo](https://github.com/medic/cht-couch2pg/) @diana and @twier so it is [read only](https://docs.github.com/en/repositories/archiving-a-github-repository/archiving-repositories)?

cc @andra who did the soft archiving.
