Google VM Instant - Can't access SSH
Jeff
I've installed ERPNext from Google Click to Deploy since 6 months ago and with that software it worked until last week until I lost access to the system and SSH
When connecting using SSH, the system shows that connecting through the Cloud Identity-Aware proxy failed with code 4003, can anyone help me with this?
Any idea how to fix this problem?
Seri Rojoza
To fix this, you should run the command fsck
on the startup disk .
To do this, you can follow these steps:
- Stop your VM instance (don't delete it):
gcloud compute instances stop [INSTANCE_NAME]
Before detaching the boot disk from the instance, the instance must be stopped. No need to unmount the disk.
- Detach the boot disk from your VM instance (usually DISK_NAME is the same as INSTANCE_NAME):
gcloud compute instances detach-disk [INSTANCE_NAME] --disk=[DISK_NAME]
- Create a debug virtual machine instance:
gcloud compute instances create debug-instance
- Attach your boot disk to debug-instance as a non-boot disk, but do not mount it:
gcloud compute instances attach-disk debug-instance --disk [DISK_NAME] --device-name debug-disk
- Connect to the debug instance:
gcloud compute ssh debug-instance
- Find the root partition of the disk, identified by the command in part1 notation
ls -l /dev/disk/by-id
(in this case/dev/sdb1
):
$ ls -l /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 9 Feb 13 14:56 google-debug-disk -> ../../sdb
lrwxrwxrwx 1 root root 10 Feb 13 14:56 google-debug-disk-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 11 Feb 13 14:56 google-debug-disk-part14 -> ../../sdb14
lrwxrwxrwx 1 root root 11 Feb 13 14:56 google-debug-disk-part15 -> ../../sdb15
lrwxrwxrwx 1 root root 9 Feb 13 14:56 google-persistent-disk-0 -> ../../sda
lrwxrwxrwx 1 root root 10 Feb 13 14:56 google-persistent-disk-0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 11 Feb 13 14:56 google-persistent-disk-0-part14 -> ../../sda14
lrwxrwxrwx 1 root root 11 Feb 13 14:56 google-persistent-disk-0-part15 -> ../../sda15
lrwxrwxrwx 1 root root 9 Feb 13 14:56 scsi-0Google_PersistentDisk_debug-disk -> ../../sdb
lrwxrwxrwx 1 root root 10 Feb 13 14:56 scsi-0Google_PersistentDisk_debug-disk-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 11 Feb 13 14:56 scsi-0Google_PersistentDisk_debug-disk-part14 -> ../../sdb14
lrwxrwxrwx 1 root root 11 Feb 13 14:56 scsi-0Google_PersistentDisk_debug-disk-part15 -> ../../sdb15
lrwxrwxrwx 1 root root 9 Feb 13 14:56 scsi-0Google_PersistentDisk_persistent-disk-0 -> ../../sda
lrwxrwxrwx 1 root root 10 Feb 13 14:56 scsi-0Google_PersistentDisk_persistent-disk-0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 11 Feb 13 14:56 scsi-0Google_PersistentDisk_persistent-disk-0-part14 -> ../../sda14
lrwxrwxrwx 1 root root 11 Feb 13 14:56 scsi-0Google_PersistentDisk_persistent-disk-0-part15 -> ../../sda15
- Run a filesystem check on the root partition:
sudo fsck /dev/sdb1
E.g:
debug-instance:~$ sudo fsck /dev/sdb1
fsck from util-linux 2.33.1
e2fsck 1.44.5 (15-Dec-2018)
/dev/sdb1: clean, 53782/647168 files, 396250/2588667 blocks
gcloud compute instances stop debug-instance
gcloud compute instances detach-disk debug-instance --disk [DISK_NAME]
- Reconnect the boot disk to your VM instance:
gcloud compute instances attach-disk [INSTANCE_NAME] --disk=[DISK_NAME] --boot
- Start your VM instance:
gcloud compute instances start [INSTANCE_NAME]
gcloud compute instances delete debug-instance
Also, see the document " Removing and Reconnecting the Boot Disk and Troubleshooting VM Startup" .