question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[cache]`cache show` fails with stack trace if resource type is not specified

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

az cache show -n {} -g {} fails… az cache show -n {} -g {} -t {} succeeds…

Command Name az cache show

Errors:

join() argument must be str or bytes, not 'NoneType'
Traceback (most recent call last):
python3.7/site-packages/knack/cli.py, ln 206, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 523, in execute
    raise ex
cli/core/commands/__init__.py, ln 581, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 574, in _run_job
    six.reraise(*sys.exc_info())
...
cli/command_modules/configure/custom.py, ln 194, in show_cache_contents
    item_path = os.path.join(directory, resource_group_name, resource_type, '{}.json'.format(item_name))
../lib/python3.7/posixpath.py, ln 94, in join
    genericpath._check_arg_types('join', a, *p)
../lib/python3.7/genericpath.py, ln 149, in _check_arg_types
    (funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType'

To Reproduce:

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

  • Put any pre-requisite steps here…
  • az cache show -n {} -g {}

Expected Behavior

Environment Summary

Darwin-18.0.0-x86_64-i386-64bit
Python 3.7.3
Shell: bash

azure-cli 2.0.62 *

Extensions:
dev-spaces 1.0.0
alias 0.5.2
interactive 0.4.2

Additional Context

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tjprescottcommented, Apr 25, 2019

It is in the PR.

1reaction
adewaleocommented, Apr 24, 2019

@tjprescott. Nice to hear it was fixed. I would pull in dev into my branch.

Below is the error I got:


src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/tests/latest/test_image_builder_commands.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/azure-cli-testsdk/azure/cli/testsdk/base.py:161: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:199: in __init__
    self._in_process_execute(cli_ctx, command, expect_failure=expect_failure)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:262: in _in_process_execute
    raise ex.exception
../cli-venv/lib/python3.7/site-packages/knack/cli.py:206: in invoke
    cmd_result = self.invocation.execute(args)
src/azure-cli-core/azure/cli/core/commands/__init__.py:523: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/__init__.py:581: in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
src/azure-cli-core/azure/cli/core/commands/__init__.py:574: in _run_job
    six.reraise(*sys.exc_info())
../cli-venv/lib/python3.7/site-packages/six.py:693: in reraise
    raise value
src/azure-cli-core/azure/cli/core/commands/__init__.py:551: in _run_job
    result = cmd_copy(params)
src/azure-cli-core/azure/cli/core/commands/__init__.py:289: in __call__
    return self.handler(*args, **kwargs)
src/azure-cli-core/azure/cli/core/__init__.py:453: in default_command_handler
    return op(**command_args)
src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/_image_builder.py:418: in add_template_output
    existing_image_template = cached_get(cmd, client.virtual_machine_image_templates.get, resource_group_name, image_template_name)
src/azure-cli-core/azure/cli/core/commands/__init__.py:350: in cached_get
    cache_obj.load(args, kwargs)
src/azure-cli-core/azure/cli/core/commands/__init__.py:203: in load
    self._payload = self.result()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <azure.cli.core.commands.CacheObject object at 0x109ed7780>

    def result(self):
        model_cls = self._cmd.get_models(self._model_type)
>       return model_cls.deserialize(self._payload)
E       AttributeError: 'NoneType' object has no attribute 'deserialize'

src/azure-cli-core/azure/cli/core/commands/__init__.py:218: AttributeError
----------------------------------------------- generated xml file: /Users/tosin/.azdev/env_config/Users/tosin/Repos/cli-venv/test_results.xml -

I believe model_cls is None because get_models only works on versioned models.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle Build Failure Could not open proj class cache for build ...
I believe this issue may have happened for me as a result of adding a new dependency to my build.gradle file through IntelliJ...
Read more >
Error handling - Apollo GraphQL Docs
A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ...
Read more >
Navigating to Certain Pages Triggers Stack Trace | Confluence
Navigating to certain pages/spaces triggers an error page with a stack trace: The following appears in the atlassian-confluence.log :.
Read more >
Best Practices for exceptions - .NET - Microsoft Learn
Learn best practices for exceptions, such as using try/catch/finally, handling common conditions without exceptions, and using predefined .
Read more >
Configuration cache - Gradle User Manual
By default, Gradle will fail the build if any configuration cache problems are encountered. ... Try: > Run with --stacktrace option to get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found