Invalid control character in URL (newline) error in backup-agent

Description:

backup-agent logs errors about invalid character (\n) in the Azure storage URL. The secret does not contain the newline:


and even if we put newline into it, the error is the same (with only one \n in it, not two).
I also manually decoded a b64 value of the secret to be 100% sure that it doesn’t contain a newline.
I don’t expect that this is a bug with 100% repro, because the impact would be too big, but maybe anybody encountered such problem? Or maybe you have any idea how to debug it?

Steps to Reproduce:

Setup backups with azure blob storage and provide AZURE_STORAGE_ACCOUNT_KEY and AZURE_STORAGE_ACCOUNT_NAME in secret.

Version:

1.15.0

Logs:

every 5 seconds:
│ 2023-10-26T10:28:40.000+0000 E [agentCheckup] check storage connection: unable to get storage: parse “https://fakestoragename\n.blob.core.windows.net/fakecontainer”: net/url: invalid control character in URL │

Expected Result:

Expected working backups

Actual Result:

Error connecting to blob and no backups performed

Hey @andi9310 ,

can you please try to use -n flag in echo for both base64 strings?

       -n     do not output the trailing newline

So your commands should look like:

echo -n 'YOUR_KEY' | base64 
echo -n 'YOUR_ACCOUNT' | base64 

Seems that trailing newline is added to your account name.
Please let me know if it works.