AttributeError: 'PlatformConfig' object has no attribute 'init_validation_tables'

I am using Visual Studio 2019 with Torizon Extensio (Extension version 1.5.0).
I can connect to my board: Toradex Apalis iMX8QM/QP on Apalis Evaluation Board(06494439)
Moses.exe is starting

On trying to build my project i get the AttributeError: ‘PlatformConfig’ object has no attribute ‘init_validation_tables’
I tried to set the config in the project properties, however the path was made invalid by the extension, as it adds a “.” to the folderpath where the config files lie:
ERROR:root:Error: 540 Invalid path. Invalid path: C:\[…]\.appconfig_0
The folder name should be appconfig_0 not .appconfig_0, i have no way of editing this.

When looking for the error i could find the following TIE-552-issue for VS code that was declared fixed.

What should be my further steps?
On my colleagues’ setup which he installed a while ago (Extension version 1.4.0) it works to build the project, for me it doesnt.

Moses Output:

ERROR:root:Image sha256:459dfc10d77612ad8500845b350fdf2de4846dcfc3422d42d27775e0adb2c60c not found
ERROR:root:Image sha256:5728a401b4998d78c2fe041df31cd1e0c5426b6a29fe5e1db78691636323b5e3 not found
ERROR:root:Image sha256:c8752af8a03d1a4e108535c9078ef10f7d12f88f0c31f0239dafda77f2033172 not found
ERROR:root:Image sha256:c8752af8a03d1a4e108535c9078ef10f7d12f88f0c31f0239dafda77f2033172 not found
ERROR:root:'PlatformConfig' object has no attribute 'init_validation_tables'
Traceback (most recent call last):
  File "flask\app.py", line 1516, in full_dispatch_request
  File "flask\app.py", line 1502, in dispatch_request
  File "connexion\decorators\decorator.py", line 48, in wrapper
  File "connexion\decorators\uri_parsing.py", line 144, in wrapper
  File "connexion\decorators\validation.py", line 384, in wrapper
  File "connexion\decorators\parameter.py", line 121, in wrapper
  File "api.py", line 1014, in applications_load_get
  File "applicationconfig.py", line 184, in load_application
  File "applicationconfig.py", line 61, in __init__
  File "applicationconfig_validation.py", line 420, in init
AttributeError: 'PlatformConfig' object has no attribute 'init_validation_tables'
INFO:root:REST <- /api/applications/load - 500

now i get this error even when trying to update the SDK.
It seems that some address to the torizon servers is set wrong

When starting a new Toradex Project on Visual Studio it works first. So i am able to update the SDK this way. It has a property window to change settings.
But when i want to manually set the location of the appconfig_0 folder containing config.yaml it breaks the project as above and i cannot set the properties anymore.

Dear @busssard,

Welcome to our community :rocket: ! Please feel free to roam around.

Please note that this issue is linked to VS Code and not the Visual Studio Extension. Moreover, it was related to the ASP.NET template while you’re using a C/C++ code. We’re trying to reproduce your issue on our side, the second error logs have not shown up like you presented when we changed the name of the path. We just got the Error: 540. Do you also have it on the Moses output?

Is there any other change that you’ve done to your project other than updating the Extension Version?

How do you change the location of the config folder?

Would you mind sharing your project here, via private message on the community or through e-mail to support@toradex.com? You can use share.toradex.com to add your files there.

1 Like

Hi @gclaudino.tx thank you for the reply.
Yeah i am aware that they are neither the same IDE not the same environment, but it was the only thing i could find online about this error.

It also happend with a new torizon_template_project.

Go to project properties → Torizon C/C++ Application


There you go to configuration and can either change properties or change the directory & select the folder where config.yaml sits.

Whenever i do this, any folder i select below the project folder gets the dot added.
image

In my actual project originally it looks for the config.yaml in the project folder
like this:

ERROR:root:[Errno 2] No such file or directory: 'C:\\Users\\mueolx\\source\\repos\\TorizonApp1\\TorizonApp1\\config.yaml'
Traceback (most recent call last):
  File "flask\app.py", line 1516, in full_dispatch_request
  File "flask\app.py", line 1502, in dispatch_request
  File "connexion\decorators\decorator.py", line 48, in wrapper
  File "connexion\decorators\uri_parsing.py", line 144, in wrapper
  File "connexion\decorators\validation.py", line 384, in wrapper
  File "connexion\decorators\parameter.py", line 121, in wrapper
  File "api.py", line 1014, in applications_load_get
  File "applicationconfig.py", line 184, in load_application
  File "applicationconfig.py", line 60, in __init__
  File "applicationconfig_base.py", line 88, in __init__
  File "applicationconfig_base.py", line 111, in load
  File "config.py", line 72, in load
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\mueolx\\source\\repos\\TorizonApp1\\TorizonApp1\\config.yaml'

where as my collegues setup already looks in the appconfig_0 folder. So it seems the configuration is also not transported via git.

Hello @busssard ,
Unfortunately we are not able to reproduce the issue on our side. Can you please try reinstalling VS2019 and /or the Torizon extension and see if the problem persists?

Best regards,
Josep

Hello @busssard ,
Do you have any news on this topic?

Best regards,
Josep

I have tried to reinstall the extension, but the problem persisted.
Reinstalling VS2019 is not an option at this moment, as it would create a backlog in other projects.
But I can try it out at some point.

I just dont understand why it is not possible to set the location of the config.
Even when starting a fresh project…
What would be the recommended way to set the location?

Hello @busssard ,
You can try to set manually the location of the folder in the .vcxproj file, located in your project folder .
The configuration section in one of my projects looks like this:

<PropertyGroup Label="TorizonCPPApp" Condition="'$(Configuration)|$(Platform)'=='Debug_debian_arm64v8_bullseye|ARM'">
    <torizon_configpath>.\appconfig_0</torizon_configpath>
    <torizon_configtype>debug</torizon_configtype>
  </PropertyGroup>
  <PropertyGroup Label="TorizonCPPApp" Condition="'$(Configuration)|$(Platform)'=='Debug_debian_arm64v8_bullseye|x64'">
    <torizon_configpath>.\appconfig_0</torizon_configpath>
    <torizon_configtype>debug</torizon_configtype>
  </PropertyGroup>
  <PropertyGroup Label="TorizonCPPApp" Condition="'$(Configuration)|$(Platform)'=='Release_debian_arm64v8_bullseye|ARM'">
    <torizon_configpath>.\appconfig_0</torizon_configpath>
    <torizon_configtype>release</torizon_configtype>
  </PropertyGroup>
  <PropertyGroup Label="TorizonCPPApp" Condition="'$(Configuration)|$(Platform)'=='Release_debian_arm64v8_bullseye|x64'">
    <torizon_configpath>.\appconfig_0</torizon_configpath>
    <torizon_configtype>release</torizon_configtype>
  </PropertyGroup>

After that you might need to reload the solution.
Best regards,
Josep

Hello @busssard
Did the proposed solution work for you?

Best regards,
Josep