What is a "Failed to create hard link: File exists" error? - linux

I'm trying to do a SSH login from VSCode using the Remote SSH extension and I'm getting this error. It is working fine when I login from my GIT terminal.
The error stack:
[20:44:36.547] > \ln /root/.vscode-server/bin/a5d1cc28bb5da32ec67e86cc50f84c67cc690321/vscode-rem
> ote-lock.root.a5d1cc28bb5da32ec67e86cc50f84c67cc690321.target /root/.vscode-serv
> er/bin/a5d1cc28bb5da32ec67e86cc50f84c67cc690321/vscode-remote-lock.root.a5d1cc28
> bb5da32ec67e86cc50f84c67cc690321
>
[20:44:36.555] > ln: failed to create hard link ‘/root/.vscode-server/bin/a5d1cc28bb5da32ec67e86c
> c50f84c67cc690321/vscode-remote-lock.root.a5d1cc28bb5da32ec67e86cc50f84c67cc6903
> 21’: File exists
> Installation already in progress...
> e6e07fdafb38##24##
>
[20:44:36.555] Received install output: e6e07fdafb38##24##
[20:44:36.556] Server installation process already in progress - waiting and retrying
[20:44:36.827] "install" terminal command done
[20:44:36.827] Install terminal quit with output:
[20:44:37.557] Resolver error:
[20:44:37.560] ------

I had the same problem after updating VScode.
Not sure if this is the correct solution but it does work:
Login to your server via another ssh program like PuTTY, because your file is located in the root user home directory you'll need to login as root to do this.
Delete folder a5d1cc28bb5da32ec67e86c from /root/.vscode-server/bin/ directory.
Found the answer here:
https://github.com/microsoft/vscode-remote-release/issues/2507

Related

Problem launching TYPO3 via DDEV on Linux: Call to undefined function Composer\Autoload\includeFile()

I need to setup ddev with TYPO3 10.4 on public server (I know it's not a good practise, it's just to show a demo to the client). On my local machine (Windows + WSL2 + Docker + DDEV + Composer) everything works perfect, but when I start my project on the Linux suddenly there are some errors.
I have checked permissions, there is a newest version of composer, docker and ddev installed.
Errors:
[ Error ]
Call to undefined function Composer\Autoload\includeFile()
Failed to execute command vendor/bin/typo3cms extension:activate site: exit status 1
Task failed: Exec command 'cd frontend && npm ci && npm run prod' in container/service 'web': exit status 130
Task failed: Exec command 'vendor/bin/typo3cms database:updateschema' in container/service 'web': exit status 1
It looks like it can't execute commands, but I can't find any meaningful reason why. I will be glad for any ideas.
You need to install most new version of typo3-console.
Your problem is described here:
https://github.com/TYPO3-Console/TYPO3-Console/issues/1081

Cannot SSH to Remote on VSCode

My SSH setup was working fine for the past 3-4 months, until a few days back when it decided to stop working on vscode. I can still ssh to remote via powershell without any issues.
The Issue: Once I enter my passphrase and 2fa authentication, something runs in the background (The output from Remote-SSH stream is dumped below). After which, it asks for my passphrase again, 2fa and so on, and this keeps repeating on a loop.
Methods Tried:
First I tried "Remote: Kill VScode on Remote Host" - The first time I tried this, it worked, I could SSH. But after that session ended, I faced the same issue again. But this time when I executed "Remote: Kill VScode on Remote Host" again it didn't work like the last time.
Manually deleted the .vscode on the remote host - It didn't work
Uninstalled and reinstalled VScode, similar to method 1, It worked for the first SSH session, but failed with some issues for consequent sessions.
Toggled remote.SSH.useFlock setting - didn't work
Toggled remote.SSH.useLocalServer - didn't work
How can I fix this?(preferred)
Is there any alternative to using Remote - SSH extension on vscode if nothing works?
Any other alternative as good as vscode without the requirement of downloading the remote file locally?
[12:09:32.264] > Passcode or option (1-6): 1
[12:09:32.551] >
>
[12:09:37.009] > aae6d4629bbb: running
[12:09:37.050] >
> Acquiring lock on /home1/<user>/.vscode-server/bin/da47g5wf6ef856477bf6f4fb29ba1b7af717770d/vscode-remote-lock.<user>.da47g5wf6ef856477bf6f4fb29ba1b
> 7af717770d
> Installation already in progress...
> If you continue to see this message, you can try toggling the remote.SSH.useFlock setting
> aae6d4629bbb: start
> exitCode==24==
> listeningOn====
> osReleaseId==centos==
> arch==x86_64==
> tmpDir==/run/user/601613==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> aae6d4629bbb: end
>
[12:09:37.050] Received install output:
exitCode==24==
listeningOn====
osReleaseId==centos==
arch==x86_64==
tmpDir==/run/user/601613==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
[12:09:37.051] Server installation process already in progress - waiting and retrying
[12:09:37.406] "install" terminal command done
[12:09:37.406] Install terminal quit with output:
[12:09:38.055] Running script with connection command: ssh -T -D 55819 "<host>" bash
[12:09:38.056] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[12:09:38.289] >
[12:09:38.289] Got some output, clearing connection timeout
[12:09:38.752] > two-factor login for <user>
>
> Enter a passcode or select one of the following options:
> Passcode or option (1-6):
This keeps repeating without end

MobaXterm gets stuck on "Please wait while opening file..." dialog

I am using MobaXterm v20.6 build 4532 to connect to a Linux machine over SSH. I am trying to open a file in the Scp panel on the left by double-clicking on it, and this brings up a dialog box saying "Please wait while opening file...", and it gets stuck here forever.
Interestingly enough, this works on some servers but not others. Is there some way to debug this? Is there a log file which shows the scp command that MobaXterm is trying to run?
I figured out the problem. I was able to enable logging by running "MobaXterm.exe -log". This left a log in C:\Users\jdoe\Documents\MobaXterm\MobaXterm.log. This was printed when I tried to open a file:
[11:31.39.305] (SSH-Browser) Starting MobaSCP(2, OpenFile, /local/jdoe/.bashrc, C:\Users\JDOE\DOCUME~1\MobaXterm\slash\RemoteFiles\526608_2_0\.bashrc)
[11:31.39.307] BEGIN ShellExecuteA(C:\Users\JDOE\DOCUME~1\MobaXterm\slash\bin\MobaSCPOpenFile.exe, -v -batch -scp -load "TERM5266082" mobauser#mobaserver:"/local/jdoe/.bashrc" "C:\Users\JDOE\DOCUME~1\MobaXterm\slash\RemoteFiles\526608_2_0\.bashrc")
[11:31.39.308] ShellExecuteA: ShellExecuteEx succeeded.
[11:31.39.308] END ShellExecuteA(C:\Users\JDOE\DOCUME~1\MobaXterm\slash\bin\MobaSCPOpenFile.exe, -v -batch -scp -load "TERM5266082" mobauser#mobaserver:"/local/jdoe/.bashrc" "C:\Users\JDOE\DOCUME~1\MobaXterm\slash\RemoteFiles\526608_2_0\.bashrc")
[11:31.39.405] [MobaSCP2] Multiplex=0
[11:31.39.406] [MobaSCP2] HOSTNAME: 192.168.1.104
[11:31.39.406] [MobaSCP2] USERNAME: jdoe
[11:31.39.724] Received verification request for hostkey: ssh-ed25519#22:192.168.1.104
[11:31.39.724] Hostkey corresponds to the cached one
[11:31.39.748] WMNewTab2: Saving sshkey and NOT CONNECTING SSH-Browser...
[11:31.39.748] BEGIN SavePassword
[11:31.39.749] END SavePassword
[11:31.39.845] [MobaSCP2] Using SCP1
[11:31.39.845] [MobaSCP2] Connected to 192.168.1.104
[11:31.39.845] [MobaSCP2] Protocol error: Expected control record
Looks like the "Expected control record" error was being caused by my .bashrc printing output. Apparently this confuses SCP: https://documentation.help/PuTTY/faq-pscp-protocol.html
I was able to fix this by changing my .bashrc to not print anything.

127 Build step > 'Execute shell script on remote host using ssh' marked build as > failure Finished: FAILURE

I am trying to use sh or ssh to connect to a linux box via jenkins (I am a noob admittedly). Even trying a ls command I am getting error - I did have this working before however - any help greatly appreciated.
Building in workspace /var/lib/jenkins/jobs/Demo/workspace executing
script:
USER="jenkins" sh '''#!/bin/bash
HOST=10.59.151.121
USER=devuser
PASSWORD=TGMCfpfS
ls
bye
EOF
'''
: No such file or directory [SSH] exit-status: 127 Build step
'Execute shell script on remote host using ssh' marked build as
failure Finished: FAILURE
For some reason I found that adding commands after the ''' allows them to be executed - even although the same warning appears, it works fine!

Switching the update channel on Firefox Flame fails

I tried to follow the steps to change the update channel described here: Switch to nightly update channel. But the phone won't reboot after executing change_channel.sh because the scripts fails with
$ ./change_channel.sh -v aurora
adbd is already running as root
remount succeeded
cannot stat '/tmp/channel-prefs/updates.js': No such file or directory
Currently I have B2G 21.0.0.0-prerelease installed from here.
I you open the script and read the line 57, there is
cat >$TMP_DIR/updates.js <<UPDATES
If it fails to create the file in that directory, he won't be able to push it when doing adb push:
$ADB push $TMP_DIR/updates.js $B2G_PREF_DIR/updates.js
So check your permissions or change the temp directory to let your script create the updates.js file,
TMP_DIR=/tmp/channel-prefs

Resources