Debugging VSCode Extension within a remote container - node.js

I'm currently using vscode-tomcat extension within a RHEL7 container and developing over SSH using the vscode-remote extension. However, I am unable to launch the tomcat debugger due to this unresolved issue.
"TypeError: Cannot set property 'readableListening' of undefined"
The issue only occurs when trying to launch the Tomcat debugger while doing remote SSH development. I am making an attempt to debug the issue, but I'm not sure how to debug a VSCode extension within a remote container.
Any tips would be greatly appreciated. Let me know if I can provide any additional details.

There is now documentation for all of this. Read
https://code.visualstudio.com/api/advanced-topics/remote-extensions#debugging-using-ssh
and then keep reading because further down you will find this
https://code.visualstudio.com/api/advanced-topics/remote-extensions#debugging-using-ssh
in fact read all of it, there's a lot of stuff there that initially made me think "So?" but which is vital knowledge in specialised problems.
Here's the portion relating to the immediate problem.
Debugging using SSH
Follow steps:
After installing and configuring the Remote - SSH extension, select Remote-SSH: Connect to Host... from the Command Palette (F1) in VS Code to connect to a host.
Once connected, either use File > Open... / Open Folder... to select the remote folder with your extension source code in it or select Git: Clone from the Command Palette (F1) to clone it and open it on the remote host.
Install any required dependencies that might be missing (for example using yarn install or apt-get) in a new VS Code terminal window (Ctrl+Shift+` ).
Finally, press F5 or use the Run view to launch the extension inside on the remote host and attach the debugger.
Note: You will not be able to open the extension source code folder in the window that appears, but you can open a sub-folder or somewhere else on the SSH host.
The extension development host window that appears will include your extension running on the SSH host with the debugger attached to it.
Installing a development version of your extension
Anytime VS Code automatically installs an extension on an SSH host, inside a container or WSL, or through GitHub Codespaces, the Marketplace version is used (and not the version already installed on your local machine).
While this makes sense in most situations, you may want to use (or share) an unpublished version of your extension for testing without having to set up a debugging environment. To install an unpublished version of your extension, you can package the extension as a VSIX and manually install it into a VS Code window that is already connected to a running remote environment.
Follow these steps:
If this is a published extension, you may want to add "extensions.autoUpdate": false to settings.json to prevent it from auto-updating to the latest Marketplace version.
Next, use vsce package to package your extension as a VSIX.
Connect to a codespace, development container, SSH host, or WSL environment.
Use the Install from VSIX... command available in the Extensions view More Actions (...) menu to install the extension in this specific window (not a local one).
5.Reload when prompted.
Tip: Once installed, you can use the Developer: Show Running Extensions command to see whether VS Code is running the extension locally or remotely.

Related

Appium Inspector don't open on Linux Ubuntu

I cannot open Appium inspector on Linux Ubuntu.
In the same folder I have 3 files:
Appium-Inspector-linux-2022.2.1.AppImage /
Appium-Server-GUI-linux-1.22.2.AppImage /
latest-linux.yml
When I open the Appium-Server-GUI-linux-1.22.2.AppImage file, start the server e click on the button to open Appium Ispector, it open a web page.
to fix this, it was necessary:
1: Start Appium Server
I did this, executing Appium-Server-GUI-linux-1.22.2.AppImage file.
2: Start Appium Inspector through of file Appium-Inspector-linux-2022.2.1.AppImage
3: Create the capabilities
After that, the Appium Inspector still don't open throught on Appium Server button, but it make it open and you can use.
Since the release of Appium v1.22 they have changed how the Appium Inspector works. I refer you to their official documentation on GitHub https://github.com/appium/appium-inspector, citing:
Appium Inspector is released in two formats:
As a desktop app for macOS, Windows, and Linux. You can get the most
recent published version of this app at the Releases section of this
repo. Simply grab the appropriate version for your OS and follow
standard installation procedures (but see the note below for macOS).
As a web application, hosted by Appium Pro. (It's currently a known
issue that the web version does not work on Safari). Please make sure
to read the note below on CORS as well.
If you like to work the old way, download Appium Desktop v1.21 or below.
install latest appium-inspector
open appium-inspector and insert "/wd/hub" in Remote Path

Error installing Chrome on AWS EC2 Linux Instance: scaling_cur_freq & scaling_max_freq not found

I am trying to install Chrome (to use with Chromedriver / selenium) on an AWS EC2 instance and getting an error I've never seen before. I am able to reproduce consistently but can't find anything on Google about what to do.
Steps to reproduce:
Start a new EC2 Instance (Amazon Linux 2, 64-bit x86, t2.Micro)
Connect to the instance and run the following commands:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
sudo yum install -y ./google-chrome-stable_current_*.rpm
google-chrome &
And I get the following errors:
[1122/164219.101517:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[1122/164219.101672:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Would really appreciate any advice on this - thank you!
Seems you hit this open bug https://bugs.chromium.org/p/chromium/issues/detail?id=1228625 (at the moment of writing this) try to use a old version http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_93.0.4577.82-1_amd64.deb which some users reported is working.
Running Chrome with default options require GUI available on the machine. In your local machine you likely have it, thus executing google-chrome & will start the browser without any problems.
But EC2 instances are not shipped with GUI out of the box. So we're coming to the case when Chrome requests some GUI-related resources from the host -> these resources are not available -> Chrome crashes.
There are two ways to solve the problem depending on your needs:
Run Chrome in headless mode
See more about headless Chrome here
If that's what you need, just execute google-chrome --headless --remote-debugging-port=9222 & in your shell. I used default port as an example, but it can be changed.
Install a virtual desktop
You may trick Chrome by letting it think that there is a GUI available on the host, so it can be launched in the same way as on your local machine. In order to achieve this you should:
Install VNC server or similar on the EC2 instance. I've found this wonderful step-by-step guide
Connect to your EC2 instance using VNC client
Start terminal and run google-chrome &
Chrome GUI in Jenkins jobs
If you have Jenkins jobs that require Chrome GUI, you should follow the second approach, but please make sure:
VNC server or similar is setup on behalf of jenkins user
Chrome is not being started with super-user privileges
Your job uses Xvnc Jenkins plugin or similar, depending on the tool installed

Open VSCode from Remotly Server to Local like WSL2

Recently i created one server (with centos) on another computer, i assigned static local ip (192.168.1.100) and i my computer has local static ip too (192.168.1.50), and i would like open the vscode from my local computer when i run "code" command on remote server (like code .) inside vscode of my computer.
Basically like WSL2 works, but, when we install the distro of WSL2, the vscode install automatically one extension for WSL2, and that works.
And another question, is about the terminal of local vscode, when i open the vscode terminal, i would like to open the remote server terminal (ssh) on the current folder. (Exactly like WSL2)
Basically i would like create a WSL2 outside from the same computer. The "SubSystem" i want to install are on another computer (my server)
I think that's what you're looking for 1
A simpler method would be to install ssh-remote plugin in VSCode and you will see Remote Explorer in your left bar. After you log in once to that server you will see the connection and with a simple click, you can connect from there.

Remote System Development Eclipse - Build, Debug and Run from remote Linux machine

I have the following:
1) Windows machine with Eclipse CDT (Currently Luna v4.4.1)
2) A Linux machine that has the repository with code and the Linux GCC, make etc..
I want to connect to the Linux via Remote System Explorer in Eclipse, edit, build, debug and run all from the Windows machine in Eclipse.
I have been successful in setting up the SSH connection and in the project explorer, I can access the remote repository and edit the code.
The issue I am having is building, debugging and running it.
How can I let eclipse know I want to compile it remotely? The Project -> Build functionality is blocked out when attempting for the remote repository. It only allows it for local repo's. But I already have an SSH connection.. Is there not a way for it to know that I want to use the remote GCC too?
Also, for debugging, in the Debug configuration it seems to want a local version of the build, even though I selected remote debugging.
Sorry I don't have any error logging to report as i'm just struggling on the first bit of how I go about doing the remote build in the IDE.
Maybe this is not possible?

scp from Linux to Windows: 'C:\Program' is not recognized error

In my linux machine, I'm trying to send a file over to a Windows machine via:
scp fileNameA user#windowServer:fileNameA
I get the following message:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
What's prompting this message?
I've installed OpenSSH on the windows machine, and I can successfully SSH into it. I don't want to use WinSCP, FileZilla, etc, because I have to automate this in a script. This has to be done from the Linux machine, so I'm not interested in doing pscp from the Windows machine.
I have met the same problem today.
I think it is an issue in the new version of OpenSSH, which was published few days ago. I reverted previous version (v7.6.1.0p1-Beta), which was working correctly on my VM from https://github.com/PowerShell/Win32-OpenSSH/releases and problem was fixed without any changes in configuration.
I just fixed the same problem by moving my installation of OpenSSH from C:\Program Files\OpenSSH to C:\OpenSSH.
I had to first uninstall it properly using the provided script in Win32-OpenSSH and then follow back the information provided there https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH but only changing the path to C:\OpenSSH.
I met a similar issue today, trying to copy files to a Windows server running OpenSSH-Win64. I solved the problem by adding C:\Program Files\OpenSSH, which is the recommended installation location, to the Windows path:
Open the Control Panel, go to the System and Security section and open up System.
Click on Advanced System Settings and, in the System Properties dialog box, click Environmental Variables.
In the System Variables section of the dialog box, select Path and click Edit....
Click New, add the OpenSSH folder path and click OK to apply the change.
Then, do not forget to restart the OpenSSH service, either in the service management console or by running net stop sshd, followed by net start sshd in an elevated console.

Resources