Re: pg_upgrade failing with error pg_resetxlog no such file

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Debraj Manna <subharaj(dot)manna(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_upgrade failing with error pg_resetxlog no such file
Date: 2018-08-14 20:24:03
Message-ID: 20180814202403.GB3447@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Aug 15, 2018 at 12:20:27AM +0530, Debraj Manna wrote:
> Hi
>
> I am trying to upgrade to postgres 10 from postgres 9.5.4. But on trying to run
> pg_upgrade I am getting the below error
>
> ubuntu(at)vrni-platform:/tmp$ sudo -H -u postgres /usr/lib/postgresql/10/bin/
> pg_upgrade -b /usr/lib/postgresql/9.5/bin -B /usr/lib/postgresql/10/bin -d /var
> /lib/postgresql/data/postgresql0 -D /var/lib/postgresql/10/data/postgresql0 -o
> ' -c config_file=/etc/postgresql/9.5/main/postgresql.conf' -O ' -c config_file=
> /etc/postgresql/10/main/postgresql.conf' --check -k
>
> check for "/usr/lib/postgresql/10/bin/pg_resetxlog" failed: No such file or
> directory
> Failure, exiting
>
> Can someone let me know what is going wrong and how can I use the pg_upgrade?

Uh, that is an unusual error. What PG 10 version is that, exactly?
10.4? 10.5? We added new code to test for proper server shutdown in PG
10.5, but that used pg_controldata, so I don't think that is the cause.

I think the problem is suggested in this part of the code:

/* pg_resetxlog has been renamed to pg_resetwal in version 10 */
if (GET_MAJOR_VERSION(cluster->bin_version) < 1000)
validate_exec(cluster->bindir, "pg_resetxlog");
else
validate_exec(cluster->bindir, "pg_resetwal");

It should be looking for /usr/lib/postgresql/10/bin/pg_resetwal
---
which I bet does exist. I have no idea why this would be testing for
pg_resetxlog in a path that expect PG 10. Maybe some of the directories
are not the PG versions you think they are.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message legrand legrand 2018-08-14 22:28:34 Re: Fwd: increase insert into local table from remote oracle table preformance
Previous Message Bruce Momjian 2018-08-14 19:59:19 Re: How to revoke privileged from PostgreSQL's superuser