Skip to content

'ValidationError' object has no attribute 'message' #125

@GilZ

Description

@GilZ

This is autogenerated. Please review and update as needed.

Describe the bug

Tried to create a job with "outputFiles" and in the "containerUrl" I accidently didn't mention the protocol. The command failed with an unexpected error that prevented me from getting the real validation error (see attached call stack)

The only way I was able to get around it and get the real validation issue was by monkey-patching custom_errors.CreateTasksErrorException.__init__ and adding a dummy message to the error.

Command Name
az batch job create Extension Name: azure-batch-cli-extensions. Version: 6.0.0.

Errors:

CLIInternalError: The command failed with an unexpected error. Here is the traceback:
'ValidationError' object has no attribute 'message'
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-s90ugolk\knack\cli.py", line 215, in invoke
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-_1bqfhco\azure\cli\core\commands\__init__.py", line 654, in execute
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-_1bqfhco\azure\cli\core\commands\__init__.py", line 717, in _run_jobs_serially
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-_1bqfhco\azure\cli\core\commands\__init__.py", line 709, in _run_job
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-2g1ftftt\azure\cli\command_modules\batch\_exception_handler.py", line 30, in batch_exception_handler
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-7f66x3i5\six.py", line 703, in reraise
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-_1bqfhco\azure\cli\core\commands\__init__.py", line 688, in _run_job
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-_1bqfhco\azure\cli\core\commands\__init__.py", line 325, in __call__
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-_1bqfhco\azure\cli\core\__init__.py", line 784, in default_command_handler
  File "C:\Users\<username>\.azure\cliextensions\azure-batch-cli-extensions\azext_batch\custom.py", line 177, in create_job
    client.job.add(job, add_option, threads=multiprocessing.cpu_count()//2)
  File "C:\Users\<username>\.azure\cliextensions\azure-batch-cli-extensions\azext\batch\operations\job_operations.py", line 218, in add
    threads)
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-uej0p7bz\azure\batch\custom\patch.py", line 282, in bulk_add_collection
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-uej0p7bz\azure\batch\custom\custom_errors.py", line 30, in __init__
AttributeError: 'ValidationError' object has no attribute 'message'
To open an issue, please run: 'az feedback'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az batch job create --template {..."outputFiles": [ { "filePattern": "..\\stdout.txt", "destination": { "container": { "path": "stdout.txt", "containerUrl": "my.blob.without.https" } }, "uploadOptions": { "uploadCondition": "TaskCompletion" } } ]...} --parameters {}

Expected Behavior

A detailed error message pointing to the validation error

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.6.8
Installer: MSI

azure-cli 2.15.0

Extensions:
azure-batch-cli-extensions 6.0.0

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions