Error during update postgres to apigee 4.16.09

Not applicable

During the update from 4.16.05 to 4.16.09 the following error occurred:

Error in PREIN scriptlet in rpm package apigee-postgresql-9.4.9-0.0.942.noarch
chown: invalid user: `apigee\napigee:apigee'
error: %pre(apigee-postgresql-9.4.9-0.0.942.noarch) scriptlet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping apigee-postgresql-9.4.9-0.0.942

The update of the postgres did not work. Any ideas?

Thank you for answer

0 10 430
10 REPLIES 10

Are you running install as root?

Not applicable

Yes, I did it as user root.

The error says: "chown: invalid user: `apigee\napigee:apigee"

It looks like when providing input parameters to the setup process, you entered apigee, then Return, then apigee:apigee again. It tries to find now user 'apigee\napigee', which of course doesn't not exist on your server.

Not applicable

This is my command:

/opt/apigee/apigee-setup/bin/update.sh -c ps -f /opt/apigee/config

Nothing else ...

It looks like it is an internal problem of the package (Error in PREIN scriptlet in rpm package)

I've looked at the PREIN scriptlet of the .rpm file we are talking about. It is hard to imagine any internal problem for that code.

Can you please check the contents of the

$APIGEE_ROOT/data/apigee_postgresql/pgdata/pg_hba.conf file?

then run following command

bash -x /tmp/check_pg_user.sh

in the pgdata folder

with next 4 lines as a contents of the /tmp/check_pg_user.sh file?

#/bin/bash -x

REPLICATION_STRING=$(cat "pg_hba.conf" | egrep "^host +replication +[[:alnum:]]+ +[0-9\.]+/[0-9]+ +trust$")

PG_USER=$(echo "$REPLICATION_STRING" | awk '{print $3}')

echo"PG_USER:>>$PG_USER<<"

Not applicable

I `ve executed the script and the output is:

[root@apiproxy-t4 pgdata]# bash -x /tmp/check_pg_user.sh
++ cat pg_hba.conf
++ egrep '^host +replication +[[:alnum:]]+ +[0-9\.]+/[0-9]+ +trust$'
+ REPLICATION_STRING='host replication apigee 10.196.70.22/24 trust
host replication apigee 10.196.70.23/24 trust'
++ echo 'host replication apigee 10.196.70.22/24 trust
host replication apigee 10.196.70.23/24 trust'
++ awk '{print $3}'
+ PG_USER='apigee
apigee'
+ echo 'PG_USER:>>apigee
apigee<<'
PG_USER:>>apigee
apigee<<

Ok. that's our problem, as you can see, the element $3 of the REPLICATION_STRING is an apigee+New_Line_char+apigee token.

A PG_USER element is corrupted. If you remove new line character and extra apigee from the file, and leave just a single 'apigee' and re-run the script we should be fine now.

The comments and lines around should give you a clue on how the configuration works.

Not applicable

You are absolut right. But as described in:

http://docs.apigee.com/private-cloud/latest/update-apigee-edge-41609

section: Installing a new Postgres standby node

... two lines with user apigee is correct.

If you're talking about this line:

conf_pg_hba_replication.connection=host replication apigee existing_slave_ip/32 trust\ \nhost replication apigee new_slave_ip/32 trust

ok. I can see the problem now. Even two problems, where one problem cancels another one. The example contains an extra space, "\ ", at the end of the first line that would cause to match only second line. In your case, this important space is missing. this causes two matches and results in awk returning a list of strings of pg_users.

I am not completely sure about an intent of the scriptlet developer, but if you add the space as per example, again, it will work as expected.

Not applicable

That`s it. It works for me. Thank you for your help.