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

"Error retrieving template 'Template is not available for api version == 2022-06-30-preview'. Please try again later." when running validate-messages #719

Open
scout208 opened this issue Oct 14, 2024 · 7 comments

Comments

@scout208
Copy link

When running the validate-messages command, I'm getting the error "Error retrieving template 'Template is not available for api version == 2022-06-30-preview'. Please try again later.".

Image

@yang-hai-feng
Copy link
Contributor

@scout208 would you please share your application id, so I can take a look?

@scout208
Copy link
Author

@yang-hai-feng, sure. The application id is ef0c7748-eaf7-4749-b24f-b810882ebbd6

@yang-hai-feng
Copy link
Contributor

@scout208 do you have a device template associated with your device? from the error information, it seems your don't have template associated with the device.

@scout208
Copy link
Author

@yang-hai-feng Yes, I do have a device template associated with my device. I'm not sure why I'm getting this error. Running the command with the --debug flag show the actual API endpoint being used and when I run it in Postman it is able to get the device template.

Image

Image

@yang-hai-feng
Copy link
Contributor

Thanks @scout208 for the details, looks like a bug from CLI extension code, I will investigate and get back to you.

@scout208
Copy link
Author

@yang-hai-feng I've narrowed the problem down to this block of code

if components:
component_schema_names = self._extract_schema_names(components)
modules.append({
'id': id,
'interfaces': interfaces,
'schema_names': schema_names,
'components': components,
'component_schema_names': component_schema_names
})

In my template there are no components, which means that component_schema_names is never getting assigned so it is throwing an error when trying to append it to the modules list.

I fixed it on my machine by changing the block to this

component_schema_names = []
if components:
    component_schema_names = self._extract_schema_names(components)


modules.append({
    'id': id,
    'interfaces': interfaces,
    'schema_names': schema_names,
    'components': components,
    'component_schema_names': component_schema_names
})

and it was able to get my device template successfully.

@yang-hai-feng
Copy link
Contributor

@scout208 , thanks for your investigation, that was fantastic, we will include the fixes for next releases, appreciated for your help to identify this issue.

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