You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/04/20 18:09:12 UTC
[GitHub] [couchdb] jefferbrecht opened a new issue, #4001: Installation fails on Ubuntu 20.04 as of couchdb-3.2.2
jefferbrecht opened a new issue, #4001:
URL: https://github.com/apache/couchdb/issues/4001
[NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ )
## Description
I get this error when installing couchdb 3.2.2 on Ubuntu 20.04:
```
$ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y couchdb
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libpolkit-gobject-1-0
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libmozjs-68-0
The following NEW packages will be installed:
couchdb libmozjs-68-0
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 30.6 MB of archives.
After this operation, 62.2 MB of additional disk space will be used.
Get:1 http://us-central1.gce.archive.ubuntu.com/ubuntu focal/main amd64 libmozjs-68-0 amd64 68.6.0-1ubuntu1 [3201 kB]
Get:2 https://apache.jfrog.io/artifactory/couchdb-deb focal/main amd64 couchdb amd64 3.2.2~focal [27.4 MB]
Fetched 30.6 MB in 2s (14.2 MB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libmozjs-68-0:amd64.
(Reading database ... 46447 files and directories currently installed.)
Preparing to unpack .../libmozjs-68-0_68.6.0-1ubuntu1_amd64.deb ...
Unpacking libmozjs-68-0:amd64 (68.6.0-1ubuntu1) ...
Selecting previously unselected package couchdb.
Preparing to unpack .../couchdb_3.2.2~focal_amd64.deb ...
Unpacking couchdb (3.2.2~focal) ...
Setting up libmozjs-68-0:amd64 (68.6.0-1ubuntu1) ...
Setting up couchdb (3.2.2~focal) ...
dpkg: error processing package couchdb (--configure):
installed couchdb package post-installation script subprocess returned error exit status 30
Processing triggers for systemd (245.4-4ubuntu3.16) ...
Processing triggers for libc-bin (2.31-0ubuntu9.7) ...
Errors were encountered while processing:
couchdb
E: Sub-process /usr/bin/dpkg returned an error code (1)
```
## Steps to Reproduce
1. Follow the installation steps from https://docs.couchdb.org/en/stable/install/unix.html:
```
sudo apt update && sudo apt install -y curl apt-transport-https gnupg
curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg
>/dev/null 2>&1
source /etc/os-release
echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/
${VERSION_CODENAME} main" \
| sudo tee /etc/apt/sources.list.d/couchdb.list >/dev/null
sudo apt update
sudo apt install -y couchdb
```
## Expected Behaviour
Installation should complete successfully.
## Your Environment
* CouchDB version used: 3.2.2
* Browser name and version: N/A
* Operating system and version: Ubuntu 20.04 (running on Google Cloud Compute Engine, specifically the image being used is `ubuntu-minimal-2004-focal-v20220419a`)
The VM environment is completely "vanilla": the error is reproducible immediately after booting up a fresh Ubuntu 20.04 instance on Google Cloud Compute Engine.
## Additional Context
This was working fine for couchdb 3.2.1.
In my debugging I believe I've isolated the failure to the `exec /usr/share/debconf/frontend /var/lib/dpkg/info/couchdb.postinst configure` command, but I'm not sure how to proceed:
```
$ sudo DEBIAN_FRONTEND=noninteractive DEBCONF_DEBUG=developer /usr/share/debconf/frontend /var/lib/dpkg/info/couchdb.postinst configure
debconf (developer): frontend started
debconf (developer): frontend running, package name is couchdb
debconf (developer): starting /var/lib/dpkg/info/couchdb.config configure
debconf (developer): <-- SET couchdb/cookie
debconf (developer): --> 0 value set
debconf (developer): <-- INPUT high couchdb/mode
debconf (developer): --> 30 question skipped
debconf (developer): <-- GO
debconf (developer): --> 0 ok
debconf (developer): <-- GET couchdb/mode
debconf (developer): --> 0 standalone
debconf (developer): <-- FSET couchdb/nodename seen false
debconf (developer): --> 0 false
debconf (developer): <-- INPUT high couchdb/cookie
debconf (developer): --> 30 question skipped
debconf (developer): <-- GO
debconf (developer): --> 0 ok
debconf (developer): <-- GET couchdb/cookie
debconf (developer): --> 0
debconf (developer): <-- INPUT critical couchdb/no_cookie
debconf (developer): --> 30 question skipped
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on issue #4001: Installation fails on Ubuntu 20.04 as of couchdb-3.2.2
Posted by GitBox <gi...@apache.org>.
rnewson commented on issue #4001:
URL: https://github.com/apache/couchdb/issues/4001#issuecomment-1104403418
I think this is the fix;
```
diff --git a/debian/couchdb.config b/debian/couchdb.config
index df9518c..e21d9e7 100755
--- a/debian/couchdb.config
+++ b/debian/couchdb.config
@@ -84,7 +84,9 @@ promptcookie() {
if [ -e /opt/couchdb/etc/vm.args ] ; then
cookie="$(grep '^-setcookie' /opt/couchdb/etc/vm.args | cut -d ' ' -f 2 | stripwhitespace)"
nodename="$(grep '^-name' /opt/couchdb/etc/vm.args | cut -d ' ' -f 2 | stripwhitespace)"
- db_set couchdb/cookie "${cookie}"
+ if [ -n "$cookie" ]; then
+ db_set couchdb/cookie "${cookie}"
+ fi
if [ "${nodename}" != "couchdb@127.0.0.1" ]; then
db_set couchdb/nodename "${nodename}"
fi
```
What's happening is the couchdb.config forcibly sets couchdb/cookie to the empty string (because it's now empty in the original vm.args file), so even if you set it with debconf, it won't help.
My change above guards against setting the debconf variable if there is no existing value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] nickva commented on issue #4001: Installation fails on Ubuntu 20.04 as of couchdb-3.2.2
Posted by GitBox <gi...@apache.org>.
nickva commented on issue #4001:
URL: https://github.com/apache/couchdb/issues/4001#issuecomment-1104720084
I updated the deb packages with a new version 3.2.2-1 with @rnewson's fix
We should update the docs to indicate that `DEBIAN_FRONTEND=noninteractive ...` only would fail and needs the additional template setup.
Here is how I tested:
```
# COUCHDB_PASSWORD=password
# COUCHDB_COOKIE=$(openssl rand -hex 32)
# echo "couchdb couchdb/mode select standalone
couchdb couchdb/mode seen true
couchdb couchdb/bindaddress string 127.0.0.1
couchdb couchdb/bindaddress seen true
couchdb couchdb/cookie string ${COUCHDB_COOKIE}
couchdb couchdb/cookie seen true
couchdb couchdb/adminpass password ${COUCHDB_PASSWORD}
couchdb couchdb/adminpass seen true
couchdb couchdb/adminpass_again password ${COUCHDB_PASSWORD}
couchdb couchdb/adminpass_again seen true" | debconf-set-selections
# DEBIAN_FRONTEND=noninteractive dpkg -i couchdb_3.2.2-1~bullseye_amd64.deb
(Reading database ... 146938 files and directories currently installed.)
Preparing to unpack couchdb_3.2.2-1~bullseye_amd64.deb ...
Unpacking couchdb (3.2.2-1~bullseye) over (3.2.2~bullseye) ...
Setting up couchdb (3.2.2-1~bullseye) ...
Created symlink /etc/systemd/system/multi-user.target.wants/couchdb.service → /lib/systemd/system/couchdb.service.
Processing triggers for man-db (2.9.4-2) ...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] jefferbrecht commented on issue #4001: Installation fails on Ubuntu 20.04 as of couchdb-3.2.2
Posted by GitBox <gi...@apache.org>.
jefferbrecht commented on issue #4001:
URL: https://github.com/apache/couchdb/issues/4001#issuecomment-1105313994
I can confirm that 3.2.2-1 resolves this issue. Thanks for the quick turnaround!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on issue #4001: Installation fails on Ubuntu 20.04 as of couchdb-3.2.2
Posted by GitBox <gi...@apache.org>.
rnewson commented on issue #4001:
URL: https://github.com/apache/couchdb/issues/4001#issuecomment-1104404530
the preseed instructions are at https://github.com/apache/couchdb-pkg/blob/main/debian/README.Debian, though you will need the two lines from 'clustered' for couchdb/cookie even when doing the standalone install, but only once my bug fix is applied. Trying to get this tested locally first and then get a new build out. sorry for the fuss.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on issue #4001: Installation fails on Ubuntu 20.04 as of couchdb-3.2.2
Posted by GitBox <gi...@apache.org>.
rnewson commented on issue #4001:
URL: https://github.com/apache/couchdb/issues/4001#issuecomment-1104405253
and your workaround is good too! and remember to choose a big and random value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on issue #4001: Installation fails on Ubuntu 20.04 as of couchdb-3.2.2
Posted by GitBox <gi...@apache.org>.
rnewson commented on issue #4001:
URL: https://github.com/apache/couchdb/issues/4001#issuecomment-1104330144
hi, we're fixing a security issue here so if at all possible please try to get 3.2.2 installed. you need to specify a value for couchdb/cookie. It should be possible to preseed it with debconf-set-selections. I'm trying it locally, unfortunately without success, so there might be a new package for 3.2.2 in the very near future.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on issue #4001: Installation fails on Ubuntu 20.04 as of couchdb-3.2.2
Posted by GitBox <gi...@apache.org>.
rnewson commented on issue #4001:
URL: https://github.com/apache/couchdb/issues/4001#issuecomment-1104387152
figured it out. will post a fix soon.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] jefferbrecht closed issue #4001: Installation fails on Ubuntu 20.04 as of couchdb-3.2.2
Posted by GitBox <gi...@apache.org>.
jefferbrecht closed issue #4001: Installation fails on Ubuntu 20.04 as of couchdb-3.2.2
URL: https://github.com/apache/couchdb/issues/4001
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] jefferbrecht commented on issue #4001: Installation fails on Ubuntu 20.04 as of couchdb-3.2.2
Posted by GitBox <gi...@apache.org>.
jefferbrecht commented on issue #4001:
URL: https://github.com/apache/couchdb/issues/4001#issuecomment-1104396938
Thanks! I just found a workaround at the same time you commented, which is to change this line in `/opt/couchdb/etc/vm.args`:
```
# -setcookie
```
to
```
-setcookie somestring
```
I wasn't able to get `debconf-set-selections` to work either; it looked like the DEBIAN/config script in the package was always overwriting any preseeded values as long as that blank commented line existed in that file:
```bash
if [ -e /opt/couchdb/etc/vm.args ] ; then
cookie="$(grep '^-setcookie' /opt/couchdb/etc/vm.args | cut -d ' ' -f 2 | stripwhitespace)"
nodename="$(grep '^-name' /opt/couchdb/etc/vm.args | cut -d ' ' -f 2 | stripwhitespace)"
db_set couchdb/cookie "${cookie}" # <-- ${cookie} is blank here
if [ "${nodename}" != "couchdb@127.0.0.1" ]; then
db_set couchdb/nodename "${nodename}"
fi
fi
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org