pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_basebackup + SSL error: bad length
7+ messages / 3 participants
[nested] [flat]

* pg_basebackup + SSL error: bad length
@ 2018-08-27 09:00 Csaba Ragasits <ragasits.csaba@gmail.com>
  2018-08-27 14:08 ` Re: pg_basebackup + SSL error: bad length Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Csaba Ragasits @ 2018-08-27 09:00 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hello,

I would like to create a streaming replication, when I'm trying the
basebackup from the node1, I've the following errors:

pg_basebackup -P -v -D ./main -h node1 -p 5432  -U repmgr

pg_basebackup: initiating base backup, waiting for checkpoint to complete
pg_basebackup: checkpoint completed
pg_basebackup: write-ahead log start point: 2/13000028 on timeline 1
pg_basebackup: directory "/srv/pgdata/tbs_int302" exists but is not empty
pg_basebackup: removing data directory "./main"

In the node1 postgresql.log:

LOG:  could not send data to client: Connection reset by peer
ERROR:  base backup could not send data, aborting backup
LOG:  SSL error: bad length
LOG:  SSL error: bad length
FATAL:  connection to client lost

When I set off the SSL in the postgresql.conf, i've the folloving error
message when I try use the pg_basebackup command:
LOG:  could not send data to client: Broken pipe
FATAL:  connection to client lost

Have you got any information, suggestion how can I solve this errors?

My area:
- Updated Debian GNU/Linux 9
- PostgreSQL 10.5 (Debian 10.5-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled
by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit

Thx,
Csaba

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_basebackup + SSL error: bad length
  2018-08-27 09:00 pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
@ 2018-08-27 14:08 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2018-08-27 14:38   ` Re: pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Adrian Klaver @ 2018-08-27 14:08 UTC (permalink / raw)
  To: Csaba Ragasits <ragasits.csaba@gmail.com>; pgsql-general@lists.postgresql.org

On 08/27/2018 02:00 AM, Csaba Ragasits wrote:
> Hello,
> 
> I would like to create a streaming replication, when I'm trying the 
> basebackup from the node1, I've the following errors:
> 
> pg_basebackup -P -v -D ./main -h node1 -p 5432  -U repmgr
> 
> pg_basebackup: initiating base backup, waiting for checkpoint to complete
> pg_basebackup: checkpoint completed
> pg_basebackup: write-ahead log start point: 2/13000028 on timeline 1
> pg_basebackup: directory "/srv/pgdata/tbs_int302" exists but is not empty
> pg_basebackup: removing data directory "./main"
> 
> In the node1 postgresql.log:
> 
> LOG:  could not send data to client: Connection reset by peer
> ERROR:  base backup could not send data, aborting backup
> LOG:  SSL error: bad length
> LOG:  SSL error: bad length
> FATAL:  connection to client lost
> 
> When I set off the SSL in the postgresql.conf, i've the folloving error 
> message when I try use the pg_basebackup command:
> LOG:  could not send data to client: Broken pipe
> FATAL:  connection to client lost
> 
> Have you got any information, suggestion how can I solve this errors?

Can you connect to node1 using psql with and without SSL?

Where is node1 relative to the machine you are running pg_basebackup from?

Just to be clear both Postgres instances are running 10.5, correct?

> 
> My area:
> - Updated Debian GNU/Linux 9
> - PostgreSQL 10.5 (Debian 10.5-1.pgdg90+1) on x86_64-pc-linux-gnu, 
> compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
> 
> Thx,
> Csaba


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_basebackup + SSL error: bad length
  2018-08-27 09:00 pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
  2018-08-27 14:08 ` Re: pg_basebackup + SSL error: bad length Adrian Klaver <adrian.klaver@aklaver.com>
@ 2018-08-27 14:38   ` Csaba Ragasits <ragasits.csaba@gmail.com>
  2018-08-27 23:40     ` Re: pg_basebackup + SSL error: bad length Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Csaba Ragasits @ 2018-08-27 14:38 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

2018-08-27 16:08 GMT+02:00 Adrian Klaver <adrian.klaver@aklaver.com>:

> Can you connect to node1 using psql with and without SSL?
>
> Where is node1 relative to the machine you are running pg_basebackup from?
>
> Just to be clear both Postgres instances are running 10.5, correct?
>
>>
>>
Every instances are same (10.5) version, and every servers are in the
common VMWARE subnet. The psql connection is working fine with sslmode or
without sslmode.

When I try run it on the localhost (node1), I've same errors too:
pg_basebackup -P -v -D /tmp/main -h localhost -p 5432  -U repmgr

Thx,
Csaba

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_basebackup + SSL error: bad length
  2018-08-27 09:00 pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
  2018-08-27 14:08 ` Re: pg_basebackup + SSL error: bad length Adrian Klaver <adrian.klaver@aklaver.com>
  2018-08-27 14:38   ` Re: pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
@ 2018-08-27 23:40     ` Adrian Klaver <adrian.klaver@aklaver.com>
  2018-08-28 02:49       ` Re: pg_basebackup + SSL error: bad length Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 7+ messages in thread

From: Adrian Klaver @ 2018-08-27 23:40 UTC (permalink / raw)
  To: Csaba Ragasits <ragasits.csaba@gmail.com>; pgsql-general@lists.postgresql.org

On 08/27/2018 07:38 AM, Csaba Ragasits wrote:
> 
> 
> 2018-08-27 16:08 GMT+02:00 Adrian Klaver <adrian.klaver@aklaver.com 
> <mailto:adrian.klaver@aklaver.com>>:
> 
>     Can you connect to node1 using psql with and without SSL?
> 
>     Where is node1 relative to the machine you are running pg_basebackup
>     from?
> 
>     Just to be clear both Postgres instances are running 10.5, correct?
> 
> 
> 
> Every instances are same (10.5) version, and every servers are in the 
> common VMWARE subnet. The psql connection is working fine with sslmode 
> or without sslmode.
> 
> When I try run it on the localhost (node1), I've same errors too:
> pg_basebackup -P -v -D /tmp/main -h localhost -p 5432  -U repmgr

Hmm.

Is there more then one copy of pg_basebackup on the machines?

Maybe from the Debian repo and the PGDG repo.

> 
> Thx,
> Csaba
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_basebackup + SSL error: bad length
  2018-08-27 09:00 pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
  2018-08-27 14:08 ` Re: pg_basebackup + SSL error: bad length Adrian Klaver <adrian.klaver@aklaver.com>
  2018-08-27 14:38   ` Re: pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
  2018-08-27 23:40     ` Re: pg_basebackup + SSL error: bad length Adrian Klaver <adrian.klaver@aklaver.com>
@ 2018-08-28 02:49       ` Michael Paquier <michael@paquier.xyz>
  2018-08-28 08:58         ` Re: pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Michael Paquier @ 2018-08-28 02:49 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: Csaba Ragasits <ragasits.csaba@gmail.com>; pgsql-general@lists.postgresql.org

On Mon, Aug 27, 2018 at 04:40:34PM -0700, Adrian Klaver wrote:
> Is there more then one copy of pg_basebackup on the machines?

Or this user has created a tablespace directly in the main data folder,
which can cause pg_basebackup to fail because of recursion issues.  It
is no wonder that a WARNING is created during a CREATE TABLESPACE if you
do that.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_basebackup + SSL error: bad length
  2018-08-27 09:00 pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
  2018-08-27 14:08 ` Re: pg_basebackup + SSL error: bad length Adrian Klaver <adrian.klaver@aklaver.com>
  2018-08-27 14:38   ` Re: pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
  2018-08-27 23:40     ` Re: pg_basebackup + SSL error: bad length Adrian Klaver <adrian.klaver@aklaver.com>
  2018-08-28 02:49       ` Re: pg_basebackup + SSL error: bad length Michael Paquier <michael@paquier.xyz>
@ 2018-08-28 08:58         ` Csaba Ragasits <ragasits.csaba@gmail.com>
  2018-08-28 13:53           ` Re: pg_basebackup + SSL error: bad length Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Csaba Ragasits @ 2018-08-28 08:58 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hello,

Only one copy is from the pg_basebackup on the machines.

I have only a tablespace only a different location:
/srv/pgdata/tbs_int303

I think I solved the problem:

When I delete manually the /srv/pgdata/tbs_int303 folder, the pg_basebackup
is running fine.

Thank you for your help,
Csaba


2018-08-28 4:49 GMT+02:00 Michael Paquier <michael@paquier.xyz>:

> On Mon, Aug 27, 2018 at 04:40:34PM -0700, Adrian Klaver wrote:
> > Is there more then one copy of pg_basebackup on the machines?
>
> Or this user has created a tablespace directly in the main data folder,
> which can cause pg_basebackup to fail because of recursion issues.  It
> is no wonder that a WARNING is created during a CREATE TABLESPACE if you
> do that.
> --
> Michael
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_basebackup + SSL error: bad length
  2018-08-27 09:00 pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
  2018-08-27 14:08 ` Re: pg_basebackup + SSL error: bad length Adrian Klaver <adrian.klaver@aklaver.com>
  2018-08-27 14:38   ` Re: pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
  2018-08-27 23:40     ` Re: pg_basebackup + SSL error: bad length Adrian Klaver <adrian.klaver@aklaver.com>
  2018-08-28 02:49       ` Re: pg_basebackup + SSL error: bad length Michael Paquier <michael@paquier.xyz>
  2018-08-28 08:58         ` Re: pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
@ 2018-08-28 13:53           ` Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Adrian Klaver @ 2018-08-28 13:53 UTC (permalink / raw)
  To: Csaba Ragasits <ragasits.csaba@gmail.com>; pgsql-general@lists.postgresql.org

On 08/28/2018 01:58 AM, Csaba Ragasits wrote:
> Hello,
> 
> Only one copy is from the pg_basebackup on the machines.
> 
> I have only a tablespace only a different location:
> /srv/pgdata/tbs_int303
> 
> I think I solved the problem:
> 
> When I delete manually the /srv/pgdata/tbs_int303 folder, the 
> pg_basebackup is running fine.

Was this tablespace active?

Went back to your original post and realized I skipped over this:

"pg_basebackup: directory "/srv/pgdata/tbs_int302" exists but is not empty
pg_basebackup: removing data directory "./main":

Is /srv/pgdata/tbs_int302 a tablespace also?

Found this:

https://www.postgresql.org/docs/10/static/app-pgbasebackup.html

"Tablespaces will in plain format by default be backed up to the same 
path they have on the server, unless the option --tablespace-mapping is 
used. Without this option, running a plain format base backup on the 
same host as the server will not work if tablespaces are in use, because 
the backup would have to be written to the same directory locations as 
the original tablespaces."


Looks like you need to use:

-T olddir=newdir
--tablespace-mapping=olddir=newdir

> 
> Thank you for your help,
> Csaba
> 
> 
> 2018-08-28 4:49 GMT+02:00 Michael Paquier <michael@paquier.xyz 
> <mailto:michael@paquier.xyz>>:
> 
>     On Mon, Aug 27, 2018 at 04:40:34PM -0700, Adrian Klaver wrote:
>     > Is there more then one copy of pg_basebackup on the machines?
> 
>     Or this user has created a tablespace directly in the main data folder,
>     which can cause pg_basebackup to fail because of recursion issues.  It
>     is no wonder that a WARNING is created during a CREATE TABLESPACE if you
>     do that.
>     --
>     Michael
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2018-08-28 13:53 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-27 09:00 pg_basebackup + SSL error: bad length Csaba Ragasits <ragasits.csaba@gmail.com>
2018-08-27 14:08 ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-08-27 14:38   ` Csaba Ragasits <ragasits.csaba@gmail.com>
2018-08-27 23:40     ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-08-28 02:49       ` Michael Paquier <michael@paquier.xyz>
2018-08-28 08:58         ` Csaba Ragasits <ragasits.csaba@gmail.com>
2018-08-28 13:53           ` Adrian Klaver <adrian.klaver@aklaver.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox