Problems setting up VS Code IDE Extension V2

Hi,

I’m moving some projects from your VS Code IDE V1 to V2 and have hit a problem. I’m following your guide here. I found a number of inconsistencies between your guide and what I experienced, but I continued anyway in the hope that all would go OK, but unfortunately that did not happen.

  • When trying to start the Docker Engine, I issued the command service docker start (as specified in the guide) but this resulted in “Docker must be run as root”. I re-issued it as sudo service docker start, and that appeared to execute without error. However, issuing the command service docker status indicates that Docker is not running.

  • When attempting to install the VS Code WSL Extension, VS Code reports that “This extension is enabled globally”. I assume that this is new since the writing of your guide. I just left it as it was and continued.

  • When installing the IDE V2 extension, the guide says to search for “toradex.apollox-vscode”, but nothing is found because this extension appears to have been renamed to “Torizon IDE Extension - ApolloX”. I selected this and it seemed to install OK.

  • After the installation of Powershell step, I got the following:

[08-09 18:05:17.050] PowerShell installation OK
[08-09 18:05:17.081] PowerShell OK
[08-09 18:05:17.086] Checking connected devices ...
[08-09 18:05:17.087] Scanning Torizon devices ...
[08-09 18:05:17.130] ERROR :: Errors during the initialization of ApolloX Torizon Extension.
[08-09 18:05:17.131] HOUSTON WE HAVE A PROBLEM!
[08-09 18:05:17.131] PLEASE READ THE LOGS!
[08-09 18:05:20.939] Debian bookworm packages list load OK
  • When trying to connect to a target device by clicking on the Torizon icon I get this:
[08-10 11:45:57.441] PowerShell OK
[08-10 11:45:57.475] git OK
[08-10 11:45:57.502] dig OK
[08-10 11:45:57.527] avahi-resolve OK
[08-10 11:45:57.551] nmap OK
[08-10 11:45:57.576] iputils-ping OK
[08-10 11:45:57.601] file OK
[08-10 11:45:57.625] sshpass OK
[08-10 11:45:57.649] net-tools OK
[08-10 11:45:57.650] Cloning project templates
[08-10 11:45:57.682] Project templates clone OK
[08-10 11:45:58.179] Checkout templates repo to v2.1.0 OK
[08-10 11:45:58.181] Checking connected devices ...
[08-10 11:45:58.181] Scanning Torizon devices ...
[08-10 11:45:58.216] ERROR :: Errors during the initialization of ApolloX Torizon Extension.
[08-10 11:45:58.216] HOUSTON WE HAVE A PROBLEM!
[08-10 11:45:58.216] PLEASE READ THE LOGS!
[08-10 11:46:01.805] Debian bookworm packages list load OK

Just to confirm, I can ping and SSH to the device I am trying to connect to, and I was able to connect to devices without a problem using the V1 IDE extension. Also, I have no idea where “THE LOGS” are so I couldn’t read them.

After some research, I suspect that the problem may be something to do with confusion between the “Docker Desktop” and the “Docker Engine”, but I really don’t know. I must say that I found the Docker Engine installation part of your guide to be a bit short on detail – I just followed it blindly, copy-pasting the commands, but I really had no idea what I was doing – I didn’t see anything obviously wrong, but I was unable to interpret the success, or lack of, of what I was doing.

Any and all help will be much appreciated.

Peter

Hi @bcpberry ,

I’ll try to address your questions:

I issued the command service docker start (as specified in the guide) but this resulted in “Docker must be run as root”

That’s strange. If you added your user to the docker group then restarted you shouldn’t need to use sudo to start the docker service. I assume you’re using Windows on WSL, is this correct?

However, issuing the command service docker status indicates that Docker is not running.

The IDE Extension V2 will not work correctly if Docker Engine isn’t properly running on your system. That’s likely why you got the extension errors.

When attempting to install the VS Code WSL Extension, VS Code reports that “This extension is enabled globally”. I assume that this is new since the writing of your guide. I just left it as it was and continued.

On my side I also have this message for the extension, so I don’t think it’s something to worry about.

When installing the IDE V2 extension, the guide says to search for “toradex.apollox-vscode”, but nothing is found because this extension appears to have been renamed to “Torizon IDE Extension - ApolloX”.

Strange, I was able to find it with toradex.apollox-vscode, though I am using a native Linux system:

Screenshot_20230810_105701


About the Docker Engine installation steps: It was based on the official Docker documentation, though the team will re-evaluate this article to see if we should update the steps with more detail or rather just reference the official docs for the whole installation process. Thank you for your feedback!

I’d recommend that you first make sure that Docker Engine is up and running before proceeding with the extension. You can check the Docker documentation for the Linux distro installed on WSL for a more detailed troubleshooting: Install Docker Engine | Docker Docs

Best regards,
Lucas Akira

Hi @lucas_a.tx,

Thanks for your fast response.

I’ve had a look in more detail at the Docker documentation you pointed me too (as well as much more) and can see where the steps listed in your guide come from. I could not see anything that indicated there might be anything wrong. I then re-ran the Docker Engine installation as per your guide. However, the result is still the same.

Firstly, the requirement to use sudo when starting the docker service. I’ve confirmed that my username (“peter”) has been added to the docker group as follows:

peter@Papa:~$ grep docker /etc/group
docker:x:999:peter

However, I still cannot start the service without using sudo.

Secondly, the service still doesn’t start (or maybe it starts but then immediately stops ???). Here is a list of the commands and responses:

peter@Papa:~$ service docker start
 * Docker must be run as root
peter@Papa:~$ sudo service docker start
[sudo] password for peter:
 * Starting Docker: docker                                 [ OK ]
peter@Papa:~$ service docker status
 * Docker is not running

In the Docker documentation I found a tester to check that it’s running, but that also shows that it is not:

peter@Papa:~$ sudo docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

I am at a loss, so any help would be great.

Best regards,
Peter

Hi @bcpberry ,

About the docker service not starting or immediately stopping, you could try following these external references to see if they help:

Or you can also uninstall Docker Engine on WSL2 then try installing Docker Desktop on Windows instead, as that also provides Docker on WSL2. Just be aware that Docker Desktop can have a paid subscription for commercial use, see their website for details.

Given that this issue apparently is more of a Docker Engine or WSL2 issue, I’m afraid I can’t help much more other than giving the suggestions above.

Best regards,
Lucas Akira

Hi @lucas_a.tx,

I tried the various things in the links you gave, but none helped. However, after much Googling/un-installing/re-installing, I finally seem to have got the Docker Engine running. (For reference, the suggestion by @venkatrahul in this post was what made the difference.)

However, I still cannot get the Torizon Extension to run. There seems to be some issue with the installation of TorizonCore Builder. Below is a screen shot of what I see in VS Code:

Note the message in the bottom-right corner. I have tried clicking the “Install and Reload” button but it did not work - it downloaded and appeared to install (I could briefly see it appear in the install list), but after the automatic reload, it was not installed.

I tried doing a manual install it in the normal way via the Extensions Marketplace and it appeared to install OK, but then clicking on the Torizon icon did nothing (I was expecting it to start scanning for devices). I tried closing VS Code and re-opening it, only to find that TorizonCore Builder was no longer installed, and clicking on the Torizon icon again resulted in the same pop-up error message.

Thanks again for your help,
Peter

Hi @bcpberry ,

Glad you were able to solve your previous issue.

Note the message in the bottom-right corner. I have tried clicking the “Install and Reload” button but it did not work - it downloaded and appeared to install (I could briefly see it appear in the install list), but after the automatic reload, it was not installed.

That’s strange, the TorizonCore Builder extension should have been automatically installed along with the IDE Extension V2.

I tried doing a manual install it in the normal way via the Extensions Marketplace and it appeared to install OK, but then clicking on the Torizon icon did nothing (I was expecting it to start scanning for devices). I tried closing VS Code and re-opening it, only to find that TorizonCore Builder was no longer installed, and clicking on the Torizon icon again resulted in the same pop-up error message.

Can you send the text output logs from the extension, as seen below?

Best regards,
Lucas Akira

Hi @lucas_a.tx,

The short answer is no, I can’t send the text output logs, because I can’t see the “ApolloX Torizon” as an available option in the list of available options for the OUTPUT window - see below:

I don’t actually know how this ApolloX extension is working within VS Code/WSL (I’m sort of hoping I don’t really have to know …). I see that it gets installed under a section titled “WSL:UBUNTU 22.04 - INSTALLED”. I assume that is correct. That is simply how it installed without any direction from me. I have not seen this section before in VS Code - I only see it now when trying to set this up. Here’s what I see:

When I install the TorizonCore Builder extension it gets installed in this same section (before disappearing on reload as described in my earlier post).

I hope this information helps.

All the best,
Peter

Hi @bcpberry ,

I see that it gets installed under a section titled “WSL:UBUNTU 22.04 - INSTALLED”. I assume that is correct.

That is correct. VSCode should be connected to WSL2 in order to install the extensions, and the section you mentioned indicates the connection.

When I install the TorizonCore Builder extension it gets installed in this same section (before disappearing on reload as described in my earlier post).

This is very strange. We can’t reproduce this behavior on our side. Just to be sure, do you have any other VSCode extensions enabled that you have installed separately?

Can you try to install the IDE Extension V2 on another host computer (possibly Linux) to see if this error also happens on other systems?

Best regards,
Lucas Akira

Hi @lucas_a.tx,

Just to be sure, do you have any other VSCode extensions enabled that you have installed separately?

Yes, but nothing that is not mainstream (I specifically avoid anything that is obscure, in beta, or not from a reputable source). I use VS Code for a few things and will be using it more in the future.

Can you try to install the IDE Extension V2 on another host computer (possibly Linux) to see if this error also happens on other systems?

Not really. I don’t currently have another machine with the required resources. Also, this wouldn’t really help because this machine is where I need it, as it is this machine that I use for all my development (software and hardware). I’m not sure that this would actually prove anything one way or another.

I have tried a few more things, and can report the following:

  • I’ve tried installing both the “release” and the “pre-release” versions, and both seem to be the same.

  • Directly after the installation, I now do see the “ApolloX Torizon” as an available option in the list of available options for the OUTPUT window, and this is what I see there:

However:

  • I do not see any indication that the TorizonCore Builder has been installed.
  • There is no indication that a connected device is found, either in the log, nor in the list of CONNECTED DEVICES. As described in my earlier post, there is a device connected.
  • After closing and re-opening VS Code, the “ApolloX Torizon” again does not appear in the list of available options for the OUTPUT window, and I get the same pop-up error message as reported earlier.

If it would help, I would be happy for you to do a remote connection into my PC - we would just need to sort out a time given that I’m in Australia, but I would be happy to fit in with any time that would suit you.

Best regards,
Peter

Hi @bcpberry ,

Directly after the installation, I now do see the “ApolloX Torizon” as an available option in the list of available options for the OUTPUT window, and this is what I see there

From the logs you showed the Extension does seem to work right after installation. You need to manually connect your device to it with the SoM login credentials before it appears on the Connected Devices list.

After closing and re-opening VS Code, the “ApolloX Torizon” again does not appear in the list of available options for the OUTPUT window, and I get the same pop-up error message as reported earlier.

Just to confirm, when you close and reopen VSCode, are you connected to WSL2 i.e. do you see the “WSL: Ubuntu-22.04” in the blue box on the bottom left corner of the window? On Windows VSCode needs to be connected to it at all times, given that the extension V2 is only installed in this environment.

Make sure this is the case by following our setup page:

If VSCode is not connected to WSL2 you will not see the extension installed.

About the possibility of doing a remote connection to help you, I contacted the support team in Asia to see if they can support you on this, as our current timezone difference (11h) makes it difficult to find a suitable sync time for both of us.

Best regards,
Lucas Akira

Hi @lucas_a.tx,

You need to manually connect your device to it with the SoM login credentials before it appears on the Connected Devices list.

OK, I see that in addition to the CONNECTED DEVICES list there is a NETWORK DEVICES list which I had not noticed earlier (I think this is different from what I recall from V1 of the IDE (???)). However, nothing appears in the NETWORK DEVICES list, and clicking the Refresh Devices icon for the NETWORK DEVICES list just results in a pop-up error message, as shown below:

Attempting to manually add a device using the “+” icon results in a similar “NetworkDeviceAdd” error. I assume these errors occur because the Builder extension is not there (?).

Just to confirm, when you close and reopen VSCode, are you connected to WSL2 i.e. do you see the “WSL: Ubuntu-22.04” in the blue box on the bottom left corner of the window?

Yes I do see this - see the above screen shot.

About the possibility of doing a remote connection to help you, I contacted the support team in Asia to see if they can support you on this, as our current timezone difference (11h) makes it difficult to find a suitable sync time for both of us.

OK. However, as I said earlier, I am happy to accommodate you at any time. I am working from home at the moment, so any time is possible. I am eager to get this resolved and get on with this migration so I’m happy to do whatever may help.

Best regards,
Peter

Hi @bcpberry ,

Yes I do see this - see the above screen shot.

Right, so the issue doesn’t appear to be directly related to WSL2.

OK, I see that in addition to the CONNECTED DEVICES list there is a NETWORK DEVICES list which I had not noticed earlier

Yes, this part is a bit different compared to V1. Network Devices should scan and list all devices in the local network.

I assume these errors occur because the Builder extension is not there (?)

This may be the case. The IDE Extension V2 lists TorizonCore Builder Extension as a dependency.

What I think is happening is that V2 tries to initialize, doesn’t find TorizonCore Builder Extension enabled, then V2 stays in an incorrect initialized state, given that one of its dependencies is not working.

Can you verify if the TorizonCore Builder Extension is properly installed and enabled, as shown in the screenshot below:

If TC Builder Extension is not installed/initialized correctly, can you provide the error messages/logs if any appear?

Best regards,
Lucas Akira

Hi @lucas_a.tx,

What I think is happening is that V2 tries to initialize, doesn’t find TorizonCore Builder Extension enabled, then V2 stays in an incorrect initialized state, given that one of its dependencies is not working.

Yes – absolutely – that is what I reported in my earlier posts.

I have just tried again. I uninstalled the ApolloX extension, closed and re-opened VS Code, and the then did the following:

  • Installed the ApolloX Extension. I see that there is now a newer version since the last time I did this (with a new logo). After the installation it appeared in the WSL: UBUNTU-22.04 – INSTALLED section (as expected).
  • I noticed that the TorizonCore Builder was not automatically installed. You said in an earlier post that it should be automatically installed.
  • I then manually installed the TorizonCore Builder, and noticed two things:
  1. After indicating “Installing” for a while, the installation stopped and it appeared to have not installed, with the “Install” option button again being presented.
  2. I tried again and this time it appeared to install because the window indicated “Installed”. However, it did NOT appear in the list of installed extensions – see the screen shot below.

  • Before closing VS Code, I tried to connect to my device. This time I was successful, as can be seen in the log in the above screenshot.
  • I then closed and re-opened VS Code. Again, the Builder extension does not appear in the list of installed extensions, as shown here:

  • I then clicked on the Torizon extension icon, and again I got the error pop-up as follows:

  • Clicking the “Install and Reload” button just repeats the whole process, as I described in my earlier post.

Can you verify if the TorizonCore Builder Extension is properly installed and enabled, as shown in the screenshot below:

This is what I see.

Note that I see this even after the right-hand extension management window indicates that the extension was installed.

To summarize:

  • The Builder extension does not get automatically installed when installing ApolloX.
  • After manually installing the Builder extension, and before closing VS Code, it appears to work because I can connect to a device. However, it does not appear to have installed properly because VS Code does not list it as an installed extension.
  • After closing and re-opening VS Code I cannot connect to a device and attempting to do so results in a pop-up error message that the Builder extension is not installed.

Best regards,
Peter

@bcpberry

could you please send the content of your settings.json?

image

Please, the content of these two options.
Also send the content of the Developer Tools console logs:

openDeveloperTools

BR,

@matheus.tx,

User settings.json:

{
    "editor.tabSize": 2,
    "editor.detectIndentation": false,
    "cSpell.userWords": [
      "customisation",
      "customised",
      "databerry",
      "Databerry",
      "toradex",
      "torizon"
    ],
    "files.associations": {
      "*.json": "jsonc"
    },
    "cmake.configureSettings": {}
}

Remote Settings (JSON) (WSL:Ubuntu-22.04):

{
}

That’s all - just two parentheses.

Developer Tools console logs:

I hope that helps. If you need anything more please let me know.

Best regards,
Peter

@bcpberry Sorry, I forgot to say that the Developer Tools logs must be copied after trying to install the Extension. I’m looking for possible logs that might give a hint of what’s going on with the VS Code and the TCB extension, because it can’t just be uninstalled out of nowhere :pensive:

@matheus.tx

Here’s the log after I did the following:

  • Uninstalled the ApolloX extension.
  • Closed and re-opened VS Code
  • Installed the ApolloX extension

And just FYI, here’s a screen shot of the installed extensions after doing this:

Best regards,
Peter

Hi @matheus.tx,

Just checking to see if you managed to make anything of that log I sent? Is there anything else I can do that may help resolve this?

Best regards,
Peter

Hey @bcpberry

the logs all appear ok, there is no clue why you are having this behavior.

@lucas_a.tx maybe we can schedule a call with @bcpberry to check, could you handle this?

BR,

Hi @bcpberry ,

From our call the issue is apparently no longer happening. Feel free to update here if necessary.

If you have any other questions related to the extension or our products, just create a new topic in the community and we’ll be glad to help.

Best regards,
Lucas Akira