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

the urbackup_api_test.py script has corrupted the configuration of global parameters #19

Open
MaxiReglisse opened this issue Jan 10, 2024 · 2 comments

Comments

@MaxiReglisse
Copy link

Dear developers, I wish you a happy new year 2024! and at the same time I'd like to share with you the problem I recently encountered.

After running the urbackup_api_test.py script, the global parameters of my Urbackup instance ended up with numerous json arrays instead of the expected valid data.

I described the problem on the Urbackup user forum. The valid data had been replaced by json tables, like this:

Default directories to back up: /etc; /root; /home
instead of:
Default directories to back up: {'value': '/etc;/home;/root'}

What's unusual is that the problem was propagated to all Internet clients (and not to clients on the local network). For example, one client's group authentication key became internet_authkey.group={'value': 'Fg5YCmMtyV'} instead of internet_authkey.group='Fg5YCmMtyV'.

Here’s a pastebin link where you’ll find a trace of the API test script execution a few days ago. 🙄

Is it possible that it was really the script that caused the damage? if so, it needs to be corrected urgently...
For my part, I've completely reinstalled the Urbackup Server instance.

subsidiary question: would restoring the settings table in the backup_server_settings.db database have made it possible to go back?

Thanks in advance for your feedback.

Ernest.

@jmanuel1
Copy link

jmanuel1 commented Feb 16, 2024

I think I'm encountering this problem, too. I'm trying to use this package to reliably reproduce the global settings. I tried resetting the settings by removing the {'value': <data>} wrapper before calling set_global_setting, but that didn't fix things. Since that method fetches the settings (which have those dictionaries with "value" keys) and modifies that dict, then sends it back to the server, maybe I shouldn't have expected it to solve my solutions.

I speculate that if I save all the settings through the API at once, without the extra dictionaries, at least some of my settings will be repaired.

@jmanuel1
Copy link

@uroni I exported the settings table from my settings database as CSV and see rows like this:

archive,"{'value': '{\'value\': \'{\\\'value\\\': ""{\\\'value\\\': \\\'\\\'}""}\'}'}",0,"",2,1706681190

Some of the rows have a HUGE number of backslashes, like this:
image

I removed all of the backslashes from the file, and the content of this row is:

update_freq_incr,"{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': '{'value': ""{'value': '18000'}""}'}'}'}'}'}'}'}'}'}'}'}'}'}'}'}'}'}'}'}",0,,2,1706681190

It seems that there's some confusion about what is and is not JSON. And that the values of the settings aren't validated properly...

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

2 participants