Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.FormatException: Invalid length for a Base-64 char array or string. #27

Open
phnxfire opened this issue Jun 7, 2017 · 7 comments

Comments

@phnxfire
Copy link

phnxfire commented Jun 7, 2017

I'm trying to perform a copy form AWS S3 to Azure of a simple test.txt file

azurecopy -i https://se.amazonaws.com/ -o https://.blob.core.windows.net/
-azurekey %AzureAccountKey% -s3k %AWSAccessKeyID% -s3sk %AWSSecretAccessKeyID% -blobcopy -db

... and I'm getting error :

GetHandler start
GetHandler retrieved azurecopy.S3Handler
GetHandler start
Unknown error generated. Please report to Github page https://github.com/kpfaulkner/azurecopy/issues . Can view underlyin
race by adding -db flag. System.FormatException: Invalid length for a Base-64 char array or string.
at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Microsoft.WindowsAzure.Storage.Auth.StorageCredentials.UpdateKey(String keyValue, String keyName)

@kpfaulkner
Copy link
Owner

kpfaulkner commented Jun 7, 2017

Hi

What version of azurecopy are you using?
Also, can I get the full stack trace please?

Thanks

Ken

@kpfaulkner
Copy link
Owner

kpfaulkner commented Jun 8, 2017 via email

@phnxfire
Copy link
Author

phnxfire commented Jun 8, 2017

I'm using version 1.3.1.

I believe I'm using the correct URLs. I tried the 'list' command for the S3 and it worked! (It brought a list of the contents of the S3 bucket).

I'm not sure about the correct parameter for 'AzureAccountKey', when I go to Azure console I cannot find a property with this exact name.

@phnxfire
Copy link
Author

phnxfire commented Jun 8, 2017

I tried to perform the 'list' command on the azure storage and I get similar error:

C:>azurecopy -list https://.blob.core.windows.net/ -azurekey %AzureAccountKey% -s3k %AWSAccessKeyID% -s3sk %AWSSecretAccessKeyID% -db
GetHandler start
Unknown error generated. Please report to Github page https://github.com/kpfaulkner/azurecopy/issues . Can view underlying stackt
race by adding -db flag. System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Microsoft.WindowsAzure.Storage.Auth.StorageCredentials.UpdateKey(String keyValue, String keyName)
at azurecopy.Utils.AzureHelper.GetCloudStorageAccount(String url, String accountKey, String accountName)
at azurecopy.Utils.AzureHelper.GetCloudBlobClient(String url, Boolean isSrc, String accountKey)
at azurecopy.AzureHandler..ctor(String url)
at azurecopycommand.Program.GetHandler(UrlType urlType, String url)
at azurecopycommand.Program.DoList(Boolean debugMode)
at azurecopycommand.Program.Main(String[] args)
at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)

@phnxfire
Copy link
Author

phnxfire commented Jun 8, 2017

I'm sorry but the correct version I'm using of ## azurecopy is version 1.4.3.0

@Asfawh
Copy link

Asfawh commented Nov 7, 2018

I have same issue when i use PowerShell and currently am using Version azurecopy-1.5.1,
Error: System.FormatException: The input is not a valid Base-64 string as it con
tains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters

But, it works fine when i use command prompt.

@kpfaulkner
Copy link
Owner

Thanks for the update.

/me puts it on his todo list :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants