Skip to content

Conversation

@LucasArmandVast
Copy link

Bad python-dateutils version was causing issues in the cloud copy --scheduled command.

(.venv) bstg@VAST-LAX-3B92X64:~/workspace/vast-cli$ ./vast.py cloud copy --src /workspace/A --dst /instance --instance 29270745 --connection 34972 --transfer "Instance To Cloud" --schedule HOURLY --day "*" --hour "*"
copying /workspace/A /instance 29270745 34972 Instance To Cloud
Internet upload cost is $9.333333333333334 per TB. Are you sure you want to schedule a cloud backup? (y/n): y
Traceback (most recent call last):
  File "/home/bstg/workspace/vast-cli/./vast.py", line 7976, in <module>
    main()
  File "/home/bstg/workspace/vast-cli/./vast.py", line 7952, in main
    res = args.func(args)
          ^^^^^^^^^^^^^^^
  File "/home/bstg/workspace/vast-cli/./vast.py", line 1771, in cloud__copy
    add_scheduled_job(args, req_json, cli_command, api_endpoint, "POST", instance_id=args.instance, contract_end_date=contract_end_date)
  File "/home/bstg/workspace/vast-cli/./vast.py", line 1878, in add_scheduled_job
    start_timestamp, end_timestamp = convert_dates_to_timestamps(args)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bstg/workspace/vast-cli/./vast.py", line 6123, in convert_dates_to_timestamps
    start_date = dateutil.parser.parse(str(args.start_date))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bstg/workspace/vast-cli/.venv/lib/python3.12/site-packages/dateutil/parser.py", line 1182, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bstg/workspace/vast-cli/.venv/lib/python3.12/site-packages/dateutil/parser.py", line 587, in parse
    if (isinstance(tzinfos, collections.Callable) or
                            ^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Callable'

Evidence of fix:

(.venv) bstg@VAST-LAX-3B92X64:~/workspace/vast-cli$ python3 -m pip show python-dateutil
Name: python-dateutil
Version: 2.9.0.post0
Summary: Extensions to the standard Python datetime module
Home-page: https://github.com/dateutil/dateutil
Author: Gustavo Niemeyer
Author-email: [email protected]
License: Dual License
Location: /home/bstg/workspace/vast-cli/.venv/lib/python3.12/site-packages
Requires: six
Required-by: vastai
(.venv) bstg@VAST-LAX-3B92X64:~/workspace/vast-cli$ ./vast.py cloud copy --src /workspace/A --dst /instance --instance 29270745 --connection 34972 --transfer "Instance To Cloud" --schedule HOURLY --day "*" --hour "*"
copying /workspace/A /instance 29270745 34972 Instance To Cloud
Internet upload cost is $9.333333333333334 per TB. Are you sure you want to schedule a cloud backup? (y/n): y
Existing scheduled job found. Do you want to update it (y|n)? y
add_scheduled_job update: success - Scheduling HOURLY job to cloud copy from 2025-12-27 UTC to 2026-02-28 UTC
{'success': True, 'scheduled_job_id': 5, 'msg': 'Successfully updated scheduled job with ID 5'}

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

Successfully merging this pull request may close these issues.

3 participants