How to connect to AWS Code Commit using GIT integration?

The docs describe how to connect to Bitbucket, Gitlab and Github all of which have the same workflow. We use Code Commit and as we try to add your public key to IAM user who has CodeCommit privileges we run into an issue as CodeCommit requires OpenSSH format key (SSH-2 RSA), and yours seems to be ecdsa-sha2-nistp256.

How do we make Appsmith work with CodeCommit?

Just discovered when can hit 3 dots menu next to the key and regenerate as SSH-2 RSA. This should probably be in the docs.

Unfortunately, while the new keys is accepted as “SSH public keys for AWS CodeCommit” still can’t connect to the repo.

Was following docs here: Setup steps for SSH connections to AWS CodeCommit repositories on Linux, macOS, or Unix - AWS CodeCommit

I think there might be an issue at step 3.7-3.8, unless you don’t need the SHH Key id from CodeCommit.

Some troubleshooting steps are mentioned here, but that’s probably need to be done on your side:

Hello Mike! Please send us the server logs to help us investigate the issue. You can grab the logs by running docker logs -f appsmith.
Or you could follow the steps from this guide on how to get the logs

GIT CONFIGURATION ERROR

SSH key is not configured correctly. Did you forget to add the SSH key to your remote repository? Please try again by reconfiguring the SSH key with write access.

Logs:

backend stdout | [2023-02-14 22:37:46,031] userEmail=appsmith@example.com, sessionId=5c3cb7f0-09e4-462d-8514-8196bb318e4c, thread=boundedElastic-86, requestId=3e9e901b-2825-45c5-9801-7cbe56ac8cf7 - boundedElastic-86: Cloning the repo from the remote ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/xyz
backend stdout |
backend stdout | [2023-02-14 22:37:46,136] userEmail=appsmith@example.com, sessionId=5c3cb7f0-09e4-462d-8514-8196bb318e4c, thread=boundedElastic-86, requestId=3e9e901b-2825-45c5-9801-7cbe56ac8cf7 - Error while cloning the remote repo,
backend stdout | org.eclipse.jgit.api.errors.TransportException: ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/xyz: Auth fail
backend stdout | at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:224)
backend stdout | at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:311)
backend stdout | at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:182)
backend stdout | at com.appsmith.git.service.GitExecutorImpl.lambda$cloneApplication$6(GitExecutorImpl.java:259)
backend stdout | at reactor.core.publisher.MonoCallable$MonoCallableSubscription.request(MonoCallable.java:137)
backend stdout | at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.request(Operators.java:2305)
backend stdout | at reactor.core.publisher.SerializedSubscriber.request(SerializedSubscriber.java:151)
backend stdout | at reactor.core.publisher.SerializedSubscriber.request(SerializedSubscriber.java:151)
backend stdout | at reactor.core.publisher.MonoSubscribeOn$SubscribeOnSubscriber.trySchedule(MonoSubscribeOn.java:189)
backend stdout | at reactor.core.publisher.MonoSubscribeOn$SubscribeOnSubscriber.onSubscribe(MonoSubscribeOn.java:134)
backend stdout | at com.appsmith.server.configurations.MDCConfig$MdcContextLifter.onSubscribe(MDCConfig.java:47)
backend stdout | at reactor.core.publisher.SerializedSubscriber.onSubscribe(SerializedSubscriber.java:65)
backend stdout | at reactor.core.publisher.SerializedSubscriber.onSubscribe(SerializedSubscriber.java:65)
backend stdout | at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.onSubscribe(FluxTimeout.java:154)
backend stdout | at com.appsmith.server.configurations.MDCConfig$MdcContextLifter.onSubscribe(MDCConfig.java:47)
backend stdout | at reactor.core.publisher.MonoCallable.subscribe(MonoCallable.java:48)
backend stdout | at reactor.core.publisher.Mono.subscribe(Mono.java:4444)
backend stdout | at reactor.core.publisher.MonoSubscribeOn$SubscribeOnSubscriber.run(MonoSubscribeOn.java:126)
backend stdout | at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
backend stdout | at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
backend stdout | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
backend stdout | at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
backend stdout | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
backend stdout | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
backend stdout | at java.base/java.lang.Thread.run(Thread.java:833)
backend stdout | Caused by: org.eclipse.jgit.errors.TransportException: ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/xyz: Auth fail
backend stdout | at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:162)
backend stdout | at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:107)
backend stdout | at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.(TransportGitSsh.java:281)
backend stdout | at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:153)
backend stdout | at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:142)
backend stdout | at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:94)
backend stdout | at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1309)
backend stdout | at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:213)
backend stdout | … 24 common frames omitted
backend stdout | Caused by: com.jcraft.jsch.JSchException: Auth fail
backend stdout | at com.jcraft.jsch.Session.connect(Session.java:519)
backend stdout | at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:115)
backend stdout | … 31 common frames omitted
backend stdout |
backend stdout | [2023-02-14 22:37:46,139] userEmail=appsmith@example.com, sessionId=5c3cb7f0-09e4-462d-8514-8196bb318e4c, thread=boundedElastic-86, requestId=3e9e901b-2825-45c5-9801-7cbe56ac8cf7 -
backend stdout | com.appsmith.server.exceptions.AppsmithException: SSH key is not configured correctly. Did you forget to add the SSH key to your remote repository? Please try again by reconfiguring the SSH key with write access.
backend stdout | at com.appsmith.server.services.ce.GitServiceCEImpl.lambda$connectApplicationToGit$37(GitServiceCEImpl.java:700)
backend stdout | Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
backend stdout | Error has been observed at the following site(s):
backend stdout | *__checkpoint ⇢ Handler com.appsmith.server.controllers.GitController#connectApplicationToRemoteRepo(String, GitConnectDTO, String) [DispatcherHandler]
backend stdout | Original Stack Trace:

Thank you for sharing the logs. Our team has checked this issue and tested it. Unfortunately, we do not support AWS Code Commit. The reason for this is that AWS Code Commit does not support deploy keys. Hence, even though you configured the key, we do not support this.
I apologize for the inconvenience.

No worries, we used another repo provider.