Can't open remote ssh directory after update - linux

I have been using VSCode on a Windows laptop for an ssh remote directory on a Linux machine. Things were working fine until an update of VSCode 1.68.0 and now I can't open the remote directory.
On Windows, the output says:
[12:55:24.183] Log Level: 2
[12:55:24.185] remote-ssh#0.82.1
[12:55:24.185] win32 x64
[12:55:24.226] SSH Resolver called for "ssh-remote+ubuntu", attempt 1
[12:55:24.227] "remote.SSH.useLocalServer": false
[12:55:24.227] "remote.SSH.showLoginTerminal": false
[12:55:24.227] "remote.SSH.remotePlatform": {"runon":"linux","pfuntner-kube":"linux","everyday":"linux","kube":"linux","ubuntu":"linux"}
[12:55:24.227] "remote.SSH.path": C:\cygwin64\bin\ssh.exe
[12:55:24.228] "remote.SSH.configFile": c:\users\jpfuntne\.ssh\config
[12:55:24.228] "remote.SSH.useFlock": true
[12:55:24.228] "remote.SSH.lockfilesInTmp": false
[12:55:24.228] "remote.SSH.localServerDownload": auto
[12:55:24.229] "remote.SSH.remoteServerListenOnSocket": false
[12:55:24.229] "remote.SSH.showLoginTerminal": false
[12:55:24.229] "remote.SSH.defaultExtensions": []
[12:55:24.229] "remote.SSH.loglevel": 2
[12:55:24.229] "remote.SSH.enableDynamicForwarding": true
[12:55:24.230] "remote.SSH.enableRemoteCommand": false
[12:55:24.230] "remote.SSH.serverPickPortsFromRange": {}
[12:55:24.230] "remote.SSH.serverInstallPath": {}
[12:55:24.239] SSH Resolver called for host: ubuntu
[12:55:24.239] Setting up SSH remote "ubuntu"
[12:55:24.247] Using commit id "4af164ea3a06f701fe3e89a2bcbb421d2026b68f" and quality "stable" for server
[12:55:24.254] Install and start server if needed
[12:55:24.257] Checking ssh with "C:\cygwin64\bin\ssh.exe -V"
[12:55:24.568] > OpenSSH_8.8p1, OpenSSL 1.1.1l 24 Aug 2021
[12:55:24.574] Using SSH config file "c:\users\jpfuntne\.ssh\config"
[12:55:24.575] Running script with connection command: "C:\cygwin64\bin\ssh.exe" -T -D 65341 -F "c:\users\jpfuntne\.ssh\config" ubuntu bash
[12:55:24.591] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[12:55:25.421] > WARNING!!!
> READ THIS BEFORE ATTEMPTING TO LOGON
>
> This System is for the use of authorized users only. Individuals
> using this computer without authority, or in excess of their
> authority, are subject to having all of their activities on this
> system monitored and recorded by system personnel. In the course
> of monitoring individuals improperly using this system, or in the
> course of system maintenance, the activities of authorized users
> may also be monitored. Anyone using this system expressly
> consents to such monitoring and is advised that if such
> monitoring reveals possible criminal activity, system personnel
> may provide the evidence of such monitoring to law enforcement
> officials.
>
> Cisco Acceptable Use Policy:
> http://wwwin.cisco.com/c/cec/organizations/security-trust/infosec/policies
> .html]0;C:\WINDOWS\System32\cmd.exe
[12:55:25.421] Got some output, clearing connection timeout
[12:55:26.367] > 28e76cc256c4: running
[12:55:26.405] > Acquiring lock on /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb42
> 1d2026b68f/vscode-remote-lock.ubuntu.4af164ea3a06f701fe3e89a2bcbb421d2026b68f
[12:55:26.430] > Installing to /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d20
> 26b68f...
> 28e76cc256c4%%1%%
> Downloading with wget
[12:55:33.759] > wget download failed
> failed: Connection timed out.
> printenv:
> SHELL=/bin/bash
> PWD=/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f
> LOGNAME=ubuntu
> XDG_SESSION_TYPE=tty
> MOTD_SHOWN=pam
> HOME=/home/ubuntu
> LANG=C.UTF-8
> VSCODE_AGENT_FOLDER=/home/ubuntu/.vscode-server
> SSH_CONNECTION=10.82.235.230 65347 64.102.189.72 22
> XDG_SESSION_CLASS=user
> USER=ubuntu
> SHLVL=0
> XDG_SESSION_ID=5
> XDG_RUNTIME_DIR=/run/user/1000
> SSH_CLIENT=10.82.235.230 65347 22
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> :/usr/local/games:/snap/bin
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> OLDPWD=/home/ubuntu
> _=/usr/bin/printenv
[12:55:33.764] >
> Trigger local server download
> 28e76cc256c4:trigger_server_download
> platform==linux==
> vscodeArch==x64==
> destFolder==/home/ubuntu/.vscode-server/bin/==
> destFolder2==4af164ea3a06f701fe3e89a2bcbb421d2026b68f==
> 28e76cc256c4:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026
> b68f/vscode-scp-done.flag and vscode-server.tar.gz to exist
[12:55:33.765] Got request to download on client for {"platform":"linux","arch":"x64","destFolder":"/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f"}
[12:55:33.765] Downloading VS Code server locally...
[12:55:33.770] >
>
[12:55:34.131] Resolver error: Error: Server returned 404
at v (vscode-file://vscode-app/c:/Users/jpfuntne/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:622:38476)
at k.download (vscode-file://vscode-app/c:/Users/jpfuntne/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:623:1592)
[12:55:34.136] ------
On Linux, all I have is:
$ find .vscode-server -type f | xargs -r ls -ld
-rw-rw-r-- 1 ubuntu ubuntu 0 Jun 15 12:55 .vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f/vscode-remote-lock.ubuntu.4af164ea3a06f701fe3e89a2bcbb421d2026b68f
-rw-rw-r-- 1 ubuntu ubuntu 0 Jun 15 12:55 .vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f/vscode-server.tar.gz
$
When I was first having trouble, I did rm -rf .vscode to fix things but it didn't help.
Can anyone help?

I tried to start VSCode again today. At first I thought it had the same problem but it looks like things are working ok now and I got in!
[07:14:44.009] Log Level: 2
[07:14:44.010] remote-ssh#0.82.1
[07:14:44.010] win32 x64
[07:14:44.048] SSH Resolver called for "ssh-remote+ubuntu", attempt 1
[07:14:44.048] "remote.SSH.useLocalServer": false
[07:14:44.049] "remote.SSH.showLoginTerminal": false
[07:14:44.049] "remote.SSH.remotePlatform": {"runon":"linux","pfuntner-kube":"linux","everyday":"linux","kube":"linux","ubuntu":"linux"}
[07:14:44.049] "remote.SSH.path": C:\cygwin64\bin\ssh.exe
[07:14:44.049] "remote.SSH.configFile": c:\users\jpfuntne\.ssh\config
[07:14:44.049] "remote.SSH.useFlock": true
[07:14:44.049] "remote.SSH.lockfilesInTmp": false
[07:14:44.049] "remote.SSH.localServerDownload": auto
[07:14:44.050] "remote.SSH.remoteServerListenOnSocket": false
[07:14:44.050] "remote.SSH.showLoginTerminal": false
[07:14:44.050] "remote.SSH.defaultExtensions": []
[07:14:44.050] "remote.SSH.loglevel": 2
[07:14:44.050] "remote.SSH.enableDynamicForwarding": true
[07:14:44.050] "remote.SSH.enableRemoteCommand": false
[07:14:44.050] "remote.SSH.serverPickPortsFromRange": {}
[07:14:44.050] "remote.SSH.serverInstallPath": {}
[07:14:44.056] SSH Resolver called for host: ubuntu
[07:14:44.056] Setting up SSH remote "ubuntu"
[07:14:44.062] Using commit id "4af164ea3a06f701fe3e89a2bcbb421d2026b68f" and quality "stable" for server
[07:14:44.068] Install and start server if needed
[07:14:44.071] Checking ssh with "C:\cygwin64\bin\ssh.exe -V"
[07:14:44.354] > OpenSSH_8.8p1, OpenSSL 1.1.1l 24 Aug 2021
[07:14:44.386] Using SSH config file "c:\users\jpfuntne\.ssh\config"
[07:14:44.387] Running script with connection command: "C:\cygwin64\bin\ssh.exe" -T -D 63895 -F "c:\users\jpfuntne\.ssh\config" ubuntu bash
[07:14:44.400] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[07:14:46.375] > WARNING!!!
> READ THIS BEFORE ATTEMPTING TO LOGON
>
> This System is for the use of authorized users only. Individuals
> using this computer without authority, or in excess of their
> authority, are subject to having all of their activities on this
> system monitored and recorded by system personnel. In the course
> of monitoring individuals improperly using this system, or in the
> course of system maintenance, the activities of authorized users
> may also be monitored. Anyone using this system expressly
> consents to such monitoring and is advised that if such
> monitoring reveals possible criminal activity, system personnel
> may provide the evidence of such monitoring to law enforcement
> officials.
>
> Cisco Acceptable Use Policy:
> http://wwwin.cisco.com/c/cec/organizations/security-trust/infosec/policies
> .html]0;C:\WINDOWS\System32\cmd.exe
[07:14:46.375] Got some output, clearing connection timeout
[07:14:47.361] > cb747be286c8: running
> Acquiring lock on /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb42
> 1d2026b68f/vscode-remote-lock.ubuntu.4af164ea3a06f701fe3e89a2bcbb421d2026b68f
> Installing to /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d20
> 26b68f...
> cb747be286c8%%1%%
> Downloading with wget
[07:14:54.685] > wget download failed
> failed: Connection timed out.
> printenv:
> SHELL=/bin/bash
[07:14:54.692] >
> PWD=/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f
> LOGNAME=ubuntu
> XDG_SESSION_TYPE=tty
> MOTD_SHOWN=pam
> HOME=/home/ubuntu
> LANG=C.UTF-8
> VSCODE_AGENT_FOLDER=/home/ubuntu/.vscode-server
> SSH_CONNECTION=10.82.240.153 63898 64.102.189.72 22
> XDG_SESSION_CLASS=user
> USER=ubuntu
> SHLVL=0
> XDG_SESSION_ID=63
> XDG_RUNTIME_DIR=/run/user/1000
> SSH_CLIENT=10.82.240.153 63898 22
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> :/usr/local/games:/snap/bin
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> OLDPWD=/home/ubuntu
> _=/usr/bin/printenv
[07:14:54.695] >
> Trigger local server download
> cb747be286c8:trigger_server_download
> platform==linux==
> vscodeArch==x64==
> destFolder==/home/ubuntu/.vscode-server/bin/==
> destFolder2==4af164ea3a06f701fe3e89a2bcbb421d2026b68f==
> cb747be286c8:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026
> b68f/vscode-scp-done.flag and vscode-server.tar.gz to exist
>
[07:14:54.697] Got request to download on client for {"platform":"linux","arch":"x64","destFolder":"/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f"}
[07:14:54.698] Downloading VS Code server locally...
[07:14:58.248] Downloaded VS Code server to c:\Users\jpfuntne\AppData\Local\Temp\03ba8324-01be-4f4c-bd89-538da94836ae
[07:14:58.253] Renamed VS Code server to c:\Users\jpfuntne\AppData\Local\Temp\vscode_server_1655378098249\vscode-server.tar.gz
[07:14:58.257] Checking ssh with "C:\cygwin64\bin\ssh.exe -V"
[07:14:58.555] > OpenSSH_8.8p1, OpenSSL 1.1.1l 24 Aug 2021
[07:14:58.581] Expecting scp to be next to ssh at C:\cygwin64\bin\scp.exe
[07:14:58.582] Testing scp with "C:\cygwin64\bin\scp.exe"
[07:14:59.442] scp exited with code: 1
[07:14:59.442] Got stderr from scp: usage: scp [-346ABCOpqRrsTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]
[-i identity_file] [-J destination] [-l limit]
[-o ssh_option] [-P port] [-S program] source ... target
[07:14:59.443] Using SSH config file "c:\users\jpfuntne\.ssh\config"
[07:14:59.445] Copying file to remote with "C:\cygwin64\bin\scp.exe" -F "c:\users\jpfuntne\.ssh\config" "vscode-server.tar.gz" "vscode-scp-done.flag" ubuntu:"/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f"
[07:14:59.447] Using cwd: file:///c%3A/Users/jpfuntne/AppData/Local/Temp/vscode_server_1655378098249
[07:14:59.447] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[07:15:00.744] > WARNING!!!
> READ THIS BEFORE ATTEMPTING TO LOGON
>
> This System is for the use of authorized users only. Individuals
> using this computer without authority, or in excess of their
> authority, are subject to having all of their activities on this
> system monitored and recorded by system personnel. In the course
> of monitoring individuals improperly using this system, or in the
> course of system maintenance, the activities of authorized users
> may also be monitored. Anyone using this system expressly
> consents to such monitoring and is advised that if such
> monitoring reveals possible criminal activity, system personnel
> may provide the evidence of such monitoring to law enforcement
> officials.
>
> Cisco Acceptable Use Policy:
> http://wwwin.cisco.com/c/cec/organizations/security-trust/infosec/policies
> .html]0;C:\WINDOWS\System32\cmd.exe
[07:15:01.620] > vscode-server.tar.gz 0% 0 0.0KB/s --:-- ETA
[07:15:02.630] > vscode-server.tar.gz 32% 17MB 17.0MB/s 00:02 ETA
[07:15:03.645] > vscode-server.tar.gz 66% 36MB 17.1MB/s 00:01 ETA
[07:15:04.691] > vscode-server.tar.gz 100% 54MB 17.4MB/s 00:03
[07:15:04.705] >
[07:15:04.722] > vscode-scp-done.flag 0% 0 0.0KB/s --:-- ETA
[07:15:04.736] > vscode-scp-done.flag 100% 9 0.7KB/s 00:00
[07:15:06.150] "Copy server to host" terminal command done
[07:15:06.702] > Found flag and server on host
> cb747be286c8%%2%%
> tar --version:
[07:15:06.717] >
> tar (GNU tar) 1.30
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> Written by John Gilmore and Jay Fenlason.
[07:15:08.979] > Checking /home/ubuntu/.vscode-server/.4af164ea3a06f701fe3e89a2bcbb421d2026b68f.l
> og and /home/ubuntu/.vscode-server/.4af164ea3a06f701fe3e89a2bcbb421d2026b68f.pid
> for a running server
[07:15:09.019] > Starting server with command... /home/ubuntu/.vscode-server/bin/4af164ea3a06f701
> fe3e89a2bcbb421d2026b68f/bin/code-server --start-server --host=127.0.0.1 --accep
> t-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetry-level
> all &> "/home/ubuntu/.vscode-server/.4af164ea3a06f701fe3e89a2bcbb421d2026b68f.
> log" < /dev/null
> printenv:
> SHELL=/bin/bash
> PWD=/home/ubuntu
> LOGNAME=ubuntu
> XDG_SESSION_TYPE=tty
> MOTD_SHOWN=pam
> HOME=/home/ubuntu
> LANG=C.UTF-8
> VSCODE_AGENT_FOLDER=/home/ubuntu/.vscode-server
> SSH_CONNECTION=10.82.240.153 63898 64.102.189.72 22
> XDG_SESSION_CLASS=user
> USER=ubuntu
> SHLVL=0
> XDG_SESSION_ID=63
> XDG_RUNTIME_DIR=/run/user/1000
> SSH_CLIENT=10.82.240.153 63898 22
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> :/usr/local/games:/snap/bin
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> OLDPWD=/home/ubuntu/.vscode-server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b
> 68f
> _=/usr/bin/printenv
> rm: cannot remove '/home/ubuntu/.vscode-server/.4af164ea3a06f701fe3e89a2bcbb421d
> 2026b68f.token': No such file or directory
[07:15:09.029] >
> Spawned remote server: 60287
[07:15:09.036] >
> Waiting for server log...
[07:15:09.052] >
[07:15:09.080] > Waiting for server log...
[07:15:09.146] >
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
[07:15:09.171] > cb747be286c8: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==35689==
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult==success==
> didLocalDownload==1==
> downloadTime====
> installTime==2258==
> extInstallTime====
> serverStartTime==122==
> connectionToken==1a1a1a1a-1a1a-11a1-aa1a-1111a1111a1a==
[07:15:09.184] > cb747be286c8: end
[07:15:09.184] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==35689==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult==success==
didLocalDownload==1==
downloadTime====
installTime==2258==
extInstallTime====
serverStartTime==122==
connectionToken==1a1a1a1a-1a1a-11a1-aa1a-1111a1111a1a==
[07:15:09.185] Remote server is listening on 35689
[07:15:09.185] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":35689},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"1a1a1a1a-1a1a-11a1-aa1a-1111a1111a1a"},"installTime":2258,"serverStartTime":122,"didLocalDownload":true,"installUnpackCode":"success"}
[07:15:09.193] Starting forwarding server. localPort 63909 -> socksPort 63895 -> remotePort 35689
[07:15:09.195] Forwarding server listening on 63909
[07:15:09.195] Waiting for ssh tunnel to be ready
[07:15:09.257] [Forwarding server 63909] Got connection 0
[07:15:09.260] Tunneled 35689 to local port 63909
[07:15:09.260] Resolved "ssh-remote+ubuntu" to "127.0.0.1:63909"
[07:15:09.272] ------
[07:15:09.300] [Forwarding server 63909] Got connection 1
[07:15:09.650] [Forwarding server 63909] Got connection 2
On Linux:
$ find .vscode-server -type f | wc
1798 1798 196423
$

Related

how to recover files delted using "find /export/reports -mtime +112 -type f -delete"

I wanted to delete .pdf files, i used "find /export/reports -mtime +112 -type f -delete", however i did not applied any filter for .pdf file and end up deleting required files as well.
Can any one please help me with how to recover them?
you can try this:
Use debugfs to view a filesystems log
$ debugfs -w /dev/mapper/wks01-root
At the debugfs prompt
debugfs: lsdel
Sample output
Inode Owner Mode Size Blocks Time deleted
23601299 0 120777 3 1/ 1 Tue Mar 13 16:17:30 2012
7536655 0 120777 3 1/ 1 Tue May 1 06:21:22 2012
2 deleted inodes found.
Run the command in debugfs
debugfs: logdump -i <7536655>
5) Determine files inode
> ... ... .... output truncated
> Fast_link_dest: bin
> Blocks: (0+1): 7235938 FS block 7536642 logged at sequence 38402086, journal block 26711
> (inode block for inode 7536655):
> Inode: 7536655 Type: symlink Mode: 0777 Flags: 0x0 Generation: 3532221116
> User: 0 Group: 0 Size: 3
> File ACL: 0 Directory ACL: 0
> Links: 0 Blockcount: 0
> Fragment: Address: 0 Number: 0 Size: 0
> ctime: 0x4f9fc732 -- Tue May 1 06:21:22 2012
> atime: 0x4f9fc730 -- Tue May 1 06:21:20 2012
> mtime: 0x4f9fc72f -- Tue May 1 06:21:19 2012
> dtime: 0x4f9fc732 -- Tue May 1 06:21:22 2012
> Fast_link_dest: bin
> Blocks: (0+1): 7235938 No magic number at block 28053: end of journal.
With the above inode info run the following commands
dd if=/dev/mapper/wks01-root of=recovered.file.001 bs=4096 count=1
skip=7235938 file recovered.file.001 file: ASCII text, with very long
lines
Files been recovered to recovered.file.001.
there are also some tools which can be helpful:
Recovery Tools - Command Line :
testdisk,
photorec,
extundelete
Recovery Tools - Gui :
R-Linux,
R-Studio,
UFS Explorer,
Recovery Explorer

Metricbeat data is not read by logstash

I have configured Metricbeat to capture system level metrics, Metricbeat is intsalled as a service in Redhat linux , i installed metricbeat using rpm package.
Bellow is my metricbeat configuration .
> #============================ Config Reloading ==============================
> metricbeat.config.modules:
>
> # Glob pattern for configuration reloading
> path: ${path.config}/conf.d/*.yml
>
> # Period on which files under path should be checked for changes
> reload.period: 10s
>
> # Set to true to enable config reloading
> reload.enabled: false
>
> # Maximum amount of time to randomly delay the start of a metricset. Use 0 to
> # disable startup delay.
> metricbeat.max_start_delay: 10s
>
> #------------------------------- System Module -------------------------------
> - module: system
> metricsets:
> - cpu # CPU usage
> - load # CPU load averages
> - memory # Memory usage
> - network # Network IO
> - process # Per process metrics
> - process_summary # Process summary
> - uptime # System Uptime
> #- core # Per CPU core usage
> #- diskio # Disk IO
> #- filesystem # File system usage for each mountpoint
> #- fsstat # File system summary metrics
> #- raid # Raid
> #- socket # Sockets and connection info (linux only)
> enabled: true
> period: 10s
> processes: ['.*']
>
> # Configure the metric types that are included by these metricsets.
> cpu.metrics: ["percentages"] # The other available options are normalized_percentages and ticks.
> core.metrics: ["percentages"] # The other available option is ticks.
>
>
> #----------------------------- Logstash output ---------------------------------
> output.logstash:
> # Boolean flag to enable or disable the output module.
> #enabled: true
>
> # The Logstash hosts
> hosts: ["localhost:5044"]
And logstash is also installed as service in Redhat linux using rpm package.
bellow is my logstash configuration where i am trying to read inputs from
beat.input {
beats {
port => 5044
}
}
output {
elasticsearch {
host => "localhost:9200"
index => "metricbeat_logs"
}
}
bellow is my user and group permissions for both logstash and metricbeat
cd /etc/logstash
ls -lrt
-rw-------. 1 apelkdev apa 1696 Aug 18 02:29 startup.options
> -rw-r--r--. 1 apelkdev apa 285 Aug 18 02:29 pipelines.yml
> -rw-r--r--. 1 apelkdev apa 342 Aug 18 02:29 logstash-sample.conf
> -rw-r--r--. 1 apelkdev apa 4466 Aug 18 02:29 log4j2.properties
> -rw-r--r--. 1 apelkdev apa 1846 Aug 18 02:29 jvm.options
> -rwxr-xr-x. 1 apelkdev apa 8154 Feb 8 07:41 logstash.yml
> drwxrwxr-x. 2 apelkdev apa 4096 Feb 8 10:29 conf.d
cd /etc/metricbeat
ls -lrt
-rw-r--r--. 1 apelkdev apa 57809 Aug 18 00:28 metricbeat.reference.yml
-rw-r--r--. 1 apelkdev apa 76697 Aug 18 00:28 fields.yml
-rw-r--r--. 1 apelkdev apa 0 Feb 7 06:24 metricbeat.
-rw-------. 1 apelkdev apa 7892 Feb 8 08:14 metricbeat.yml
and I am running both the services using bellow commands
sudo service metricbeat start
sudo service logstash start
I am really not getting what went wrong here, when we check metricbeat logs it is having captured metrics details for current timestamp, not very sure what happens to logstash and why it is not reading metricbeat events.
You haven't enabled output to logstash in code.
> output.logstash:
> # Boolean flag to enable or disable the output module.
> #enabled: true
On above please change to
enabled: true

Gitlab-CE reconfigure time out on step "migrate gitlab-rails database"

I try to update gitlab from version 9.5.10 to latest 10. I do 3 steps:
touch /etc/gitlab/skip-auto-migrations ( I don't need backup )
yum -y install gitlab-ce-10.8.7-ce.0.el7.x86_64
gitlab-ctl reconfigure
Gitlab crashes with an error after one hour:
...
Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
================================================================================
Mixlib::ShellOut::CommandTimeout
--------------------------------
Command timed out after 3600s:
Command exceeded allowed execution time, process terminated
---- Begin output of "bash" "/tmp/chef-script20180907-58298-lhgdju" ----
STDOUT: == 20141126120926 AddMergeRequestRebaseEnabledToProjects: migrating ===========
-- transaction_open?()
-> 0.0000s
...
63: end
64: not_if "(test -f #{db_migrate_status_file}) && (cat #{db_migrate_status_file} | grep -Fx 0)"
65: only_if { node['gitlab']['gitlab-rails']['auto_migrate'] }
66: end
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb:49:in `from_file'
bash("migrate gitlab-rails database") do
action [:run]
default_guard_interpreter :default
command nil
backup 5
returns 0
user nil
interpreter "bash"
declared_type :bash
cookbook_name "gitlab"
recipe_name "database_migrations"
code " set -e\n log_file=\"/var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log\"\n umask 077\n /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}\n STATUS=${PIPESTATUS[0]}\n echo $STATUS > /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-141d998df14e11465b19f94d3c4ccfa1-eb600b0\n exit $STATUS\n"
domain nil
not_if "(test -f /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-141d998df14e11465b19f94d3c4ccfa1-eb600b0) && (cat /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-141d998df14e11465b19f94d3c4ccfa1-eb600b0 | grep -Fx 0)"
only_if { #code block }
end
System Info:
------------
chef_version=13.6.4
platform=centos
platform_version=7.4.1708
ruby=ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client
Recipe: gitlab::unicorn
* service[unicorn] action restart
ESC[32m- restart service service[unicorn]
Recipe: gitlab::sidekiq
* service[sidekiq] action restart
ESC[32m- restart service service[sidekiq]
Recipe: gitlab::gitlab-rails
* execute[clear the gitlab-rails cache] action run
ESC[32m- execute /opt/gitlab/bin/gitlab-rake cache:clear
Running handlers:
Running handlers complete
Chef Client failed. 25 resources updated in 01 hours 01 minutes 28 seconds
I found workaround but I don't want to risk changing the update procedure. GitLab is used in the production and use of more than 1000 people (An update check is performed on the copy of the database).
Does anyone know how to increase the timeout?
Ok, turning this into an answer so other people might be able to use this:
Unless someone knows of a way to override the default timeout for Mixlib::ShellOut in this case, it is possible to override that default of 3600 in opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/chef-13.6.4/lib/chef/provider/execute.rb line 44-48, which currently read:
def timeout
# original implementation did not specify a timeout, but ShellOut
# *always* times out. So, set a very long default timeout
new_resource.timeout || 3600
end
Increasing the 3600 there should help.

/etc/rc.local fails to launch script (supercollider) on boot

In Debian running headless on an arm-based single-board computer (C.H.I.P.), I have this in my /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
source /usr/local/bin/gpio.sh
gpio_export CSID5
gpio_direction CSID5 out
gpio_output CSID5 1
gpio_export XIO_P1
gpio_direction XIO_P1 in
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
export DISPLAY=:0
cd /home/chip/Inhibition
now=$(date +"%m_%d_%Y")
date >> "log_$now.log"
jackd -P99 -dalsa -Phw:1 -p8192 -n3 -s -r44100 &
sleep 30
sclang main.scd >> "log_$now.log"
exit 0
when running the script as root with
/etc/rc.local
everything runs as expected.
However when booting the last command (sclang main.scd >> "log_$now.log") is never run. (sclang is the command line interpreter of supercollider). I did try running some test commands to see whether executions stops when launching jack but these commands are executed as expected - it's just supercollider that fails to start at boot time.
any ideas?
PS I remember setting this up in a similar way in a Raspberry pi running Raspbian - can't confirm it now, but I am almost sure that the code was like that.
EDIT
I tried comparing the shell environments from the command prompt (once booted) and from within rc.local (env1 is the command shell, env2 is the rc.local shell):
diff env1 env2
1,2c1,4
< BASH=/bin/bash
< BASHOPTS=checkwinsize:cmdhist:complete_fullquote:expand_aliases:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
---
> AP_EINT1=193
> AP_EINT3=35
> BASH=/bin/sh
> BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
4,5c6,7
< BASH_ARGC=()
< BASH_ARGV=()
---
> BASH_ARGC=([0]="1")
> BASH_ARGV=([0]="start")
7,8c9,10
< BASH_LINENO=()
< BASH_SOURCE=()
---
> BASH_LINENO=([0]="0")
> BASH_SOURCE=([0]="/etc/rc.local")
11c13,25
< COLUMNS=120
---
> CSICK=129
> CSID0=132
> CSID1=133
> CSID2=134
> CSID3=135
> CSID4=136
> CSID5=137
> CSID6=138
> CSID7=139
> CSIHSYNC=130
> CSIPCK=128
> CSIVSYNC=131
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
12a27
> DISPLAY=:0
13a29,30
> GPIO=1017
> GPIO_HASH=([TWI1_SCK]="47" [UART1_TX]="195" [LCD_D22]="118" [LCD_DE]="121" [LCD_D23]="119" [LCD_D20]="116" [LCD_D21]="117" [PWM0]="34" [CSICK]="129" [CSID3]="135" [LCD_D13]="109" [CSID2]="134" [LCD_D12]="108" [CSID1]="133" [LCD_D11]="107" [CSID0]="132" [LCD_D10]="106" [CSID7]="139" [CSID6]="138" [CSID5]="137" [LCD_D15]="111" [CSID4]="136" [LCD_D14]="110" [LCD_D19]="115" [LCD_D18]="114" [LCD_HSYNC]="122" [AP_EINT3]="35" [AP_EINT1]="193" [XIO_P3]="1019" [CSIHSYNC]="130" [LCD_CLK]="120" [XIO_P2]="1018" [XIO_P1]="1017" [TWI2_SCK]="49" [XIO_P0]="1016" [XIO_P7]="1023" [XIO_P6]="1022" [XIO_P5]="1021" [XIO_P4]="1020" [TWI1_SDA]="48" [UART1_RX]="196" [CSIVSYNC]="131" [LCD_D2]="98" [LCD_D3]="99" [LCD_D4]="100" [LCD_D5]="101" [LCD_D6]="102" [LCD_VSYNC]="123" [LCD_D7]="103" [TWI2_SDA]="50" [CSIPCK]="128" )
15,18d31
< HISTFILE=/root/.bash_history
< HISTFILESIZE=500
< HISTSIZE=500
< HOME=/root
21c34,35
< IFS=$' \t\n'
---
> IFS='
> '
23,27c37,58
< LC_ALL=en_US.UTF-8
< LC_CTYPE=UTF-8
< LINES=32
< LOGNAME=root
< LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'
---
> LCD_CLK=120
> LCD_D10=106
> LCD_D11=107
> LCD_D12=108
> LCD_D13=109
> LCD_D14=110
> LCD_D15=111
> LCD_D18=114
> LCD_D19=115
> LCD_D2=98
> LCD_D20=116
> LCD_D21=117
> LCD_D22=118
> LCD_D23=119
> LCD_D3=99
> LCD_D4=100
> LCD_D5=101
> LCD_D6=102
> LCD_D7=103
> LCD_DE=121
> LCD_HSYNC=122
> LCD_VSYNC=123
29,30c60
< MAIL=/var/mail/root
< MAILCHECK=60
---
> OLDPWD=/
36,38c66,67
< PPID=489
< PS1='${debian_chroot:+($debian_chroot)}\u#\h:\w\$ '
< PS2='> '
---
> POSIXLY_CORRECT=y
> PPID=1
40a70
> PWM0=34
42c72
< SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
---
> SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix
44,48c74,80
< SUDO_COMMAND=/bin/su
< SUDO_GID=1000
< SUDO_UID=1000
< SUDO_USER=chip
< TERM=xterm-256color
---
> TERM=dumb
> TWI1_SCK=47
> TWI1_SDA=48
> TWI2_SCK=49
> TWI2_SDA=50
> UART1_RX=196
> UART1_TX=195
50,53c82,94
< USER=root
< USERNAME=root
< XDG_SESSION_ID=c1
< _=clear
---
> XIO_BASE=1016
> XIO_BASE_FILE=/sys/class/gpio/gpiochip1016/base
> XIO_LABEL_FILE=/sys/class/gpio/gpiochip1016/label
> XIO_P0=1016
> XIO_P1=1017
> XIO_P2=1018
> XIO_P3=1019
> XIO_P4=1020
> XIO_P5=1021
> XIO_P6=1022
> XIO_P7=1023
> _=
> now=10_27_2016
the only weird thing I notice is that /etc/rc.local has BASH set to /bin/sh instead of /bin/bash - I thought that this could be a problem since I do change some env variables so I moved my script (from the first export and bellow) to a run.sh file (which again does work OK on its own) and added this to my /etc/rc.local:
/bin/bash /home/chip/Inhibition/run.sh
unfortunately the results are the same - jack does run but no sclang after that.

How to make Vim autosuggest Lua methods when typing?

For auto-completion, I have installed the youcompleteme and vim-lua-ftplugin, but when I try to trigger the auto-completion, I get the error
> 处理 function
> xolox#lua#omnifunc..xolox#lua#getomnivariables..xolox#lua#dofile..xolox#misc#os#exec
> 时发生错误: 行 163:
> E605: 异常没有被捕获: vim-misc 1.17.6: External command failed with exit code
> 139!^#Command line: sh -c '('\''lua'\'' '\''/home/meijie
> ru/.vim/bundle/vim-lua-ftplugin/misc/lua-ftplugin/omnicomplete.lua'\''
> '\''argcheck'\'' '\''argcheck.doc'\'' '\''argcheck.dump'\'' '\'
> 'argcheck.env'\'' '\''argcheck.graph'\'' '\''argcheck.init'\''
> '\''argcheck.usage'\'' '\''argcheck.utils'\'' '\''base64'\''
> '\''bit32' \'' '\''cjson'\'' '\''cjson.util'\'' '\''coroutine'\''
> '\''crypto'\'' '\''cwrap'\'' '\''cwrap.cinterface'\''
> '\''cwrap.init'\'' '\''cw rap.types'\'' '\''debug'\'' '\''dok'\''
> '\''dok.init'\'' '\''dok.inline'\'' '\''env'\'' '\''env.init'\''
> '\''fftw3'\'' '\''fftw3.cdefs '\'' '\''fftw3.defines'\''
> '\''fftw3.init'\'' '\''gnuplot'\'' '\''gnuplot.gnuplot'\''
> '\''gnuplot.hist'\'' '\''gnuplot.init'\'' '\''gr aph'\''
> '\''graph.Edge'\'' '\''graph.graphviz'\'' '\''graph.init'\''
> '\''graph.Node'\'' '\''graphicsmagick'\'' '\''graphicsmagick.conv
> ert'\'' '\''graphicsmagick.exif'\'' '\''graphicsmagick.Image'\''
> '\''graphicsmag
> 请按 ENTER 或其它命令继续
> 处理 function
> xolox#lua#omnifunc..xolox#lua#getomnivariables..xolox#lua#dofile
> 时发生错误: 行 41:
> E171: 缺少 :endif
> 请按 ENTER 或其它命令继续
> 处理 function xolox#lua#omnifunc 时发生错误:
> 行 10:
> E171: 缺少 :endif
I'm mostly working in torch7. I'd really appreciate a way of getting library methods suggested while typing.

Resources