You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Bo Berglund <bo...@gmail.com> on 2025/01/07 09:48:27 UTC

Re: How to restore repositories from backup server

On Sun, 29 Dec 2024 00:49:21 +0100, Bo Berglund <bo...@gmail.com> wrote:

>Since I did not succeed in getting this to work with svnrload and a
>StackOverflow search suggested I should use svnadmin instead:
>
>I reverted to svnadmin and look what happened:
>
>svnadmin load E:\SVNREPOS\cmpcpy < dump_cmp
><<< Started new transaction, based on original revision 1312
>     * editing path : CmpLaz/trunk/PasLibVlc/source/PasLibVlcClassUnit.pas ...
>done.
>     * editing path : CmpLaz/trunk/PasLibVlc/source/PasLibVlcUnit.pas ... done.
>     * editing path : CmpLaz/trunk/PasLibVlc/source/PasLibVlcUnit.txt ... done.
>     * editing path : CmpLaz/trunk/PasLibVlc/source/compiler.inc ... done.
>     * editing path : CmpLaz/trunk/PasLibVlc/source.vcl/PasLibVlcPlayerUnit.pas
>... done.
>     * editing path : CmpLaz/trunk/PasLibVlc/source.vcl/PasLibVlcPlayerUnit.txt
>... done.
>
>------- Committed revision 1312 >>>
>
>So now the test repo *contains* the new revision (there was only one committed
>in October in the dump file)!
>
>So tomorrow I will process the actual 8 much bigger repos with tons of missing
>revisions.
>
>Thanks for bearing with me!

Now back after the holidays and I have stumbled across a very strange problem.

This concerns a repository named pc where the mirror repo has a last revvision
number 4498 whereas the main repo shows revision 4518.
Missing 20 revs *on the mirror* which has not been subject to a power outage or
been offline!

This is very strange since the main repository is from a server backup dated in
July 2024 

I have also checked the commit emails for this repo and those show another set
of commits done for revs 4519 to 4528 between 2024-08-14-2024-12-01, which is
where the mirror should be now. But isn't....


Command svn info on the *main server* shows this:

Repository Root: https://agiengineering/svn/pc
Repository UUID: 1e489663-c639-2248-90da-e976bc628839
Revision: 4518
Node Kind: directory
Last Changed Author: bosse
Last Changed Rev: 4518
Last Changed Date: 2023-12-05 04:12:11 -0600 (Tue, 05 Dec 2023)

And the same mirror repo that should have been synced to the mirror server many
time during the fall:

Repository Root: https://svn.mydomain.com/svn/pc
Repository UUID: e8e82d8e-9267-4f7b-8f11-ddd3f99e352f
Revision: 4498
Node Kind: directory
Last Changed Author: bosse
Last Changed Rev: 4498
Last Changed Date: 2023-03-28 20:59:05 +0200 (Tue, 28 Mar 2023)

Notice that the mirror is sitting at a revision way earlier than the main server
even though the other 9 repos show the opposite where the mirror holds the
latest revision from a sync operation in beginning of Dec 2024

It seems like the sync was not really done for this repo for a long time even
though the nightly sync operation actually was working for all the other repos
where the mirror contains commits done up to the server crash...
And it is a single operation on the main server that runs these sync operations.

HOW to fix this?
Couild I proceed like this:

1- Make a repo dump on the main server and load that into the mirror.
   That should bring the mirror to rev 4518 (same as main)

2- Check out the involved 3 projects fresh from the main repo

3- Using the emailings as base commit the same files as are listed there
   Thus recreating the 10 revisions that are missing.

4- Perform a manual sync to the mirror repo to bring that to rev 4528

Is there some caveat (apart from, getting the wrong dates into the revisions)?


And *how* could this have happened and for such a long time?


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Ryan Carsten Schmidt <su...@ryandesign.com>.
On Jan 11, 2025, at 16:31, Bo Berglund wrote:
> 
> (I don't know how to craft a Windows bat file to do the checking above so that
> is why I turned to the Linux server...)

Doesn't the Windows Subsystem for Linux allow you to run Linux scripts on a Windows machine, if that's what you want to do?

Re: How to restore repositories from backup server

Posted by Daniel Sahlberg <da...@gmail.com>.
Den fre 17 jan. 2025 kl 07:25 skrev Bo Berglund <bo...@gmail.com>:

> On Fri, 17 Jan 2025 07:03:34 +0100, Daniel Sahlberg
> <da...@gmail.com> wrote:
>
> >I agree with Bo here although I don’t understand enough about recent
> >Linux-on-the-desktop development. A long time ago, setting DISPLAY was the
> >way to declare where you wanted to your GUI to appear. When SSH-ing into a
> >box you wasn’t able to set DISPLAY to the X server of that computer. It
> was
> >either empty or you could forward it back to your local computer. When
> >running X directly on the console, DISPLAY was obviously pointing at
> >localhost. There are no guarantees that the same uses logged in on the
> >local console as the one running the ssh session.
> >
> >But we are running very much off-topic here. From a Subversion perspective
> >we are just asking the password manager to get the password and then it is
> >out of our hands.
>
> Thanks for the explanation!
>

May I just ask, when you connect to the RPI box via SSH, what do you get
from:

$ echo $DISPLAY

If it is set to something, does it help to unset it, ie:

$ export DISPLAY=

Again if it is set to something, have you manipulated this in any way? For
example by setting it in your login script?

Follow-up question then:
>
> How do I configure svn out-of-the-box in order for it to use a password
> manager
> that communicates via the command line rather than any existing GUI
> desktop.
> As it is now on my newly installed RPi4 I have not modified anything in the
> config or servers files.
>

You should be able to edit ~/.subversion/config

There is an [auth] section and the setting password-stores contains a comma
separated list of all active password stores. I can't remember which one is
giving you problems but maybe the simplest way is to just set it to an
empty list. By default, password-stores is commented out (#) so you need to
add a separate line or uncomment the existing example.

It isn't immediately clear to me how the plaintext password store is
configured here, it seems it is enabled by default (unless you set
store-plaintext-passwords = no, and obviously it has to be included in the
build).

Cheers,
Daniel

Re: How to restore repositories from backup server

Posted by Daniel Sahlberg <da...@gmail.com>.
fre 17 jan. 2025 kl. 18:43 skrev Nathan Hartman <ha...@gmail.com>:

> I don't know whether GPG-Agent can be configured to unlock
> automatically at startup. (That probably would bring us back to the
> issue of how to securely store the pin that would unlock it
> automatically; it would probably end up being in plaintext, in which
> case, you might as well just store the SVN password in plaintext.
> Somewhere along the line, something either needs to be in plaintext or
> entered manually at each startup.)


I believe the key here is unlocking at _login_ compared to on _boot_. If I
understand the links (but I only read it quickly) the idea was to chain a
pam module into the authentication to unlock the keychain (which require
the same password for the account as for the keychain). It would work very
much as Windows’ password store.

Cheers
Daniel

Re: How to restore repositories from backup server

Posted by Nathan Hartman <ha...@gmail.com>.
On Fri, Jan 17, 2025 at 7:40 AM Johan Corveleyn <jc...@gmail.com> wrote:
> Oh, and according to this cirata (previously wandisco) blog article it
> should be possible to setup a Gnome Keyring without a GUI:
>
> https://community.cirata.com/s/article/How-to-set-up-encrypted-svn-password-storage-using-gnome-keyring-in-an-ssh-session
>
> I have not tried it myself, but I might (have to) dig into it in the
> near future.
>
> Two more articles related to Gnome Keyring which I have bookmarked
> because I want to research unlocking the keyring automatically after
> login (but haven't gotten around to it, YMMV):
> https://wiki.archlinux.org/title/GNOME/Keyring
> https://forums.debian.net/viewtopic.php?t=152349 (how to auto-unlock
> gnome-keyring on login)

Thanks for those links!

This might be relevant as well:

https://superuser.com/questions/141036/use-of-gnome-keyring-daemon-without-x

> I think, if we get this all figured out (setting up GUI-less Gnome
> Keyring with auto-unlock upon login), it would be great if we'd put
> this into a blog or step-by-step guide somewhere on
> subversion.apache.org.

That's a good idea. We have the blog section of the site [1] and this
would be a good fit there.

We also have a FAQ entry [2] "How does Subversion cache credentials
(plaintext and encrypted)?" This could be updated to include a brief
explanation, with a link to the blog article for more details.

There is a TODO there regarding GPG-Agent (not to be confused with
GNOME Keyring) -- this credential store can also be configured for pin
entry through CLI (including when remotely accessed through SSH) by
configuring it to use pinentry-tty. This StackOverflow may be
relevant:

https://superuser.com/questions/520980/how-to-force-gpg-to-use-console-mode-pinentry-to-prompt-for-passwords

I don't know whether GPG-Agent can be configured to unlock
automatically at startup. (That probably would bring us back to the
issue of how to securely store the pin that would unlock it
automatically; it would probably end up being in plaintext, in which
case, you might as well just store the SVN password in plaintext.
Somewhere along the line, something either needs to be in plaintext or
entered manually at each startup.)

One more thing: In Subversion's config files, note that the *order* of
the 'password-stores' setting is significant.

[1] https://subversion.apache.org/blog/

[2] https://subversion.apache.org/faq.html#plaintext-passwords

Hope this helps,
Nathan

Re: How to restore repositories from backup server

Posted by Johan Corveleyn <jc...@gmail.com>.
On Fri, Jan 17, 2025 at 1:27 PM Johan Corveleyn <jc...@gmail.com> wrote:
>
> On Fri, Jan 17, 2025 at 7:24 AM Bo Berglund <bo...@gmail.com> wrote:
> ...
> > ------------------------------------------------------
> > $ svn --version:
> > svn, version 1.14.2 (r1899510)
> >    compiled Jan 31 2023, 18:14:10 on aarch64-unknown-linux-gnu
> > ...
> > The following authentication credential caches are available:
> >
> > * Plaintext cache in /home/bosse/.subversion
> > * Gnome Keyring
> > * GPG-Agent
> > * KWallet (KDE)
> > -------------------------------------------------------
> >
> > I assume that the last 3 alternatives are Desktop dependent and use GUI dialog
> > boxes?
> >
> > I'd appreciate it to get a specific direction as to which items to add/change in
> > the default files in $HOME/.subversion/: config and servers, in order for the
> > passwords to be cached in a text-only environment.
> > I.e. how to set them to use a command line interface only?
>
> I guess it comes down to these settings in the $HOME/.subversion/servers file:
>
> [[[
> ###   store-passwords            Specifies whether passwords used
> ###                              to authenticate against a
> ###                              Subversion server may be cached
> ###                              to disk in any way.
> ###   store-plaintext-passwords  Specifies whether passwords may
> ###                              be cached on disk unencrypted.
> ...
> ### Set store-passwords to 'no' to avoid storing new passwords on
> ### disk in any way, including in password stores.  It defaults to
> ### 'yes', but Subversion will never save your password to disk in
> ### plaintext unless explicitly configured to do so.
> ###
> ### Set store-plaintext-passwords to 'no' to avoid storing new
> ### passwords in unencrypted form in the auth/ area of your config
> ### directory. Set it to 'yes' to allow Subversion to store
> ### unencrypted passwords in the auth/ area.  The default is
> ### 'ask', which means that Subversion will ask you before
> ### saving a password to disk in unencrypted form.  Note that
> ### this option has no effect if either 'store-passwords' or
> ### 'store-auth-creds' is set to 'no'.
> ]]]
>
> If you set store-plaintext-passwords=yes it should work. You can
> configure this setting differently depending on the server you are
> connecting to, which is why this is a setting in the 'servers' file.
> You probably want to configure your setting in the '[global]' section
> in this file. Or you might configure your own group in the "[groups]"
> section (listing the hostnames with which you connect to your own
> server), and then put the store-plaintext-passwords=yes only in that
> particular group's section.
>
> Also, keep in mind that there is a system-wide configuration area
> (optional) in /etc/subversion, and then there is the user-specific are
> in $HOME/.subversion [1]. It's possible that you have
> store-plaintext-passwords=no set in /etc/subversion/servers, and
> nothing set in your user-specific servers file. In that case, contrary
> to what you might expect, you won't get the 'ask' default, but it will
> be set to 'no' by the system-wide setting.
>
> [1] https://svnbook.red-bean.com/nightly/en/svn.advanced.confarea.html

Oh, and according to this cirata (previously wandisco) blog article it
should be possible to setup a Gnome Keyring without a GUI:

https://community.cirata.com/s/article/How-to-set-up-encrypted-svn-password-storage-using-gnome-keyring-in-an-ssh-session

I have not tried it myself, but I might (have to) dig into it in the
near future.

Two more articles related to Gnome Keyring which I have bookmarked
because I want to research unlocking the keyring automatically after
login (but haven't gotten around to it, YMMV):
https://wiki.archlinux.org/title/GNOME/Keyring
https://forums.debian.net/viewtopic.php?t=152349 (how to auto-unlock
gnome-keyring on login)

I think, if we get this all figured out (setting up GUI-less Gnome
Keyring with auto-unlock upon login), it would be great if we'd put
this into a blog or step-by-step guide somewhere on
subversion.apache.org.

-- 
Johan

Re: How to restore repositories from backup server

Posted by Johan Corveleyn <jc...@gmail.com>.
On Fri, Jan 17, 2025 at 7:24 AM Bo Berglund <bo...@gmail.com> wrote:
...
> ------------------------------------------------------
> $ svn --version:
> svn, version 1.14.2 (r1899510)
>    compiled Jan 31 2023, 18:14:10 on aarch64-unknown-linux-gnu
> ...
> The following authentication credential caches are available:
>
> * Plaintext cache in /home/bosse/.subversion
> * Gnome Keyring
> * GPG-Agent
> * KWallet (KDE)
> -------------------------------------------------------
>
> I assume that the last 3 alternatives are Desktop dependent and use GUI dialog
> boxes?
>
> I'd appreciate it to get a specific direction as to which items to add/change in
> the default files in $HOME/.subversion/: config and servers, in order for the
> passwords to be cached in a text-only environment.
> I.e. how to set them to use a command line interface only?

I guess it comes down to these settings in the $HOME/.subversion/servers file:

[[[
###   store-passwords            Specifies whether passwords used
###                              to authenticate against a
###                              Subversion server may be cached
###                              to disk in any way.
###   store-plaintext-passwords  Specifies whether passwords may
###                              be cached on disk unencrypted.
...
### Set store-passwords to 'no' to avoid storing new passwords on
### disk in any way, including in password stores.  It defaults to
### 'yes', but Subversion will never save your password to disk in
### plaintext unless explicitly configured to do so.
###
### Set store-plaintext-passwords to 'no' to avoid storing new
### passwords in unencrypted form in the auth/ area of your config
### directory. Set it to 'yes' to allow Subversion to store
### unencrypted passwords in the auth/ area.  The default is
### 'ask', which means that Subversion will ask you before
### saving a password to disk in unencrypted form.  Note that
### this option has no effect if either 'store-passwords' or
### 'store-auth-creds' is set to 'no'.
]]]

If you set store-plaintext-passwords=yes it should work. You can
configure this setting differently depending on the server you are
connecting to, which is why this is a setting in the 'servers' file.
You probably want to configure your setting in the '[global]' section
in this file. Or you might configure your own group in the "[groups]"
section (listing the hostnames with which you connect to your own
server), and then put the store-plaintext-passwords=yes only in that
particular group's section.

Also, keep in mind that there is a system-wide configuration area
(optional) in /etc/subversion, and then there is the user-specific are
in $HOME/.subversion [1]. It's possible that you have
store-plaintext-passwords=no set in /etc/subversion/servers, and
nothing set in your user-specific servers file. In that case, contrary
to what you might expect, you won't get the 'ask' default, but it will
be set to 'no' by the system-wide setting.

[1] https://svnbook.red-bean.com/nightly/en/svn.advanced.confarea.html

-- 
Johan

Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Fri, 17 Jan 2025 07:03:34 +0100, Daniel Sahlberg
<da...@gmail.com> wrote:

>I agree with Bo here although I don’t understand enough about recent
>Linux-on-the-desktop development. A long time ago, setting DISPLAY was the
>way to declare where you wanted to your GUI to appear. When SSH-ing into a
>box you wasn’t able to set DISPLAY to the X server of that computer. It was
>either empty or you could forward it back to your local computer. When
>running X directly on the console, DISPLAY was obviously pointing at
>localhost. There are no guarantees that the same uses logged in on the
>local console as the one running the ssh session.
>
>But we are running very much off-topic here. From a Subversion perspective
>we are just asking the password manager to get the password and then it is
>out of our hands.

Thanks for the explanation!

Follow-up question then:

How do I configure svn out-of-the-box in order for it to use a password manager
that communicates via the command line rather than any existing GUI desktop.
As it is now on my newly installed RPi4 I have not modified anything in the
config or servers files.

And it states this: 
------------------------------------------------------
$ svn --version:
svn, version 1.14.2 (r1899510)
   compiled Jan 31 2023, 18:14:10 on aarch64-unknown-linux-gnu
...
The following authentication credential caches are available:

* Plaintext cache in /home/bosse/.subversion
* Gnome Keyring
* GPG-Agent
* KWallet (KDE)
-------------------------------------------------------

I assume that the last 3 alternatives are Desktop dependent and use GUI dialog
boxes?

I'd appreciate it to get a specific direction as to which items to add/change in
the default files in $HOME/.subversion/: config and servers, in order for the
passwords to be cached in a text-only environment.
I.e. how to set them to use a command line interface only?

If that is achieved I will add it to my Subversion how-to document and not ask
again....


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Daniel Sahlberg <da...@gmail.com>.
fre 17 jan. 2025 kl. 01:49 skrev Ryan Carsten Schmidt <
subversion-2024@ryandesign.com>:

> On Jan 16, 2025, at 17:09, Bo Berglund wrote:
> >
> > It should return the request for password into the channel that issued
> the
> > command rather than firing up a completely unrelated comm channel. (of
> course)
> >
> > If you get a landline phone call you do not reply in a cellphone, right?
>
> I understand the end user perspective of what you're saying. I am asking
> how on a technical level you suggest subversion would accomplish that.
> There are different password managers on each os and as far as I know
> subversion is merely asking the password manager to supply the password. If
> the password manager already has a suitable password saved, it returns that
> immediately. What method the password manager uses to request a password
> from the user when one is not already saved is up to the password manager,
> not subversion.


I agree with Bo here although I don’t understand enough about recent
Linux-on-the-desktop development. A long time ago, setting DISPLAY was the
way to declare where you wanted to your GUI to appear. When SSH-ing into a
box you wasn’t able to set DISPLAY to the X server of that computer. It was
either empty or you could forward it back to your local computer. When
running X directly on the console, DISPLAY was obviously pointing at
localhost. There are no guarantees that the same uses logged in on the
local console as the one running the ssh session.

But we are running very much off-topic here. From a Subversion perspective
we are just asking the password manager to get the password and then it is
out of our hands.

Cheers
Daniel

Re: How to restore repositories from backup server

Posted by Ryan Carsten Schmidt <su...@ryandesign.com>.
On Jan 16, 2025, at 17:09, Bo Berglund wrote:
> 
> It should return the request for password into the channel that issued the
> command rather than firing up a completely unrelated comm channel. (of course)
> 
> If you get a landline phone call you do not reply in a cellphone, right?

I understand the end user perspective of what you're saying. I am asking how on a technical level you suggest subversion would accomplish that. There are different password managers on each os and as far as I know subversion is merely asking the password manager to supply the password. If the password manager already has a suitable password saved, it returns that immediately. What method the password manager uses to request a password from the user when one is not already saved is up to the password manager, not subversion. 

Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Thu, 16 Jan 2025 14:24:48 -0600, Ryan Carsten Schmidt
<su...@ryandesign.com> wrote:

>> Sooo strange that it should throw up something in a completely different
>> environment than where the trigger was.
>
>How should subversion detect that it is running in an ssh session rather than in a local terminal?
>
>What do you think it should do instead in that situation?

It should return the request for password into the channel that issued the
command rather than firing up a completely unrelated comm channel. (of course)

If you get a landline phone call you do not reply in a cellphone, right?


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Ryan Carsten Schmidt <su...@ryandesign.com>.
On Jan 16, 2025, at 10:29, Bo Berglund wrote:
> 
> I have now built an RPi4B device using the latest 64 bit PiOS and on that I get
> a version of svn that *does* allow plaintext password cache. But it also came
> with a desktop and the first thing that happened when I tried a subversion
> command **from the ssh command line*** was that a dialog popped up on my
> *desktop monitor* where I was asked to enter my password etc!!!
> 
> Exactly the same as a number of years ago when I could not understand why a svn
> command just stalled without any output.

Yes, that's how it's always been designed to work. If you don't want that then don't do that. 


> Sooo strange that it should throw up something in a completely different
> environment than where the trigger was.

How should subversion detect that it is running in an ssh session rather than in a local terminal?

What do you think it should do instead in that situation?



Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Mon, 13 Jan 2025 17:45:31 +0100, Daniel Sahlberg
<da...@gmail.com> wrote:

>> A separate RPi4 image can be built here and then transferred over via
>> Internet
>> so they can burn it to a blank SDcard and start the RPi device up there.
>> Once on that netywork I can manage it from here via VPN.
>>
>> Meanwhile I have to enable the script on the Ubuntu server and put
>> username/password into the call. That at least works, I have tested.
>> I will protect it by modifying the $HOME/.subversion directory and the
>> script to
>> be only accessible by me. But executable by the system of course.
>
>
>You are probably more secure by using the Python script linked from the FAQ
>to insert a password into the password cache than by putting it on the
>command line. In either case it is stored in plaintext on the computer. If
>it is on the command line, it will be visible using ps. If it is stored in
>the password cache, it will only be visible to root (as long as you protect
>your ~ in an appropriate way).

Not at all fluent in python so I want to avoid that....

UPDATE:
-------
I have now built an RPi4B device using the latest 64 bit PiOS and on that I get
a version of svn that *does* allow plaintext password cache. But it also came
with a desktop and the first thing that happened when I tried a subversion
command **from the ssh command line*** was that a dialog popped up on my
*desktop monitor* where I was asked to enter my password etc!!!

Exactly the same as a number of years ago when I could not understand why a svn
command just stalled without any output.

This time I saw it since I had a VNC connection too and when I entered the data
on the GUII screen my ssh command line command completed.

Sooo strange that it should throw up something in a completely different
environment than where the trigger was.

Anyway after it was fully configured I could send the disk image over to USA and
a person in the office loaded it on another RPi4B and it started fine.

So now I can VPN/VNC/SSH to the remote LAN and connect to the RPi4 on that LAN
and test my validation scripts, which did work.

So now I have a sync check being run late every night and if there is a
difference in revision numbers it will send me an alert email.



-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Daniel Sahlberg <da...@gmail.com>.
mån 13 jan. 2025 kl. 17:36 skrev Bo Berglund <bo...@gmail.com>:

> On Mon, 13 Jan 2025 07:59:35 +0100, Daniel Sahlberg
> <da...@gmail.com> wrote:
>
> >Den mån 13 jan. 2025 kl 00:29 skrev Bo Berglund <bo...@gmail.com>:
> >
> >> So in which versions has the plaintext cache been removed?
> >>
> >
> >There is no simple answer to this question. The best answer I can give is
> >that in 1.12 the compile time default was changed [1] to stop writing to
> >the plaintext password store. This will be reverted in 1.15 [2]. However
> >different distributions may decide to compile their packages using
> >non-default settings. As one example, it has been reported on the list
> that
> >OpenBSD compiles Subversion with the plaintext cache ENABLED but sets the
> >systemwide configuration option to disable storing passwords. That
> probably
> >explain why you receive different results between different machines, some
> >may have decided to follow the OpenBSD example.
> >
> >Question:
> >> -----------
> >> Is it possible to get a newer svn version installed in Ubuntu than what
> is
> >> provided by the apt installer for the Ubuntu distribution?
> >>
> >
> >You can always build your own. Otherwise I'd suggest you contact
> >Canonical's support.
> >
>
> I guess I have to figure out something else, for example putting a
> RaspberryPi
> (with a newer subversion) on that network just as an alert agent.
>
> A separate RPi4 image can be built here and then transferred over via
> Internet
> so they can burn it to a blank SDcard and start the RPi device up there.
> Once on that netywork I can manage it from here via VPN.
>
> Meanwhile I have to enable the script on the Ubuntu server and put
> username/password into the call. That at least works, I have tested.
> I will protect it by modifying the $HOME/.subversion directory and the
> script to
> be only accessible by me. But executable by the system of course.


You are probably more secure by using the Python script linked from the FAQ
to insert a password into the password cache than by putting it on the
command line. In either case it is stored in plaintext on the computer. If
it is on the command line, it will be visible using ps. If it is stored in
the password cache, it will only be visible to root (as long as you protect
your ~ in an appropriate way).

Cheers
Daniel

Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Mon, 13 Jan 2025 07:59:35 +0100, Daniel Sahlberg
<da...@gmail.com> wrote:

>Den mån 13 jan. 2025 kl 00:29 skrev Bo Berglund <bo...@gmail.com>:
>
>> So in which versions has the plaintext cache been removed?
>>
>
>There is no simple answer to this question. The best answer I can give is
>that in 1.12 the compile time default was changed [1] to stop writing to
>the plaintext password store. This will be reverted in 1.15 [2]. However
>different distributions may decide to compile their packages using
>non-default settings. As one example, it has been reported on the list that
>OpenBSD compiles Subversion with the plaintext cache ENABLED but sets the
>systemwide configuration option to disable storing passwords. That probably
>explain why you receive different results between different machines, some
>may have decided to follow the OpenBSD example.
>
>Question:
>> -----------
>> Is it possible to get a newer svn version installed in Ubuntu than what is
>> provided by the apt installer for the Ubuntu distribution?
>>
>
>You can always build your own. Otherwise I'd suggest you contact
>Canonical's support.
>

I guess I have to figure out something else, for example putting a RaspberryPi
(with a newer subversion) on that network just as an alert agent.

A separate RPi4 image can be built here and then transferred over via Internet
so they can burn it to a blank SDcard and start the RPi device up there.
Once on that netywork I can manage it from here via VPN.

Meanwhile I have to enable the script on the Ubuntu server and put
username/password into the call. That at least works, I have tested.
I will protect it by modifying the $HOME/.subversion directory and the script to
be only accessible by me. But executable by the system of course.

I should really dist-upgrade the Ubuntu server over there but I want to be on
location for that and I don't know when that will happen....


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Daniel Sahlberg <da...@gmail.com>.
Den mån 13 jan. 2025 kl 00:29 skrev Bo Berglund <bo...@gmail.com>:

> So in which versions has the plaintext cache been removed?
>

There is no simple answer to this question. The best answer I can give is
that in 1.12 the compile time default was changed [1] to stop writing to
the plaintext password store. This will be reverted in 1.15 [2]. However
different distributions may decide to compile their packages using
non-default settings. As one example, it has been reported on the list that
OpenBSD compiles Subversion with the plaintext cache ENABLED but sets the
systemwide configuration option to disable storing passwords. That probably
explain why you receive different results between different machines, some
may have decided to follow the OpenBSD example.

Question:
> -----------
> Is it possible to get a newer svn version installed in Ubuntu than what is
> provided by the apt installer for the Ubuntu distribution?
>

You can always build your own. Otherwise I'd suggest you contact
Canonical's support.

Cheers,
Daniel

[1]
https://subversion.apache.org/docs/release-notes/1.12.html#client-server-improvements
[2]
https://subversion-staging.apache.org/docs/release-notes/1.15.html#client-server-improvements

Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Sun, 12 Jan 2025 18:39:29 +0100, Daniel Sahlberg
<da...@gmail.com> wrote:

>sön 12 jan. 2025 kl. 18:30 skrev Bo Berglund <bo...@gmail.com>:
>
>> On Sun, 12 Jan 2025 09:53:43 -0600, Ryan Carsten Schmidt
>> <su...@ryandesign.com> wrote:
>>
>> >On Jan 12, 2025, at 01:45, Bo Berglund wrote:
>> >>
>> >> I am not specifically interested in a *plaintext* password store, what
>> I want is
>> >> to store the passwords locally (encrypted is fine) and accessible by
>> svn when
>> >> the system does not have a GUI desktop.
>> >
>> >As far as I know, a plaintext password is the only option for storing a
>> >Subversion password on a GUI-less system.
>>
>> OK, but how do I enable it on subversion then?
>>
>> I think I saw in one of the many posts and docs on the subject I have read
>> that
>> subversion is no longer complied with the plaintext option....
>>
>> I don't know if this is true or not but then everyone with a headless and
>> GUI-less Ubuntu server is not able to use subversion????
>> Strange.
>
>
>Did you read the FAQ entry I sent?
Yes

>As you saw in your own post (the output from svn —version), the plaintext
>cache was missing from your distribution’s binary package. But you can use
>the script to push a password to the plain text cache.
>
>From Subversion 1.15, much based on your previous threads, we have changed
>the compile time defaults to once again enable the plain text cache (but
>it is entirely possible that your distribution will disable it).
>

So in which versions has the plaintext cache been removed?
I checked on machines I have available and found this:

On my Ubuntu 24.04.1 LTS svn mirror server I have:
svn, version 1.14.3 (r1914484)
----
* Plaintext cache in /home/bosse/.subversion
* Gnome Keyring
* GPG-Agent
* KWallet (KDE)

And on the Rpi5B Bookworm in my home office:
svn, version 1.14.2 (r1899510)
----
* Plaintext cache in /home/bosse/.subversion
* Gnome Keyring
* GPG-Agent
* KWallet (KDE)

I also have another Ubuntu 24.04.1 LTS laptop at home:
svn, version 1.14.3 (r1914484)
------
* Plaintext cache in /home/bosse/.subversion
* Gnome Keyring
* GPG-Agent
* KWallet (KDE)


All of these *cannot* be used since they can't see the main server on the
company LAN...

On the Ubuntu 22.04.5 LTS server on the company LAN I want to use:
svn, version 1.14.1 (r1886195)
------
* Gnome Keyring
* GPG-Agent
* KWallet (KDE)

And the RPi3B also on the company LAN I might use:
svn, version 1.14.1 (r1886195)
------
* Gnome Keyring
* GPG-Agent
* KWallet (KDE)

On a Linux Mint 20.3 PC at home:
svn, version 1.13.0 (r1867053)
------
* Gnome Keyring
* GPG-Agent
* KWallet (KDE)

It seems like svn 1.14.1 and below is the version in these devices which does
*NOT* support the plaintext cache while the next version 1.14.2. and 1.14.3 both
do...

Question:
-----------
Is it possible to get a newer svn version installed in Ubuntu than what is
provided by the apt installer for the Ubuntu distribution?

TIA.


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Daniel Sahlberg <da...@gmail.com>.
sön 12 jan. 2025 kl. 18:30 skrev Bo Berglund <bo...@gmail.com>:

> On Sun, 12 Jan 2025 09:53:43 -0600, Ryan Carsten Schmidt
> <su...@ryandesign.com> wrote:
>
> >On Jan 12, 2025, at 01:45, Bo Berglund wrote:
> >>
> >> I am not specifically interested in a *plaintext* password store, what
> I want is
> >> to store the passwords locally (encrypted is fine) and accessible by
> svn when
> >> the system does not have a GUI desktop.
> >
> >As far as I know, a plaintext password is the only option for storing a
> >Subversion password on a GUI-less system.
>
> OK, but how do I enable it on subversion then?
>
> I think I saw in one of the many posts and docs on the subject I have read
> that
> subversion is no longer complied with the plaintext option....
>
> I don't know if this is true or not but then everyone with a headless and
> GUI-less Ubuntu server is not able to use subversion????
> Strange.


Did you read the FAQ entry I sent?

As you saw in your own post (the output from svn —version), the plaintext
cache was missing from your distribution’s binary package. But you can use
the script to push a password to the plain text cache.

From Subversion 1.15, much based on your previous threads, we have changed
the compile time defaults to once a gain enable the plain text cache (but
it is entirely possible that your distribution will disable it).

Why plain text you might ask. Well, we have encrypted stores available. But
they are not very well suited for scheduled jobs since there is no user to
unlock the keyring. And if the keyring is not locked, then there isn’t a
big difference compared to storing the password in plain text.

Cheers
Daniel

Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Sun, 12 Jan 2025 09:53:43 -0600, Ryan Carsten Schmidt
<su...@ryandesign.com> wrote:

>On Jan 12, 2025, at 01:45, Bo Berglund wrote:
>> 
>> I am not specifically interested in a *plaintext* password store, what I want is
>> to store the passwords locally (encrypted is fine) and accessible by svn when
>> the system does not have a GUI desktop.
>
>As far as I know, a plaintext password is the only option for storing a 
>Subversion password on a GUI-less system. 

OK, but how do I enable it on subversion then?

I think I saw in one of the many posts and docs on the subject I have read that
subversion is no longer complied with the plaintext option....

I don't know if this is true or not but then everyone with a headless and
GUI-less Ubuntu server is not able to use subversion????
Strange.


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Ryan Carsten Schmidt <su...@ryandesign.com>.
On Jan 12, 2025, at 01:45, Bo Berglund wrote:
> 
> I am not specifically interested in a *plaintext* password store, what I want is
> to store the passwords locally (encrypted is fine) and accessible by svn when
> the system does not have a GUI desktop.

As far as I know, a plaintext password is the only option for storing a Subversion password on a GUI-less system. 

Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Sun, 12 Jan 2025 06:52:55 +0100, Daniel Sahlberg
<da...@gmail.com> wrote:

>> But it is not working on the Ubuntu server on the main LAN.
>> What can I do in order for the script to run without asking for my
>> password?
>> Svn version on the linux server is:  1.14.1
>>
>> I have not used svn on that machine previously as far as I can remember...
>> It is used as an OpenVPN server.
>> And it is a *server* without any desktop. The only way to work on it is
>> via an
>> SSH terminal (like PuTTY).
>>
>> I have enabled the following line in $HOME/.subversion/servers:
>>
>> [global]
>> store-passwords = yes
>>
>> Any ideas?
>>
>> (I don't know how to craft a Windows bat file to do the checking above so
>> that
>> is why I turned to the Linux server...)
>
>
>See
>https://subversion.apache.org/faq.html#plaintext-passwords, in particular
>"I want to use the Plaintext cache but it wasn't enabled at compile time."

I am not specifically interested in a *plaintext* password store, what I want is
to store the passwords locally (encrypted is fine) and accessible by svn when
the system does not have a GUI desktop.

I have used subversion on a number of Raspberry Pi devices and ran across the
caching problem before and on those cases what happened was that when working on
an ssh command prompt the svn operations just stalled and I could not understand
why until I by "accident" had the desktop open in a VNC window to the side and
discovered that when it stalled then a GUI(!) dialog popped up about logging in
to the password cache (or something similar) in that other window!!!
Then after entering the password into *that* GUI dialog the command line command
completed!

It indicates that someone has not thought this through but assumes there is a
desktop available so the interactions can be run there.....

My Linux servers are just that, no GUI desktop installed and yet subversion
seems to not offer a GUI-less way to cache the credentials...


I have checked with svn auth on both Ubuntu servers  (below I have obfuscated
identity information in the command/response items):

On my mirror server, which does not have access to the main server since they
are on separate LAN:s and the main server is only locally available:

$ svn auth
------------------------------------------------------------------------
Credential kind: svn.simple
Authentication realm: <https://svn.mirrorserver.com:443> Subversion Repository
Password cache: simple
Password: [not shown]
Username: bosse

Credentials cache in '/home/bosse/.subversion' contains 1 credential

On the Ubuntu server on the same LAN as the main svn server, the server that
asks for my password every time:

$ svn auth
------------------------------------------------------------------------
Credential kind: svn.simple
Authentication realm: <https://mainserver:443> VisualSVN Server
Password cache: gpg-agent
Username: bosse

------------------------------------------------------------------------
Credential kind: svn.simple
Authentication realm: <https://svn.mirrorserver.com:443> Subversion Repository
Password cache: gpg-agent
Username: bosse

------------------------------------------------------------------------
Credential kind: svn.ssl.server
Authentication realm: https://mainserver:443
Subject: CN=mainserver, O=Companyname, OU=R&D, ST=Texas, L=Austin
Valid from: 2017-12-13 03:44:07 -0600 (Wed, 13 Dec 2017)
Valid until: 2027-12-11 03:44:07 -0600 (Sat, 11 Dec 2027)
Issuer: CN=mainserver, O=Companyname, OU=R&D, ST=Texas, L=Austin
Fingerprint: c3f454ff18557e37cdc50499ecc5dd8081a943bb
Hostnames: mainserver
Automatic certificate validity check failed because:
  The certificate issuer is unknown.

Credentials cache in '/home/bosse/.subversion' contains 3 credentials


On my Linux servers the files $HOME/.subversion/config does not contain any
active lines.
The file servers on the mirror server is also all commented out, but I have this
on the server on the main network:

[global]
store-passwords = yes

Everything else are just comments.

How can I enable a working password cache on my Linux server which is no the
main network? It must *not* be tied to any desktop only system.

The problem server on the *main network* shows this:

$ svn --version
svn, version 1.14.1 (r1886195)
   compiled May 21 2022, 10:52:35 on x86_64-pc-linux-gnu
....
The following authentication credential caches are available:

* Gnome Keyring
* GPG-Agent
* KWallet (KDE)

How do I enable something that works in a commandline-only setting?

My mirror server has this:

$ svn --version
svn, version 1.14.3 (r1914484)
   compiled Apr  1 2024, 04:55:49 on x86_64-pc-linux-gnu
....
The following authentication credential caches are available:

* Plaintext cache in /home/bosse/.subversion
* Gnome Keyring
* GPG-Agent
* KWallet (KDE)

So there is a small difference... (but I believe KDE is a GUI thing, right?)


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Daniel Sahlberg <da...@gmail.com>.
lör 11 jan. 2025 kl. 23:31 skrev Bo Berglund <bo...@gmail.com>:

> On Thu, 9 Jan 2025 15:20:46 +0100, Johan Corveleyn <jc...@gmail.com>
> wrote:
>
> >On Thu, Jan 9, 2025 at 1:26?PM Daniel Sahlberg
> ><da...@gmail.com> wrote:
> >...
> >> The only solution that will make sure you actually have a working sync
> >> is to monitor that the sync script completes without errors. Maybe you
> >> could have a script that looks for the svn:sync-lock property (something
> >> like svn proplist -v --revprop -r0 http://remote.server.tld/svn/repo)
> >> at a time when the sync SHOULD have completed?
> >
> >Or perhaps try to run some daily / weekly "verification" script that
> >runs "svnlook youngest %PATH_TO_REPO%" or "svnadmin info
> >%PATH_TO_REPO%" on both sides and compares the results (or simply
> >mails them to you as a first step). Adding an "svnadmin verify" and an
> >"svnadmin pack" might be useful too.
>
> Well based on these ideas I guess I could run a checking script on a linux
> server on the company LAN (with access to the main svn server) like this:
> ---------------------------------------------------------------
> #!/bin/bash
> MAIN=$(svn info  https://agiengineering/svn/hw | grep Revision:)
> MIRROR=$(svn info https://svn.boberglund.com/svn/hw | grep Revision:)
>
> #!/bin/bash
> MAIN=$(svn info https://mainserver/svn/hw | grep Revision:)
> MIRR=$(svn info https://svn.mirrorserver.com/svn/hw | grep Revision:)
> if [ "$MAIN" != "$MIRR"  ]; then  #Different revisions, sync failed
> #So call website script which will send alert message.
>
> eval "curl -m 10 --data \"main=$MAIN"\  --data \"mirror=$MIRROR\"
> https://www.mydomain.com/php/svnsyncerror.php"
> ---------------------------------------------------------------
>
> And the php script would then send a message to me about the diff between
> the
> repos.
>
> OUCH!
>
> When testing this script (without the curl call) on the only Linux server
> I have
> on the same LAN as the main svn Windows server I got into a problem since
> svn
> keeps asking for the password all the time!
> After entering the password it works as expected but it asks again the
> next time
> I test!
>
> I thought that svn would cache a successful password so it does not have
> to be
> entered again. That is how it works on both the main server (windows) and
> the
> mirror server.
>
> But it is not working on the Ubuntu server on the main LAN.
> What can I do in order for the script to run without asking for my
> password?
> Svn version on the linux server is:  1.14.1
>
> I have not used svn on that machine previously as far as I can remember...
> It is used as an OpenVPN server.
> And it is a *server* without any desktop. The only way to work on it is
> via an
> SSH terminal (like PuTTY).
>
> I have enabled the following line in $HOME/.subversion/servers:
>
> [global]
> store-passwords = yes
>
> Any ideas?
>
> (I don't know how to craft a Windows bat file to do the checking above so
> that
> is why I turned to the Linux server...)


See
https://subversion.apache.org/faq.html#plaintext-passwords, in particular
"I want to use the Plaintext cache but it wasn't enabled at compile time."

Cheers
Daniel

Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Thu, 9 Jan 2025 15:20:46 +0100, Johan Corveleyn <jc...@gmail.com> wrote:

>On Thu, Jan 9, 2025 at 1:26?PM Daniel Sahlberg
><da...@gmail.com> wrote:
>...
>> The only solution that will make sure you actually have a working sync
>> is to monitor that the sync script completes without errors. Maybe you
>> could have a script that looks for the svn:sync-lock property (something
>> like svn proplist -v --revprop -r0 http://remote.server.tld/svn/repo)
>> at a time when the sync SHOULD have completed?
>
>Or perhaps try to run some daily / weekly "verification" script that
>runs "svnlook youngest %PATH_TO_REPO%" or "svnadmin info
>%PATH_TO_REPO%" on both sides and compares the results (or simply
>mails them to you as a first step). Adding an "svnadmin verify" and an
>"svnadmin pack" might be useful too.

Well based on these ideas I guess I could run a checking script on a linux
server on the company LAN (with access to the main svn server) like this:
---------------------------------------------------------------
#!/bin/bash
MAIN=$(svn info  https://agiengineering/svn/hw | grep Revision:)
MIRROR=$(svn info https://svn.boberglund.com/svn/hw | grep Revision:)

#!/bin/bash
MAIN=$(svn info https://mainserver/svn/hw | grep Revision:)
MIRR=$(svn info https://svn.mirrorserver.com/svn/hw | grep Revision:)
if [ "$MAIN" != "$MIRR"  ]; then  #Different revisions, sync failed
#So call website script which will send alert message.

eval "curl -m 10 --data \"main=$MAIN"\  --data \"mirror=$MIRROR\"
https://www.mydomain.com/php/svnsyncerror.php"
---------------------------------------------------------------

And the php script would then send a message to me about the diff between the
repos.

OUCH!

When testing this script (without the curl call) on the only Linux server I have
on the same LAN as the main svn Windows server I got into a problem since svn
keeps asking for the password all the time!
After entering the password it works as expected but it asks again the next time
I test!

I thought that svn would cache a successful password so it does not have to be
entered again. That is how it works on both the main server (windows) and the
mirror server.

But it is not working on the Ubuntu server on the main LAN.
What can I do in order for the script to run without asking for my password?
Svn version on the linux server is:  1.14.1

I have not used svn on that machine previously as far as I can remember...
It is used as an OpenVPN server.
And it is a *server* without any desktop. The only way to work on it is via an
SSH terminal (like PuTTY).

I have enabled the following line in $HOME/.subversion/servers:

[global]
store-passwords = yes

Any ideas?

(I don't know how to craft a Windows bat file to do the checking above so that
is why I turned to the Linux server...)


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Andreas Stieger <An...@gmx.de>.
On 2025-01-09 15:20, Johan Corveleyn wrote:
> On Thu, Jan 9, 2025 at 1:26 PM Daniel Sahlberg
> <da...@gmail.com> wrote:
> ...
>> The only solution that will make sure you actually have a working sync is to monitor that the sync script completes without errors. Maybe you could have a script that looks for the svn:sync-lock property (something like svn proplist -v --revprop -r0 http://remote.server.tld/svn/repo) at a time when the sync SHOULD have completed?
> Or perhaps try to run some daily / weekly "verification" script that
> runs "svnlook youngest %PATH_TO_REPO%" or "svnadmin info
> %PATH_TO_REPO%" on both sides and compares the results (or simply
> mails them to you as a first step).


Yes, in addition to firing the post-commit hook add some out-of-band
monitoring. Start with svnlook, and give each revision a timeout to
appear globally. I built this quite a while ago, you can make it pretty
if you want:
https://drive.google.com/file/d/0BwYZXCxg9LJablJTQVBlSnhyeHc/view?usp=sharing&resourcekey=0-eAzfrm96zroYAwjIWt44zg

Unfortunately the code is lost in time. This was a three site
replication with transparent write-through proxying:

https://drive.google.com/file/d/0BwYZXCxg9LJaWVpwRTRqVTdtQWM/view?usp=sharing&resourcekey=0-q13rpE749tkcf3w5eHwL3A


Andreas





Re: How to restore repositories from backup server

Posted by Johan Corveleyn <jc...@gmail.com>.
On Thu, Jan 9, 2025 at 1:26 PM Daniel Sahlberg
<da...@gmail.com> wrote:
...
> The only solution that will make sure you actually have a working sync is to monitor that the sync script completes without errors. Maybe you could have a script that looks for the svn:sync-lock property (something like svn proplist -v --revprop -r0 http://remote.server.tld/svn/repo) at a time when the sync SHOULD have completed?

Or perhaps try to run some daily / weekly "verification" script that
runs "svnlook youngest %PATH_TO_REPO%" or "svnadmin info
%PATH_TO_REPO%" on both sides and compares the results (or simply
mails them to you as a first step). Adding an "svnadmin verify" and an
"svnadmin pack" might be useful too.

-- 
Johan

Re: How to restore repositories from backup server

Posted by Daniel Sahlberg <da...@gmail.com>.
Den tors 9 jan. 2025 kl 13:09 skrev Bo Berglund <bo...@gmail.com>:
...

>
> 4) From then on it took a while but it finally reached rev 4521 and exited
> successfully.
>
> Now my two repositories seem to be exactly the same, which is the whole
> purpose.
>

Good, this is exactly what I was expecting - after an intermittent
communication failure the sync would continue.


> WHAT TO DO NOW?
> ----------------
> I realized by seeng this that my problems with the pc repo might be
> because some
> time ago back in 2023 there was something that made it stop like my first
> stop
> during sync and NOT FINISH, just hang there.
>
> That explains the error message I have reported earlier in this thread
> about the
> lock on the repo that stopped future sync operations to complete.
>
> So is there some way to force svnsync to EXIT with an error when there is
> a stop
> in communications or similar? Maybe a timeout value...
> If not then I believe that svnsync cannot be used in an automated fashion
> to
> keep a mirror updated.
>
> Note that whatever can be done must be done on the Windows Server 2016 that
> hosts the main repositories. So methods used on Linux do not apply here.
>
> In order to handle an svnsync hang I need a way to STOP svnsync rather
> than it
> does a halt. It needs to clear the lock when it exits...
>
> Or a way to have a timeout that exits the svnsync application such that a
> log
> can be created and possibly also a forced restart.
>
> But the restart is not important because the sync will run the followiing
> day
> anyway and then the comm problem (if that is the cause) likely is not
> present
> anymore.
>
> Any ideas?
>

I would say there are too many unknown variables to reliably solve this
without resorting to external solutions.

You say that the svnsync process on the Windows side (which, if I
understand your architecture correctly, is the main server) should remove
the lock if the sync hang. But if the sync hang because of a communication
failure - how do you suggest that the sync should contact the remote server
to tell it "I'm done, please remove the lock"? The sync is, from the remote
server's point of view, only a regular commit with a specific user.

The only solution that will make sure you actually have a working sync is
to monitor that the sync script completes without errors. Maybe you could
have a script that looks for the svn:sync-lock property (something like svn
proplist -v --revprop -r0 http://remote.server.tld/svn/repo) at a time when
the sync SHOULD have completed?

Kind regards,
Daniel

Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Wed, 08 Jan 2025 15:02:51 +0100, Bo Berglund <bo...@gmail.com> wrote:

>Where can I find a howto that is used with Apache SVN to do the sync config
>properly?

So I asked ChatGPT and got a reply which I checked against the svnbook and the
state of my existing working repositories.

This way I could create a new empty pc repository on the mirror and have the
hooks set up like on the other repos to allow only user svnsync etc.

Then after initializing this as a sync target (done from the main server's
command line) I started a sync operation and it seemed to work OK albeit a bit
slow, but that is probably because big binaries are part of some revisions.
4521 revisions in all should be mirrored.

To do the sync I used a command that was present in the batch file used nightly
to sync all 10 repositories. I showed that earlier in this thread.

RESULT when doing the first sync:
---------------------------------
1) After about 550 revs it stalled without any message on screen!
I waited about an hour and nothing happened, so I entered Ctrl-C into the window
hoping to stop the operation, but instead it continued happily with the next
rev!
Very strange and no info on why it stopped....

2) Later on when it reached rev 1865 it exited with the following error message:
svnsync: E1752002: REPORT request on '/svn/pc/!svn/rev/1866' failed
This was both an error message and a full stop.

3) At this time I repeated the original sync command and it restarted by
transmitting the 1865 data then moved on to rev 1866

4) From then on it took a while but it finally reached rev 4521 and exited
successfully.

Now my two repositories seem to be exactly the same, which is the whole purpose.

WHAT TO DO NOW?
----------------
I realized by seeng this that my problems with the pc repo might be because some
time ago back in 2023 there was something that made it stop like my first stop
during sync and NOT FINISH, just hang there.

That explains the error message I have reported earlier in this thread about the
lock on the repo that stopped future sync operations to complete.

So is there some way to force svnsync to EXIT with an error when there is a stop
in communications or similar? Maybe a timeout value...
If not then I believe that svnsync cannot be used in an automated fashion to
keep a mirror updated.

Note that whatever can be done must be done on the Windows Server 2016 that
hosts the main repositories. So methods used on Linux do not apply here.

In order to handle an svnsync hang I need a way to STOP svnsync rather than it
does a halt. It needs to clear the lock when it exits...

Or a way to have a timeout that exits the svnsync application such that a log
can be created and possibly also a forced restart.

But the restart is not important because the sync will run the followiing day
anyway and then the comm problem (if that is the cause) likely is not present
anymore.

Any ideas?


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Wed, 08 Jan 2025 12:10:33 +0100, Bo Berglund <bo...@gmail.com> wrote:

>Regarding repository names, are they stored anywhere internally in the repo or
>is it just the top level directory name?
>
>If it is "just a name" then I should be able to rename the existing mirror dir
>and then create a new "pc" repo destined to be set to become a synced repo
>according to the directions in the svnbook.
>And then presumably the sync will go from there.
>

Semantic question:
When I talk about repositories I mean the directories *below* /var/lib/svn/

These dirs (each serve different purposes) each is a subversion repository,
right?
So these are the repositories.
like:

/var/lib/svn----private
             |--pc
             |--marketing
             |--engineering
             |--sales
             |--cad
             |--doc
etc...

And what I want to do is rename the directory pc to pcold, then create a new
repository named pc. Which creates and populates a new pc dir.

According to the svnbook it is done like this:

svnadmin create /var/svn/svn-mirror

(where the path in my case is: /var/lib/svn/pc)

But svnadmin create /var/lib/svn/pc throws a *permission error* and when I use
sudo to do it then the new dir with files and subdirs are owned by root:root!

So I had to change owner:group to www-data:www-data recursively for the new dir
pc and its content...

Obviously I am not doing this correctly...

Do I have to be a member of the www-data group? Right now:

$ groups
bosse adm cdrom sudo dip plugdev lxd sambashare lpadmin nut
(no www-data)


The Linux server I am using has Apache SVN installed and that is what gives the
https: connectivity.

And if I use my Windows PC browser and go to the svn link I can access the pc
dir but it is empty and on revision 0. (as expected)
(The renamed repo pcold is also available via the browser...)

But I am on an ssh terminal logged on as myself (a sudoer) (using PuTTY on
Windows) when I manipulate the Linux server..

The problems continue on like this when I start creating the hook scripts as
links to the existing scripts, so I had to stop and ask for advice...

Where can I find a howto that is used with Apache SVN to do the sync config
properly?

Right now I have this:

$ ll /var/lib/svn/pc
total 32
drwxr-xr-x  6 www-data www-data 4096 2025-01-08 13:50 .
drwxr-xr-x 16 root     root     4096 2025-01-08 13:50 ..
drwxr-xr-x  2 www-data www-data 4096 2025-01-08 13:50 conf
drwxr-sr-x  6 www-data www-data 4096 2025-01-08 13:50 db
-r--r--r--  1 www-data www-data    2 2025-01-08 13:50 format
drwxr-xr-x  2 www-data www-data 4096 2025-01-08 14:13 hooks
drwxr-xr-x  2 www-data www-data 4096 2025-01-08 13:50 locks
-rw-r--r--  1 www-data www-data  246 2025-01-08 13:50 README.txt

and

$ ll /var/lib/svn/pc/hooks
total 52
drwxr-xr-x 2 www-data www-data 4096 2025-01-08 14:13 .
drwxr-xr-x 6 www-data www-data 4096 2025-01-08 13:50 ..
-rwxr-xr-x 1 www-data www-data 2634 2025-01-08 13:50 post-commit.tmpl
-rwxr-xr-x 1 www-data www-data 2773 2025-01-08 13:50 post-lock.tmpl
-rwxr-xr-x 1 www-data www-data 2994 2025-01-08 13:50 post-revprop-change.tmpl
-rwxr-xr-x 1 www-data www-data 2605 2025-01-08 13:50 post-unlock.tmpl
-rwxr-xr-x 1 www-data www-data 4038 2025-01-08 13:50 pre-commit.tmpl
-rwxr-xr-x 1 www-data www-data 3621 2025-01-08 13:50 pre-lock.tmpl
-rwxr-xr-x 1 www-data www-data  562 2025-01-08 14:12 pre-revprop-change <==Local
-rwxr-xr-x 1 www-data www-data 3469 2025-01-08 13:50 pre-revprop-change.tmpl
-rwxr-xr-x 1 www-data www-data 3309 2025-01-08 13:50 pre-unlock.tmpl
-rwxr-xr-x 1 www-data www-data  521 2025-01-08 14:13 start-commit <==Local
-rwxr-xr-x 1 www-data www-data 3754 2025-01-08 13:50 start-commit.tmpl

TIA


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Wed, 8 Jan 2025 11:16:08 +0100, Daniel Sahlberg <da...@gmail.com>
wrote:

>Den ons 8 jan. 2025 kl 10:59 skrev Bo Berglund <bo...@gmail.com>:
>
>> If I create a new empty target repository on the mirror server and
>> configure it
>> to be used for syncing, then how long will it take to do the initial sync?
>>
>
>> The problem is that it is VERY big (14 GB) and the server and mirror are
>> separated by the Atlantic so all comm need to be going through the internet
>> etc...
>>
>
>That's not "very big" with today's measures (at least unless you are paying
>per GB transfered). I have successfully synced TortoiseSVN's repo - it is
>"only" 1.4 GB but on the other hand has almost 30'000 (small) revisions. It
>took the better part of a day, but that is because the sync does one
>revision at a time. Since you have fewer but bigger revisions, I would
>suspect it to take a lot less time.

I know that there are binaries (excutable files) stored along with the sources
so those are one big item at a time, I guess...

>It sounds like a good plan to make a new repository and re-initialize the
>sync. You probably put yourself in this situation by trying to load a dump
>on the backup server. Maybe if you look at the properties on -r0 (as
>described in the SVN book), you can make Subversion "think" that both
>repositories are equal (which they SHOULD be if you made everything
>correct).


Regarding repository names, are they stored anywhere internally in the repo or
is it just the top level directory name?

If it is "just a name" then I should be able to rename the existing mirror dir
and then create a new "pc" repo destined to be set to become a synced repo
according to the directions in the svnbook.
And then presumably the sync will go from there.

One item I am not sure of is the "syncuser" password, it seems to be in use yet
I see nothing about it in the batch command used and I don't even remember it
now since I originally set it up back in 2018...
Is syncuser a repository local user or is it an svn user in general?


>
>>
>> Is it not possible to load a synced repo using an initial dump file from
>> the
>> source and so load the mirror locally without having to worry about
>> connectivity
>> issues during the massive start operation?
>>
>
>I'm guessing here but I think that it would work. But I'd probably save
>myself some trouble and let svnsync do the work. It is "only" a matter of
>bandwidth and waiting for the sync to complete, whereas fiddling with a
>dump file means man-hours for you.

Right, I have already spent a lot of hours trying to figure out the
repercussions of the server crash...

I have a 1000/1000 MBPS fiber connection here but I believe the company
connection is a bit slower. I worried about any interruptions during the first
sync potentially destroying the new repo...

>
>Even if you loose connectivity again (and end up with a stale lock), you
>should be able to steal the lock and re-start from where it stopped - you
>don't need to do this in one big operation.
>
Hopefully it won't stup...

Thanks!


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Daniel Sahlberg <da...@gmail.com>.
Den ons 8 jan. 2025 kl 10:59 skrev Bo Berglund <bo...@gmail.com>:

> If I create a new empty target repository on the mirror server and
> configure it
> to be used for syncing, then how long will it take to do the initial sync?
>

> The problem is that it is VERY big (14 GB) and the server and mirror are
> separated by the Atlantic so all comm need to be going through the internet
> etc...
>

That's not "very big" with today's measures (at least unless you are paying
per GB transfered). I have successfully synced TortoiseSVN's repo - it is
"only" 1.4 GB but on the other hand has almost 30'000 (small) revisions. It
took the better part of a day, but that is because the sync does one
revision at a time. Since you have fewer but bigger revisions, I would
suspect it to take a lot less time.

It sounds like a good plan to make a new repository and re-initialize the
sync. You probably put yourself in this situation by trying to load a dump
on the backup server. Maybe if you look at the properties on -r0 (as
described in the SVN book), you can make Subversion "think" that both
repositories are equal (which they SHOULD be if you made everything
correct).


>
> Is it not possible to load a synced repo using an initial dump file from
> the
> source and so load the mirror locally without having to worry about
> connectivity
> issues during the massive start operation?
>

I'm guessing here but I think that it would work. But I'd probably save
myself some trouble and let svnsync do the work. It is "only" a matter of
bandwidth and waiting for the sync to complete, whereas fiddling with a
dump file means man-hours for you.

Even if you loose connectivity again (and end up with a stale lock), you
should be able to steal the lock and re-start from where it stopped - you
don't need to do this in one big operation.

Cheers,
Daniel

Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Tue, 7 Jan 2025 22:20:59 +0100, Daniel Sahlberg <da...@gmail.com>
wrote:

>> In the batch file the command is created at the start and then used for all
>> repos going down the file. Here is how it is defined (again wrapped lines):
>>
>> rem If a repository is not synced due to a lock problem, then use
>> --steal-lock
>> in a manual command
>>
>> rem SET SYNCCMD="C:\Program Files\VisualSVN Server\bin\svnsync.exe"
>> synchronize
>> --steal-lock --sync-username syncuser
>>
>> SET SYNCCMD="C:\Program Files\VisualSVN Server\bin\svnsync.exe" synchronize
>> --sync-username syncuser
>>
>> What looks like a commented out suggestion about --steal-locks may or may
>> not
>> apply here, what does it mean an how to use it?
>>
>
>Yes, --steal-lock would be the solution here. You should read up on the SVN
>Book, see the section "svnsync Bookkeeping" for a more detailed
>explaination:
>https://svnbook.red-bean.com/en/1.7/svn.reposadmin.maint.html#svn.reposadmin.maint.replication.svnsync

I looked at the svnbook and it mentions the needed hooks so I checked them:

I found the pc start-commit being a symlink to a start-commit that looks like
this and is common to all repos:
---------------------
#!/bin/sh
# Bo Berglund 2018-03-25

USER="$2"

if [ "$USER" = "syncuser" ]; then exit 0; fi

echo "Only the syncuser user may commit new revisions" >&2
exit 1
--------------------

And the other hook pre-revprop-change is also a symlink to a common script with
this content, only difference is where the user appears on the command line:
--------------------
#!/bin/sh
# Bo Berglund 2018-03-25

USER="$3"

if [ "$USER" = "syncuser" ]; then exit 0; fi

echo "Only the syncuser user may change revision properties" >&2
exit 1
--------------------

Since they are one and the same script for all synced repos this could not be
the problem....

But maybe this passage in svnbook is:

[quote]
The svnsync synchronize subcommand will peek into the special revision
properties previously stored on the target repository and determine how much of
the source repository has been previously mirrored—in this case, the most
recently mirrored revision is r0. Then it will query the source repository and
determine what the latest revision in that repository is. Finally, it asks the
source repository's server to start replaying all the revisions between 0 and
that latest revision. As svnsync gets the resultant response from the source
repository's server, it begins forwarding those revisions to the target
repository's server as new commits.
[/quote]

Since there has been "stuff" done to the source repo due to the failure to get
all latest revisions I suspect that the revision numbers now are in disarray...

And that might have happened more than a year ago without affecting anything
except the sync between source and mirror on this single repo...

If that is the case then it might be a problem going forward except by starting
over with this repository by creating a new recipient repo.

If I create a new empty target repository on the mirror server and configure it
to be used for syncing, then how long will it take to do the initial sync?

The problem is that it is VERY big (14 GB) and the server and mirror are
separated by the Atlantic so all comm need to be going through the internet
etc...

Is it not possible to load a synced repo using an initial dump file from the
source and so load the mirror locally without having to worry about connectivity
issues during the massive start operation?


>
>>
>> >> HOW to fix this?
>> >
>> >> Could I proceed like this:
>> >>
>> >> 1- Make a repo dump on the main server and load that into the mirror.
>> >>   That should bring the mirror to rev 4518 (same as main)
>> >
>> >> 2- Check out the involved 3 projects fresh from the main repo
>> >>
>> >> 3- Using the emailings as base commit the same files as are listed there
>> >>   Thus recreating the 10 revisions that are missing.
>> >>
>> >> 4- Perform a manual sync to the mirror repo to bring that to rev 4528
>>
>
>I would not do a manual dump/load but rather resolve the lock and do an
>svnsync syncronize-run to bring the repo up to the same revision as main.

OK, but now I have done the above and on the source it looks all OK, but not on
the mirror....

So restarting the mirroring seems like the only way to go now....


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Daniel Sahlberg <da...@gmail.com>.
Den tis 7 jan. 2025 kl 22:08 skrev Bo Berglund <bo...@gmail.com>:

>
> This is how the execution went (long lines are wrapped by my newsreader):
>
> H:\>"C:\Program Files\VisualSVN Server\bin\svnsync.exe" synchronize
> --sync-username syncuser https://svn.mydomain.com/svn/pc
> https://agiengineering/svn/pc
>
> Failed to get lock on destination repos, currently held by
> 'AGIENGINEERING:4b3622e3-1724-2d47-9cdd-82690ad1fe60'
>
> repeated 10 times....
>
> Failed to get lock on destination repos, currently held by
> 'AGIENGINEERING:4b3622e3-1724-2d47-9cdd-82690ad1fe60'
>
> svnsync: E000022: Couldn't get lock on destination repos after 10 attempts
>
> So I also tested on another repository:
>
> H:\>"C:\Program Files\VisualSVN Server\bin\svnsync.exe" synchronize
> --sync-username syncuser https://svn.mydomain.com/svn/pcb
> https://agiengineering/svn/pcb
>
> Here there are no errors at all...
>
> In the batch file the command is created at the start and then used for all
> repos going down the file. Here is how it is defined (again wrapped lines):
>
> rem If a repository is not synced due to a lock problem, then use
> --steal-lock
> in a manual command
>
> rem SET SYNCCMD="C:\Program Files\VisualSVN Server\bin\svnsync.exe"
> synchronize
> --steal-lock --sync-username syncuser
>
> SET SYNCCMD="C:\Program Files\VisualSVN Server\bin\svnsync.exe" synchronize
> --sync-username syncuser
>
> What looks like a commented out suggestion about --steal-locks may or may
> not
> apply here, what does it mean an how to use it?
>

Yes, --steal-lock would be the solution here. You should read up on the SVN
Book, see the section "svnsync Bookkeeping" for a more detailed
explaination:
https://svnbook.red-bean.com/en/1.7/svn.reposadmin.maint.html#svn.reposadmin.maint.replication.svnsync

It seems someone already prepared for this situation in your script so just
un-rem the first of the two lines and add a rem to the second line to force
--steal-lock this time. Then revert the change for the regular scheduled
sync.

The reason for all this is probably that a previous sync was interrupted
halfway through while the lock was still set on the target repo.

>> And it is a single operation on the main server that runs these sync
> operations.
> >>
> There is one TaskScheduler call to run the batch file that sets up the call
> string and then applies it to each repository in turn.
>
> Unfortunately there is no error handling in the batch file as yet.
> I don't know how to do that in a Windows environment, in Linux I have done
> it
> often and there I can make a curl call to my webserver where I have a php
> script
> that can send me an email with the supplied text.
>

Curl is available on Windows and you can probably do the same in a BAT
file. Else look at monitoring the Event log in Windows, you would probably
see some errors there (at least if you set a proper error exit code using
the exit command (see exit /?) in case of errors).


>
> >> HOW to fix this?
> >
> >> Could I proceed like this:
> >>
> >> 1- Make a repo dump on the main server and load that into the mirror.
> >>   That should bring the mirror to rev 4518 (same as main)
> >
> >> 2- Check out the involved 3 projects fresh from the main repo
> >>
> >> 3- Using the emailings as base commit the same files as are listed there
> >>   Thus recreating the 10 revisions that are missing.
> >>
> >> 4- Perform a manual sync to the mirror repo to bring that to rev 4528
>

I would not do a manual dump/load but rather resolve the lock and do an
svnsync syncronize-run to bring the repo up to the same revision as main.

Cheers,
Daniel

Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Tue, 07 Jan 2025 22:08:33 +0100, Bo Berglund <bo...@gmail.com> wrote:

>In the batch file the command is created at the start and then used for all
>repos going down the file. Here is how it is defined (again wrapped lines):
>
>rem If a repository is not synced due to a lock problem, then use --steal-lock
>in a manual command
>
>rem SET SYNCCMD="C:\Program Files\VisualSVN Server\bin\svnsync.exe" synchronize
>--steal-lock --sync-username syncuser
>
>SET SYNCCMD="C:\Program Files\VisualSVN Server\bin\svnsync.exe" synchronize
>--sync-username syncuser
>
>What looks like a commented out suggestion about --steal-locks may or may not
>apply here, what does it mean an how to use it?


I tried it and got another set of error messages:

H:\>"C:\Program Files\VisualSVN Server\bin\svnsync.exe" synchronize --steal-lock
--sync-username syncuser https://svn.mydomain.com/svn/pc
https://agiengineering/svn/pc

Stole lock previously held by
'AGIENGINEERING:4b3622e3-1724-2d47-9cdd-82690ad1fe60'
svnsync: E000022: Revision being currently copied (4499), last merged revision
(4498), and destination HEAD (4518) are inconsistent; have you committed to the
destination without using svnsync?

What to do now?
Am I hosed or is there some repair possibility?

Should I dump the full pc repo in its present state and recreate it from scratch
on the mirror after deleting it?

What are the steps to do that?

-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Bo Berglund <bo...@gmail.com>.
On Tue, 7 Jan 2025 04:22:43 -0600, Ryan Carsten Schmidt
<su...@ryandesign.com> wrote:

>On Jan 7, 2025, at 03:48, Bo Berglund wrote:
>> 
>> It seems like the sync was not really done for this repo for a long time even
>> though the nightly sync operation actually was working for all the other repos
>> where the mirror contains commits done up to the server crash...
>
>Indeed!
>

Today I have restored the repository using the dump files from the mirror and
then for the pc repo which had not synced for a long while I did the inverse and
took a dump from the main server and loaded it into the mirror.

Then I also did a few manual commits using the commit emails I had from the last
20 or so commits on the server as guide so I could enter the missing information
and also the commit messages which I copied from tyhe emails.

In the end my main server was restored to the state when the crash happened.

So I decided to try a manual version of the nightly sync call for the pc repo.
I took the command from the bat file otherwise called each night.

This is how the execution went (long lines are wrapped by my newsreader):

H:\>"C:\Program Files\VisualSVN Server\bin\svnsync.exe" synchronize
--sync-username syncuser https://svn.mydomain.com/svn/pc
https://agiengineering/svn/pc

Failed to get lock on destination repos, currently held by
'AGIENGINEERING:4b3622e3-1724-2d47-9cdd-82690ad1fe60'

repeated 10 times....

Failed to get lock on destination repos, currently held by
'AGIENGINEERING:4b3622e3-1724-2d47-9cdd-82690ad1fe60'

svnsync: E000022: Couldn't get lock on destination repos after 10 attempts

So I also tested on another repository:

H:\>"C:\Program Files\VisualSVN Server\bin\svnsync.exe" synchronize
--sync-username syncuser https://svn.mydomain.com/svn/pcb
https://agiengineering/svn/pcb

Here there are no errors at all...

In the batch file the command is created at the start and then used for all
repos going down the file. Here is how it is defined (again wrapped lines):

rem If a repository is not synced due to a lock problem, then use --steal-lock
in a manual command

rem SET SYNCCMD="C:\Program Files\VisualSVN Server\bin\svnsync.exe" synchronize
--steal-lock --sync-username syncuser

SET SYNCCMD="C:\Program Files\VisualSVN Server\bin\svnsync.exe" synchronize
--sync-username syncuser

What looks like a commented out suggestion about --steal-locks may or may not
apply here, what does it mean an how to use it?


>> And it is a single operation on the main server that runs these sync operations.
>> 
There is one TaskScheduler call to run the batch file that sets up the call
string and then applies it to each repository in turn.

Unfortunately there is no error handling in the batch file as yet.
I don't know how to do that in a Windows environment, in Linux I have done it
often and there I can make a curl call to my webserver where I have a php script
that can send me an email with the supplied text.

>> HOW to fix this?
>
>> Could I proceed like this:
>> 
>> 1- Make a repo dump on the main server and load that into the mirror.
>>   That should bring the mirror to rev 4518 (same as main)
>
>> 2- Check out the involved 3 projects fresh from the main repo
>> 
>> 3- Using the emailings as base commit the same files as are listed there
>>   Thus recreating the 10 revisions that are missing.
>> 
>> 4- Perform a manual sync to the mirror repo to bring that to rev 4528

This step is what fails!


-- 
Bo Berglund
Developer in Sweden


Re: How to restore repositories from backup server

Posted by Ryan Carsten Schmidt <su...@ryandesign.com>.
On Jan 7, 2025, at 03:48, Bo Berglund wrote:
> 
> It seems like the sync was not really done for this repo for a long time even
> though the nightly sync operation actually was working for all the other repos
> where the mirror contains commits done up to the server crash...

Indeed!


> And it is a single operation on the main server that runs these sync operations.
> 
> HOW to fix this?

> Couild I proceed like this:
> 
> 1- Make a repo dump on the main server and load that into the mirror.
>   That should bring the mirror to rev 4518 (same as main)

You could, but I'd try to figure out what problem the sync process is encountering, and fix it so that you can then sync the remaining revisions. And also fix the problem that the error was not communicated to you when it first happened. Is the sync process sending you an email with errors and it's not arriving? Being classified as spam? Or is no email being sent? Does it log errors and are you checking that error log? Etc. 


> 2- Check out the involved 3 projects fresh from the main repo
> 
> 3- Using the emailings as base commit the same files as are listed there
>   Thus recreating the 10 revisions that are missing.
> 
> 4- Perform a manual sync to the mirror repo to bring that to rev 4528
> 
> Is there some caveat (apart from, getting the wrong dates into the revisions)?

That sounds good. You can manually set the svn:date revision property to the proper historical date if you like, possibly after first writing a pre-revprop-change hook to allow it if you don't already have one that does that. 

Your recreated revisions will probably not be an exact match for the original revisions, and if they aren't, everyone who had working copies of this repo will have to trash them and check out new ones. 


> And *how* could this have happened and for such a long time?

We would have to see whatever error messages your sync process is generating to be able to say how to fix it. 

Re: How to restore repositories from backup server

Posted by Johan Corveleyn <jc...@gmail.com>.
On Tue, Jan 7, 2025 at 10:48 AM Bo Berglund <bo...@gmail.com> wrote:
...
> I have also checked the commit emails for this repo and those show another set
> of commits done for revs 4519 to 4528 between 2024-08-14-2024-12-01, which is
> where the mirror should be now. But isn't....
>
>
> Command svn info on the *main server* shows this:
>
> Repository Root: https://agiengineering/svn/pc
> Repository UUID: 1e489663-c639-2248-90da-e976bc628839
> Revision: 4518
> Node Kind: directory
> Last Changed Author: bosse
> Last Changed Rev: 4518
> Last Changed Date: 2023-12-05 04:12:11 -0600 (Tue, 05 Dec 2023)

Shouldn't this be at revision 4528 by now (given your explanation
above), with a Last Changed Date somewhere in 2024? So your main
server is also (a year) behind? Where did those revisions between 4519
and 4528 land then?

> And the same mirror repo that should have been synced to the mirror server many
> time during the fall:
>
> Repository Root: https://svn.mydomain.com/svn/pc
> Repository UUID: e8e82d8e-9267-4f7b-8f11-ddd3f99e352f
> Revision: 4498
> Node Kind: directory
> Last Changed Author: bosse
> Last Changed Rev: 4498
> Last Changed Date: 2023-03-28 20:59:05 +0200 (Tue, 28 Mar 2023)

Strange indeed.

Now, to eliminate all possible confusion of whether you are looking at
a working copy (which might not be fully up to date) instead of the
repository, I would suggest running 'svnadmin info $REPOS_PATH' or
'svnlook youngest $REPOS_PATH' on the server, instead of 'svn info
$URL'. Probably will give you the same information, but can't hurt to
doublecheck that way.

-- 
Johan