Comments (4)
Hi, João.
Thanks for sharing the redacted output. It's still not clear where is the issue.
Could you also check and copy the logs from the
/var/log/amazon/ssm/amazon-ssm-agent.log
that appear when you run thesm-ssh-ide ssm-agent
command?You can do this by opening and image terminal (the small icon with
$_
sign at the toolbar) and copying the log file to the home directory with the following command:cp /var/log/amazon/ssm/amazon-ssm-agent.log ~
Then you can open this file from a file browser and copy-paste the relevant lines here or download and attach the whole file (if possible).
Regards, Ivan
Hi @ivan-khvostishkov ,
I checked the logs as you suggested and found that there were some AccessDenied errors due to SSM permissions missing in the role that I was using. Added them and it works now, can connect from local to the instance! Thanks for the tips and looking forward to starting using this.
from sagemaker-ssh-helper.
Hi, João.
Thank you for the interest in the SageMaker SSH Helper!
When you run the steps in the notebook, the command sm-ssh-ide ssm-agent
connects to the SSM Agent and you should keep it running (do not stop the kernel). To validate that the SageMaker Studio app has connected to SSM, go to the Systems Manager Console > Fleet Manager and check that a new managed node appeared in the list and got the “SSM Agent ping status” as Online.
When it's Online, the command sm-local-ssh-ide <<kernel_gateway_app_name>>
should establish a connection successfully.
Hope it helps!
But if it's still doesn't work, please, share the output of the cell with sm-ssh-ide init-ssm
command.
Regards,
Ivan
from sagemaker-ssh-helper.
Hi, João.
Thank you for the interest in the SageMaker SSH Helper!
When you run the steps in the notebook, the command
sm-ssh-ide ssm-agent
connects to the SSM Agent and you should keep it running (do not stop the kernel). To validate that the SageMaker Studio app has connected to SSM, go to the Systems Manager Console > Fleet Manager and check that a new managed node appeared in the list and got the “SSM Agent ping status” as Online.When it's Online, the command
sm-local-ssh-ide <<kernel_gateway_app_name>>
should establish a connection successfully.Hope it helps!
But if it's still doesn't work, please, share the output of the cell with
sm-ssh-ide init-ssm
command.Regards, Ivan
Hi Ivan,
Thanks for the quick reply. I checked that after I run sm-ssh-ide ssm-agent
the instance does not show up in Fleet Manager.
Please find below the output of sm-ssh-ide init-ssm
:
Output
``` sm-ssh-ide: Will add the following tags to the managed instance: Key=SSHOwner, Value=XXXX Reading package lists... Building dependency tree... Reading state information... Suggested packages: zip The following packages will be upgraded: unzip 1 upgraded, 0 newly installed, 0 to remove and 72 not upgraded. Need to get 172 kB of archives. After this operation, 1024 B of additional disk space will be used. Get:1 http://security.debian.org/debian-security buster/updates/main amd64 unzip amd64 6.0-23+deb10u3 [172 kB] Fetched 172 kB in 0s (12.3 MB/s) (Reading database ... 61001 files and directories currently installed.) Preparing to unpack .../unzip_6.0-23+deb10u3_amd64.deb ... Unpacking unzip (6.0-23+deb10u3) over (6.0-23+deb10u2) ... Setting up unzip (6.0-23+deb10u3) ... Processing triggers for mime-support (3.62) ... Processing triggers for man-db (2.8.5-2) ... You can now run: /usr/local/bin/aws --version (Reading database ... 61001 files and directories currently installed.) Preparing to unpack /tmp/amazon-ssm-agent.deb ... Stopping agent Preparing for install Unpacking amazon-ssm-agent (3.1.1927.0-1) over (3.1.1927.0-1) ... Setting up amazon-ssm-agent (3.1.1927.0-1) ... Starting agent Error occurred fetching the seelog config file path: open /etc/amazon/ssm/seelog.xml: no such file or directory Initializing new seelog logger New Seelog Logger Creation Complete Applying config override from /etc/amazon/ssm/amazon-ssm-agent.json. 2022-11-04 15:52:39 WARN Could not read InstanceFingerprint file: InstanceFingerprint does not exist. Applying config override from /etc/amazon/ssm/amazon-ssm-agent.json. 2022-11-04 15:52:39 INFO No initial fingerprint detected, generating fingerprint file... 2022-11-04 15:52:40 INFO Successfully registered the instance with AWS SSM using Managed instance-id: mi-0c4fdec4a874d9fee Reading package lists... Building dependency tree... Reading state information... The following NEW packages will be installed: sudo 0 upgraded, 1 newly installed, 0 to remove and 72 not upgraded. Need to get 1244 kB of archives. After this operation, 3882 kB of additional disk space will be used. Get:1 http://deb.debian.org/debian buster/main amd64 sudo amd64 1.8.27-1+deb10u3 [1244 kB] Fetched 1244 kB in 0s (28.2 MB/s) Selecting previously unselected package sudo. (Reading database ... 61001 files and directories currently installed.) Preparing to unpack .../sudo_1.8.27-1+deb10u3_amd64.deb ... Unpacking sudo (1.8.27-1+deb10u3) ... Setting up sudo (1.8.27-1+deb10u3) ... invoke-rc.d: could not determine current runlevel invoke-rc.d: policy-rc.d denied execution of start. Processing triggers for man-db (2.8.5-2) ... Processing triggers for systemd (241-7~deb10u8) ... Unable to load extension: pydevd_plugins.extensions.types.pydevd_plugin_pandas_types cp: '/usr/local/bin/sm-helper-functions' and '/usr/local/bin/sm-helper-functions' are the same file cp: '/usr/local/bin/sm-connect-ssh-proxy' and '/usr/local/bin/sm-connect-ssh-proxy' are the same file cp: '/usr/local/bin/sm-wait' and '/usr/local/bin/sm-wait' are the same file cp: '/usr/local/bin/sm-start-ssh' and '/usr/local/bin/sm-start-ssh' are the same file cp: '/usr/local/bin/sm-save-env' and '/usr/local/bin/sm-save-env' are the same file cp: '/usr/local/bin/sm-init-ssm' and '/usr/local/bin/sm-init-ssm' are the same file cp: '/usr/local/bin/sm-ssh-ide' and '/usr/local/bin/sm-ssh-ide' are the same file cp: '/usr/local/bin/sm-local-start-ssh' and '/usr/local/bin/sm-local-start-ssh' are the same file cp: '/usr/local/bin/sm-local-ssh-ide' and '/usr/local/bin/sm-local-ssh-ide' are the same file cp: '/usr/local/bin/sm-local-ssh-training' and '/usr/local/bin/sm-local-ssh-training' are the same file if _is_centos; then yum install -y unzip else apt-get install -y unzip fi debconf: delaying package configuration, since apt-utils is not installed_install_aws_cli
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 45.1M 100 45.1M 0 0 105M 0 --:--:-- --:--:-- --:--:-- 104M
if _is_centos; then
_install_ssm_agent_centos
else
_install_ssm_agent_ubuntu
fi
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 30.5M 100 30.5M 0 0 92.9M 0 --:--:-- --:--:-- --:--:-- 92.9M
cat >/etc/amazon/ssm/amazon-ssm-agent.json <<EOF
{
"Profile":{
"ShareCreds" : true,
"ShareProfile" : "ssm",
"ForceUpdateCreds" : false,
"KeyAutoRotateDays": 0
}
}
EOF
response=$(aws ssm create-activation \
--description "Activation for Amazon SageMaker integration with SSH and IDEs" \
--iam-role "$SSH_SSM_ROLE" \
--registration-limit 1 \
--region "$CURRENT_REGION" \
--tags "$SSH_SSM_TAGS")
if _is_centos; then
yum install -y jq
fi
acode=$(echo $response | jq --raw-output '.ActivationCode')
aid=$(echo $response | jq --raw-output '.ActivationId')
echo Yes | amazon-ssm-agent -register -id "$aid" -code "$acode" -region "$CURRENT_REGION"
2022/11/04 15:52:39 Found config file at /etc/amazon/ssm/amazon-ssm-agent.json.
2022/11/04 15:52:39 processing appconfig overrides
Found config file at /etc/amazon/ssm/amazon-ssm-agent.json.
processing appconfig overrides
# See https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started-ssm-user-permissions.html
if _is_centos; then
yum install -y sudo
else
apt-get install -y sudo
fi
debconf: delaying package configuration, since apt-utils is not installed
echo "ssm-user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ssm-agent-users
```
from sagemaker-ssh-helper.
Hi, João.
Thanks for sharing the redacted output. It's still not clear where is the issue.
Could you also check and copy the logs from the /var/log/amazon/ssm/amazon-ssm-agent.log
that appear when you run the sm-ssh-ide ssm-agent
command?
You can do this by opening and image terminal (the small icon with $_
sign at the toolbar) and copying the log file to the home directory with the following command:
cp /var/log/amazon/ssm/amazon-ssm-agent.log ~
Then you can open this file from a file browser and copy-paste the relevant lines here or download and attach the whole file (if possible).
Regards,
Ivan
from sagemaker-ssh-helper.
Related Issues (20)
- [Issue]failed to find agent identity HOT 6
- [Issue] `sm-local-configure` breaks on MacOS HOT 4
- Issue] STS client is not using regional endpoints HOT 2
- [Feature] Make switching instances in SageMaker Studio and PyCharm more smooth
- [Feature] Support HF accelerate and DeepSpeed for inference HOT 1
- Thoughts on using a configuration management framework? HOT 6
- sm-local-configure only works with bash like installations - no Powershell/CMD support / Windows support at all HOT 4
- Error occurred when starting amazon-ssm-agent: failed to get identity: failed to find agent identity HOT 1
- Are scripts supposed to work on SageMaker notebook instances? HOT 12
- How to install VSCode, other apps in WebVNC view? HOT 2
- JupyterServer URL suffix when tunnelling into KernelGateway app HOT 2
- Notebook `SageMaker_SSH_Notebook.ipynb` fails due to docker-compose HOT 5
- Enable advanced-instances tier to use Session Manager with your on-premises instances HOT 2
- Connecting to SageMaker BYOC Inference Endpoint? HOT 2
- SSH port forwarding to KernelGateway app container HOT 2
- [Question] Shell environment different from web terminal HOT 2
- [bug] - `SageMaker_SSH_IDE.ipynb` does not work HOT 1
- [Feature] Support shared spaces in SageMaker Studio Classic
- [Feature] Support the updated SageMaker Studio experience HOT 1
- [Question] How to connect to sagemaker notebooks HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sagemaker-ssh-helper.