Closed IT-Yogi closed 4 years ago
So the culprit seems to be the repo https://bitbucket.org/XXXXXXXXXXX/XXXXXXXXXXX_internetseite.git ?
Do the actual Bitbucket username or repo name by any chance have any "special" characters?
Hey christian, Thanks for the fast reply.
No special characters at all, there are just two underlines "_" at the repo name like: https://bitbucket.org/teamname/customername_web_internetseite.git
Also tried one repo without any special characters, same error:
Backing up source: XXXXXX Git: https://bitbucket.org/teamname/genericsdo.git Unhandled exception. System.FormatException: Input string was not in a correct format.
Also the bitbucket username contains a "-".
I'm still not sure where this exception is thrown and why.
I just created a repository in the test team that I'm using for SCM Backup's integration tests: https://bitbucket.org/scm-backup-testteam/customername_web_internetseite
On my machine, the backup of this runs without issues.
Can you try backing this up on your machine, by replacing the source in the config file by this one?
sources:
- title: issue45test
hoster: bitbucket
type: org
name: scm-backup-testteam
If this fails with the same error, maybe it's something on your machine
--> in this case, could you try it on another machine?
If this works on your machine (but the real one still fails), it's probably about something that specific repository.
In this case, more information would help:
Does the backup of this repository exist in the backup directory?
(-> Restoring your backups -> Folder structure)
The repository URL in the console output is shown before the repository is actually backed up. So the FormatException maybe happens when building the Git commands via string.Format
, and then the actual backup never happened.
You wrote:
If I remove one of our productive git repositorys, scm is able to backup the git-testing-repo and a mercurial repo.
What's the name of the repository you removed here?
Reading your issue again, this looks like the culprit (and not customername_web_internetseite
, because that one was backed up when you removed the other one)
I understand that you don't want to disclose your actual team name and repository names to the whole internet, but knowing the real names would help me find the error.
If you're okay with giving me the names, you can send me via email.
Or even better, send me the whole log file of an application run where the error occurred.
Hey Christian, Many thanks for your support. I was able to find the issue. I tried to set up the backup user as described at your manual. But I used the users email address instead of the username. Mea Culpa! So the authentication with the app password failed and I tried it with the regular user password. With this I was able to connect and your tool was downloading the mercurial repos. So it looks to me that the authentication is fine.
Today I studied your manual once again and noticed my mistake. I inserted username and app password and your tool is now working like a charm. Sorry for the trouble.
Glad to hear it worked for you!
I'd still like to reproduce your error though, so I can catch it in the code and show a meaningful error message instead of that exception.
Can you give me an example how your config file looked like when you got the error?
So far, I wasn't able to reproduce your error.
I tried this configuration (a user/team I'm using for integration tests):
sources:
- title: bitbucket-testorg
hoster: bitbucket
type: org
name: scm-backup-testteam
authName: scm-backup-testuser
password: not-the-real-password
...and replaced the authName
by the actual email from scm-backup-testuser
's Bitbucket settings:
sources:
- title: bitbucket-testorg
hoster: bitbucket
type: org
name: scm-backup-testteam
authName: not-the-real-email@example.com
password: not-the-real-password
...and got a different error message (but no exception like you), way earlier, when trying to authenticate with Bitbucket's API:
SCM Backup 0.0.0-DEV https://scm-backup.org/ Backing up config files Getting repositories for source 'bitbucket-testorg' from hoster 'bitbucket' Authentication failed for not-the-real-email@example.com Backup failed! The application will close in 5 seconds!
So I'm wondering what you did different in your configuration.
Hey Christian, I've done some further investigations. I it is not related to the username as I thought, rather than the password I used. It contains the following characters.
} + , #
I changed it to letters and numbers only and tried it again with the users email address, now I get the error:
URL using bad/illegal format or missing URL
Which seems correct to me, because we need the username. At least, I replaced the email address with the username and the users password. All fine, backup is running.
Small enhancement suggestion: It would be great if you could implement a "Success" or "Failed" Status in the subject of the sent email. So you can see at a glance if your backup was successful or not.
I it is not related to the username as I thought, rather than the password I used. It contains the following characters.
} + , #
Hm. Deserializing a password containing all of these characters works on my machine.
(even though I had expected #
to cause problems. because comments start with #
in YAML)
Still, apparently YAML values should be quoted if they contain certain characters. including some of "your" characters.
So I'll add a notice about quotes to the documentation.
Hi, I'm getting this unhandled exception on my windows system. Authentication and Repository seems fine.
If I remove one of our productive git repositorys, scm is able to backup the git-testing-repo and a mercurial repo.