I generate correct deployment config by script, but deployment throws ssh error

I generate deployment.xml, sshConfigs.xml and webServers.xml by script from template. Generated configs are identical to ones, created by webstorm. But, if I try to "Browse remote host" with generated configs, it throws error

 

But, if i push "Test connection" button here

 

Which shows "Successfully connected"

And after in "Deployment" window also push "Test Connection"

Which also shows

Then "Browse remote host" starts working fine.

 

Could you please tell me, what to do, to make it working without pushing "Test connection" buttons?

6 comments
Comment actions Permalink

Checked that and it worked fine for me. Did you paste the files into .idea folder while the project was closed?

0
Comment actions Permalink

Could you please check if you have correct Deployment Mappings on Mappings tab after your project creation? I've recently faced a similar problem and perhaps they have something common: https://youtrack.jetbrains.com/issue/WI-68662

0
Comment actions Permalink

mapping is ok.

 

> Checked that and it worked fine for me. 
did you tried to generate config, which is different from the current?

If I generate the same config as current, everything works fine, but I need to generate different)

 

> Did you paste the files into .idea folder while the project was closed?
I generate configs and paste them into .idea folder while WS is opened. I don't close it. I just push 'Reload from disk' on .idea folder, to make WS see configs and start pushing "test connection" button procedure)

0
Comment actions Permalink

> did you tried to generate config, which is different from the current?

I've created a deployment configuration that wasn't existing before in a project. Do you mean that?

0
Comment actions Permalink

my templates are:

deploymen.xml

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" serverName="nanny" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false">
<option name="confirmBeforeUploading" value="false" />
<serverData>
<paths name="nanny">
<serverdata>
<mappings>
<mapping deploy="/" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
</component>
</project>

sshConfigs.xml

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SshConfigs">
<configs>
<sshConfig authType="OPEN_SSH" host="{{ env.host }}" id="{{ env.ssh_conf_id }}" port="22" nameFormat="DESCRIPTIVE" username="{{ env.username }} " useOpenSSHConfig="true" />
</configs>
</component>
</project>

 

webServers.xml

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebServers">
<option name="servers">
<webServer id="{{ env.web_server_id }}" name="nanny" url="http://localhost">
<fileTransfer rootFolder="{{ env.root_folder }}" accessType="SFTP" host="{{ env.host }}" port="22" sshConfigId="{{ env.ssh_conf_id }}" sshConfig="{{ env.username }}@{{ env.host }}:22 agent" authAgent="true">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" keepAliveTimeout="0" passiveMode="true" shareSSLContext="true" isUseRsync="true" />
</advancedOptions>
</fileTransfer>
</webServer>
</option>
</component>
</project>

 

and templater.bash

#!/usr/bin/env bash

ssh_command=$1;

export host=$4;

export username=$3;

echo "username $username"

export root_folder=$(eval "${1} ${2} '${3}' ${4} -o StrictHostKeyChecking=no 'pwd'");

export ssh_conf_id='693ca004-3fc9-4ca4-a927-f8f0367cb5eb';

export web_server_id='4c04b2af-fa14-4fdd-b483-4efad8f84ba9';

templater -d .idea

ssh_conf_id and web_server_id were taken from configs generated by WS

May be you see something wrong here?)

 

Why it starts working after "test connection" buttons?)

0
Comment actions Permalink

Looks fine to me. Unfortunately I can't see why it works only after pressing "test connection". Perhaps there are some internal mechanisms, similar to caching, that aren't populated till you press that button. 

0

Please sign in to leave a comment.