Re: Rsync error on client end: unexpected tag 3 [sender]

2006-07-21 Thread Julian Pace Ross
Hi Wayne,I am getting the unexpected tag 3 error quite often when pushing using 2.6.8CVS on cygwin /WinXP to 2.6.8CVS on Linux over SSH (no daemon).The CVS version is pre tag-3.patch that you had posted.
I can compile with this patch on both sides (using cygwin on the client).However from the previous mails it is not clear what is causing this and whether the patch is required on the server, client or both. (The less I need change at the moment the better).
ThanksJulianOn 18/05/06, Wayne Davison [EMAIL PROTECTED] wrote:
On Tue, May 02, 2006 at 10:30:39PM -0700, Wayne Davison wrote: The attached patch should fix the problem.I've also checked the fix into CVS (and it will appear in the next nightly tar file that gets generated).
The patch I posted earlier works fine to fix this problem, but I endedup with a slightly cleaner fix in CVS when all was said and done.Hereis an updated patch for 2.6.8 that fixes this tag-3 problem the way CVS
now fixes it...wayne..--To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsyncBefore posting, read: 
http://www.catb.org/~esr/faqs/smart-questions.html
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Re: Rsync error on client end: unexpected tag 3 [sender]

2006-07-21 Thread Wayne Davison
On Fri, Jul 21, 2006 at 12:22:24PM +0200, Julian Pace Ross wrote:
 However from the previous mails it is not clear what is causing this and
 whether the patch is required on the server, client or both.

It is the receiving side that causes the tag-3 error (the generator,
to be specific).  So, if you're transferring one direction, upgrade
whichever side is receiving the files.  If you're transferring both
directions, upgrade both sides.

..wayne..
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Rsync error on client end: unexpected tag 3 [sender]

2006-05-18 Thread Wayne Davison
On Tue, May 02, 2006 at 10:30:39PM -0700, Wayne Davison wrote:
 The attached patch should fix the problem.  I've also checked the fix
 into CVS (and it will appear in the next nightly tar file that gets
 generated).

The patch I posted earlier works fine to fix this problem, but I ended
up with a slightly cleaner fix in CVS when all was said and done.  Here
is an updated patch for 2.6.8 that fixes this tag-3 problem the way CVS
now fixes it.

..wayne..
--- old/io.c2006-04-21 09:40:19 -0700
+++ new/io.c2006-05-18 10:45:16 -0700
@@ -273,10 +273,7 @@ static void read_msg_fd(void)
exit_cleanup(RERR_STREAMIO);
}
read_loop(fd, buf, len);
-   if (defer_forwarding_messages)
-   msg_list_add(msg2sndr, MSG_DELETED, buf, len);
-   else
-   io_multiplex_write(MSG_DELETED, buf, len);
+   send_msg(MSG_DELETED, buf, len);
break;
case MSG_SUCCESS:
if (len != 4 || !am_generator) {
@@ -286,10 +283,7 @@ static void read_msg_fd(void)
read_loop(fd, buf, len);
if (remove_sent_files) {
decrement_active_files(IVAL(buf,0));
-   if (defer_forwarding_messages)
-   msg_list_add(msg2sndr, MSG_SUCCESS, buf, len);
-   else
-   io_multiplex_write(MSG_SUCCESS, buf, len);
+   send_msg(MSG_SUCCESS, buf, len);
}
if (preserve_hard_links)
flist_ndx_push(hlink_list, IVAL(buf,0));
@@ -309,10 +303,7 @@ static void read_msg_fd(void)
if (n = sizeof buf)
n = sizeof buf - 1;
read_loop(fd, buf, n);
-   if (am_generator  am_server  
defer_forwarding_messages)
-   msg_list_add(msg2sndr, tag, buf, n);
-   else
-   rwrite((enum logcode)tag, buf, n);
+   rwrite(tag, buf, n);
len -= n;
}
break;
@@ -386,14 +377,19 @@ static int msg2genr_flush(int flush_it_a
return 1;
 }
 
-void send_msg(enum msgcode code, char *buf, int len)
+int send_msg(enum msgcode code, char *buf, int len)
 {
if (msg_fd_out  0) {
-   io_multiplex_write(code, buf, len);
-   return;
+   if (!defer_forwarding_messages)
+   return io_multiplex_write(code, buf, len);
+   if (!io_multiplexing_out)
+   return 0;
+   msg_list_add(msg2sndr, code, buf, len);
+   return 1;
}
msg_list_add(msg2genr, code, buf, len);
msg2genr_flush(NORMAL_FLUSH);
+   return 1;
 }
 
 int get_redo_num(int itemizing, enum logcode code)
--- old/log.c   2006-04-08 09:04:34 -0700
+++ new/log.c   2006-05-18 10:45:16 -0700
@@ -264,7 +264,7 @@ void rwrite(enum logcode code, char *buf
 
if (am_server) {
/* Pass the message to the non-server side. */
-   if (io_multiplex_write((enum msgcode)code, buf, len))
+   if (send_msg((enum msgcode)code, buf, len))
return;
if (am_daemon) {
/* TODO: can we send the error to the user somehow? */
--- old/proto.h 2006-04-22 08:38:34 -0700
+++ new/proto.h 2006-05-18 10:45:31 -0700
@@ -104,7 +104,7 @@ void set_msg_fd_in(int fd);
 void set_msg_fd_out(int fd);
 void increment_active_files(int ndx, int itemizing, enum logcode code);
 void decrement_active_files(int ndx);
-void send_msg(enum msgcode code, char *buf, int len);
+int send_msg(enum msgcode code, char *buf, int len);
 int get_redo_num(int itemizing, enum logcode code);
 int get_hlink_num(void);
 void io_set_filesfrom_fds(int f_in, int f_out);
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Re: Rsync error on client end: unexpected tag 3 [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(843) [sender]

2006-05-03 Thread Wayne Davison
On Wed, May 03, 2006 at 11:58:07AM +1000, Anthony Sadler wrote:
 Notice /etc/localtime not being able to open? 

That happens because you're using use chroot = yes.  When rsync is
running inside a chroot jail, it cannot access files that exist outside
the rsync module's path.

Rsync attempts to handle the timezone situation by using localtime()
prior to the chroot call, but on some systems this is not enough to keep
the library code really happy.  I've checked in a change that makes
rsync also call strftime() prior to the chroot (for those systems that
are configured to use strftime()).

..wayne..
--- log.c   25 Apr 2006 23:51:15 -  1.146
+++ log.c   3 May 2006 06:06:19 -
@@ -154,17 +154,14 @@ static void logfile_open(void)
 
 void log_init(void)
 {
-   time_t t;
-
if (log_initialised)
return;
log_initialised = 1;
 
/* this looks pointless, but it is needed in order for the
 * C library on some systems to fetch the timezone info
 * before the chroot */
-   t = time(NULL);
-   localtime(t);
+   timestring(time(NULL));
 
/* optionally use a log file instead of syslog */
logfname = lp_log_file();
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

RE: Rsync error on client end: unexpected tag 3 [sender] rsyncerror: error in rsync protocol data stream (code 12) atio.c(843) [sender]

2006-05-03 Thread Anthony Sadler
Hi Wayne:

Just letting you know, you were right about that patch; it wasn't installed 
correctly. 

What we had tried was to get it compiled inside of a RPM and install from the 
RPM. Something went wrong there, we don't know what. After you told us that it 
had gone wrong, we went and download the nightly build from CVS and compiled 
that and installed it.

After that, it all worked. Our backups all went through with no problems. 

Thank you very much for your effort and for the very short time with which you 
came back to me with a fix. We had all been a bit uncomfortable with our 
backups not working :P

Anthony Sadler
Far Edge Technology
w: (02) 8425 1400
 
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wayne Davison
Sent: Wednesday, 3 May 2006 16:15 
To: Anthony Sadler
Cc: rsync@lists.samba.org
Subject: Re: Rsync error on client end: unexpected tag 3 [sender] rsyncerror: 
error in rsync protocol data stream (code 12) atio.c(843) [sender]

On Wed, May 03, 2006 at 11:58:07AM +1000, Anthony Sadler wrote:
 Notice /etc/localtime not being able to open? 

That happens because you're using use chroot = yes.  When rsync is
running inside a chroot jail, it cannot access files that exist outside
the rsync module's path.

Rsync attempts to handle the timezone situation by using localtime()
prior to the chroot call, but on some systems this is not enough to keep
the library code really happy.  I've checked in a change that makes
rsync also call strftime() prior to the chroot (for those systems that
are configured to use strftime()).

..wayne..

--
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Rsync error on client end: unexpected tag 3 [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(843) [sender]

2006-05-02 Thread Wayne Davison
On Wed, May 03, 2006 at 11:58:07AM +1000, Anthony Sadler wrote:
 unexpected tag 3 [sender]

My analysis shows that some deferred messages (which are those that
arrive in the generator when the generator is already trying to flush a
partial message down the socket) are not being handled by rwrite() like
they should be.  Furthermore, the MSG_LOG message doesn't actually need
to be deferred, since they cannot result in any data being written to
the socket.  This bug can only affect an rsync daemon that is receiving
files, as all other scenarios behave correctly with the existing code.

The attached patch should fix the problem.  I've also checked the fix
into CVS (and it will appear in the next nightly tar file that gets
generated).

Thanks for the detailed report, it was very helpful.

..wayne..
--- io.c25 Apr 2006 23:51:15 -  1.193
+++ io.c3 May 2006 05:13:31 -
@@ -294,6 +294,7 @@ static void read_msg_fd(void)
exit_cleanup(RERR_STREAMIO);
}
close_multiplexing_out();
+   defer_forwarding_messages = 0;
/* FALL THROUGH */
case MSG_INFO:
case MSG_ERROR:
@@ -303,7 +304,8 @@ static void read_msg_fd(void)
if (n = sizeof buf)
n = sizeof buf - 1;
read_loop(fd, buf, n);
-   if (am_generator  am_server  
defer_forwarding_messages)
+   if (am_generator  am_server
+ defer_forwarding_messages  tag != MSG_LOG)
msg_list_add(msg2sndr, tag, buf, n);
else
rwrite((enum logcode)tag, buf, n);
@@ -1134,11 +1136,20 @@ static void msg2sndr_flush(void)
 
while (msg2sndr.head  io_multiplexing_out) {
struct msg_list_item *m = msg2sndr.head;
+   int tag = (IVAL(m-buf, 0)  24) - MPLEX_BASE;
if (!(msg2sndr.head = m-next))
msg2sndr.tail = NULL;
-   stats.total_written += m-len;
defer_forwarding_messages = 1;
-   writefd_unbuffered(sock_f_out, m-buf, m-len);
+   switch (tag) {
+   case MSG_INFO:
+   case MSG_ERROR:
+   rwrite((enum logcode)tag, m-buf + 4, m-len - 4);
+   break;
+   default:
+   stats.total_written += m-len;
+   writefd_unbuffered(sock_f_out, m-buf, m-len);
+   break;
+   }
defer_forwarding_messages = 0;
free(m);
}
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html