Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

archive_max_duration - ValueError: could not convert string to float: 'None' #447

Open
pericajakimov opened this issue Aug 13, 2021 · 7 comments

Comments

@pericajakimov
Copy link

pericajakimov commented Aug 13, 2021

Hi,

I have installed v2.0.2 and this is the log:

2021-08-13 11:00:02 INFO [process_runner:69] SUBPROCESS /usr/bin/mysqladmin COMPLETED with exit code: 0
2021-08-13 11:00:02 INFO [check_env:101] OK: /usr/bin/mysql exists
2021-08-13 11:00:02 INFO [check_env:114] OK: /usr/bin/mysqladmin exists
2021-08-13 11:00:02 INFO [check_env:91] OK: MySQL configuration file exists
2021-08-13 11:00:02 INFO [check_env:126] OK: XtraBackup exists
2021-08-13 11:00:02 INFO [check_env:139] OK: Main backup directory exists
2021-08-13 11:00:02 INFO [check_env:167] OK: Full Backup directory exists
2021-08-13 11:00:02 INFO [check_env:179] OK: Increment directory exists
2021-08-13 11:00:02 INFO [check_env:155] OK: Archive folder directory exists
2021-08-13 11:00:02 INFO [check_env:204] OK: Check status
2021-08-13 11:00:02 INFO [backuper:308] - - - - Your full backup is timeout : Taking new Full Backup! - - - -
2021-08-13 11:00:02 INFO [backuper:314] Archiving enabled; cleaning archive_dir & archiving previous Full Backup
2021-08-13 11:00:02 INFO [backup_archive:125] Starting cleaning of old archives
Traceback (most recent call last):
  File "/usr/local/bin/autoxtrabackup", line 11, in <module>
    sys.exit(all_procedure())
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/mysql_autoxtrabackup/autoxtrabackup.py", line 272, in all_procedure
    backup_.all_backup()
  File "/usr/local/lib/python3.6/dist-packages/mysql_autoxtrabackup/backup_backup/backuper.py", line 319, in all_backup
    self.archive_obj.clean_old_archives()
  File "/usr/local/lib/python3.6/dist-packages/mysql_autoxtrabackup/backup_backup/backup_archive.py", line 142, in clean_old_archives
    >= float(str(self.backup_archive_options.get("archive_max_duration")))
ValueError: could not convert string to float: 'None'

And in config file I have:
archive_max_duration = 3 Days

@ShahriyarR
Copy link
Owner

It seems to be something wrong with the archiving feature.
I can fix it tomorrow or late today.
But I guess you can disable this feature for now or do it manually, then proceed.

@pericajakimov
Copy link
Author

pericajakimov commented Aug 13, 2021

I think the problem is here (in /mysql_autoxtrabackup/general_conf/generalops.py):
image

else:
            if self.con.get(section, "archive_max_size", fallback=None):
                archive_max_duration = humanfriendly.parse_timespan(
                    self.con.get(section, "archive_max_size", fallback=None)
                )

you are searching for archive_max_size setting and apply that value for archive_max_duration which is not correct.

@pericajakimov
Copy link
Author

And I've tested, that is it.
"archive_max_size" should be replaced with "archive_max_duration" in the ELSE above.

@ShahriyarR
Copy link
Owner

Could you please send a Pull Request with your changes to contribute? :)

@pericajakimov
Copy link
Author

Sorry, I've changed the file directly on my server and it seems it's working fine for now.
But, you can change this for the next version :)

@ShahriyarR
Copy link
Owner

Congrats on the hot fix :D

@pericajakimov
Copy link
Author

Thanks.
And the next situation is this:

2021-08-13 14:00:02 INFO [check_env:204] OK: Check status
2021-08-13 14:00:02 INFO [backuper:308] - - - - Your full backup is timeout : Taking new Full Backup! - - - -
2021-08-13 14:00:02 INFO [backuper:314] Archiving enabled; cleaning archive_dir & archiving previous Full Backup
2021-08-13 14:00:02 INFO [backup_archive:125] Starting cleaning of old archives
Traceback (most recent call last):
  File "/usr/local/bin/autoxtrabackup", line 11, in <module>
    sys.exit(all_procedure())
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/mysql_autoxtrabackup/autoxtrabackup.py", line 272, in all_procedure
    backup_.all_backup()
  File "/usr/local/lib/python3.6/dist-packages/mysql_autoxtrabackup/backup_backup/backuper.py", line 319, in all_backup
    self.archive_obj.clean_old_archives()
  File "/usr/local/lib/python3.6/dist-packages/mysql_autoxtrabackup/backup_backup/backup_archive.py", line 148, in clean_old_archives
    > float(str(self.backup_archive_options.get("archive_max_size")))

I didn't had archive_max_size or max_archive_size configured in my config file.
When I included archive_max_size = 300GiB all worked fine, but that means that we MUST configure this parameter, and I don't want to :)
Please check this too.
Thanks

JasperAlgra added a commit to JasperAlgra/MySQL-AutoXtraBackup that referenced this issue Sep 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants