tag:help.appveyor.com,2012-11-13:/discussions/problems/10133-artifacts-are-not-published-after-uploading-ftp-fileAppVeyor: Discussion 2019-02-05T12:24:11Ztag:help.appveyor.com,2012-11-13:Comment/441454872017-11-28T04:17:07Z2017-11-28T04:17:07ZArtifacts are not published after uploading ftp file<div><p>Hi Oleg,</p>
<p>Project reference you sent is not exactly informative as it will show projects for user logged on, not your projects ;). For example for me it shows my projects.</p>
<p>However I think I found you failed build. It is <a href="https://ci.appveyor.com/project/olegbevz/justwatch-q1kjt/build/1.0.82#L166">here</a>, right?</p>
<p>From what I see error happened when AppVeyor tries to upload build artifacts to the cloud storage, not when running your script. I have not enough enough information now, but it looks like SSL error. This is most probably your build specific issue, because otherwise we should have hundreds of complains now.</p>
<p>Can you try to remove, or move to <code>deployment script</code> stage recently added command executed between <a href="https://ci.appveyor.com/project/olegbevz/justwatch-q1kjt/build/1.0.82#L166">this</a> and <a href="https://ci.appveyor.com/project/olegbevz/justwatch-q1kjt/build/1.0.82#L260">this</a> lines? I think they are now are being called as <code>after test</code> scripts and I believe (just speculation) that recently added command affect SSL settings on build VM, thus breaking artifacts upload. By removing or moving that recently added command (or whole script block) we can check this theory.</p>
<p>Regarding FTP upload, this should work, but I am not sure build even reached that stage (because of artifacts upload issue). However I wonder why you do not consider <a href="https://www.appveyor.com/docs/deployment/ftp/">built-in FTP support</a>?</p>
<p>Ilya.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/441454872017-11-28T09:38:01Z2017-11-28T09:38:01ZArtifacts are not published after uploading ftp file<div><p>Hi Ilya,<br>
Thank you for response and sorry for incorrect link to appveyor projects.</p>
<p>I've already had a lot of experiments commenting/uncommenting code lines in "after tests" script.<br>
Here are lines of code which breaks artifacts upload:<br>
Set-FTPConnection -Credentials $credentials -Server $server -UsePassive -Session MySession -ignoreCert<br>
Add-FTPItem -Path $path -LocalPath $localpath -Overwrite -Session MySession -BufferSize 100KB<br>
These lines of code is from FTP-Upload.ps1 script:<br>
<a href="https://bitbucket.org/olegbevz/justwatch/src/396b42205aadb430d23bf870dbceeec3e578a154/.appveyor/Ftp-Upload.ps1?at=features%2Fappveyor-export&fileviewer=file-view-default">https://bitbucket.org/olegbevz/justwatch/src/396b42205aadb430d23bf8...</a><br>
"Set-FTPConnection" and "Add-FTPItem" are Powershell Cmdlets from PSFTP package - one of the most popular PowerShell modules for FTP tasks. My assumption is that "after tests" script is executed in the same AppDomain as artifact publish logic and somehow breaks SSL settings.</p>
<p>I haven't looked at FTP deployment provider yet. As understand I should publish file as artifact to deploy it to ftp server. But I don't want this file to be stored in build history.<br>
If PowerShell Cmdlets won't work perhaps I will migrate to FTP deployment provider...</p></div>olegbevztag:help.appveyor.com,2012-11-13:Comment/441454872017-11-29T07:48:27Z2017-11-29T07:48:27ZArtifacts are not published after uploading ftp file<div><p>Can you run <code>[Net.ServicePointManager]::SecurityProtocol</code> before and after those commands and see if it changed?</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/441454872017-11-29T13:25:42Z2017-11-29T13:29:09ZArtifacts are not published after uploading ftp file<div><p>Ilya,<br>
I've updated the script: <a href="https://bitbucket.org/olegbevz/justwatch/src/e03ae16da0947910dd0a6a96fe17ae579b4a984d/.appveyor/Ftp-Upload.ps1?at=features%2Fappveyor-export&fileviewer=file-view-default">https://bitbucket.org/olegbevz/justwatch/src/e03ae16da0947910dd0a6a...</a><br>
Seems that before ftp upload following security protocols were specified on VM:Ssl3, Tls, Tls11, Tls12<br>
I tried to restored them after ftp upload but it didn't help.<br>
Perhaps there are more ssl settings which we need to restore...</p></div>olegbevztag:help.appveyor.com,2012-11-13:Comment/441454872017-11-30T05:02:42Z2017-11-30T05:02:42ZArtifacts are not published after uploading ftp file<div><p>I am little bit lost as I cannot understand how it is being called from <a href="https://bitbucket.org/olegbevz/justwatch/src/e03ae16da0947910dd0a6a96fe17ae579b4a984d/appveyor.yml?at=features%2Fappveyor-export&fileviewer=file-view-default">appveyor.yml</a>. But anyway, does FTP upload works? Do you see files uploaded to your server?</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/441454872017-11-30T06:05:52Z2017-11-30T06:05:52ZArtifacts are not published after uploading ftp file<div><p>Hi Ilya, FTP upload works correctly, file is transfered to ftp server. The appveyor.yml from the root folder is not used by appveyor for some reason. In "after tests script" section I have the following line in script:<br>
../.appveyor/Ftp-Upload -server $env:ftp_server -username $env:ftp_username -password $env:ftp_password -path html/yml/ -localpath list.xlsx Do you have an access to my project settings?</p></div>olegbevztag:help.appveyor.com,2012-11-13:Comment/441454872017-12-01T02:35:51Z2017-12-01T02:35:51ZArtifacts are not published after uploading ftp file<div><p>AppVeyor does not respect YAML because your project is created as a generic Git, not BitBucket. It is explained <a href="https://www.appveyor.com/docs/build-configuration/#classic-git-repositories-and-yaml">here</a>. I would recommend to re-create project as a BitBucket one.</p>
<p>Do you really need to upload those files as artifacts as long as you already uploaded them to FTP? I mean we can root cause how that snap-in breaks SSL, but I am not sure you really need those artifacts.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/441454872017-12-01T06:17:07Z2017-12-01T06:17:07ZArtifacts are not published after uploading ftp file<div><p>Ilya, thank you for the advice about Bitbucket repo. I will try it.<br>
I want to publish appveyor artifacts with binary files after uploading file to ftp. Its not the same artifacts. If the issue with SSL could not be solved easily I could try to create a separate appveyor project for ftp upload...</p></div>olegbevztag:help.appveyor.com,2012-11-13:Comment/441454872017-12-01T06:50:43Z2017-12-01T06:50:43ZArtifacts are not published after uploading ftp file<div><p>We will solve it one way or another, no worries :) What if you upload to FTP as a deployment script? This happens after artifacts upload step.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/441454872017-12-01T09:53:08Z2017-12-01T09:53:08ZArtifacts are not published after uploading ftp file<div><p>Ilya, I've made a workaround: I've moved ftp upload scripts to "On build success script" section. Now ftp upload executes after artifacts are published. But still it's only workaround: if you try to use PSFTP module it will break SSL settings in appveyor process and artifacts will not be published. Perhaps it would be better to execute powershell scripts in a separate app domain...<br>
Personally for me this solution is enough=)</p></div>olegbevztag:help.appveyor.com,2012-11-13:Comment/441454872017-12-05T01:04:21Z2017-12-05T01:04:21ZArtifacts are not published after uploading ftp file<div><p>I agree. Can you try to wrap those commands as <code>.ps1</code> script and call from <code>cmd</code>. Say <code>- cmd: powershell.exe .\my-ftp-deploy.ps1</code>. Let us know if it does not break artifact upload this way.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/441454872017-12-29T19:07:04Z2019-02-05T12:24:11ZArtifacts are not published after uploading ftp file<div><p>Hi</p>
<p>Just to say I seem to be having the same problem, artefacts are being found but can't be uploaded, see <a href="https://ci.appveyor.com/project/MikeCorsaro/sourcetreewin-85q5a/build/1.0.93">https://ci.appveyor.com/project/MikeCorsaro/sourcetreewin-85q5a/bui...</a></p>
<p>I use an after_test section to run some scripts that create an installer of our project. The artefacts are based on the outcome of those scripts. As far as I can see those scripts complete successfully, the artefacts are found but the upload fails.</p></div>mminnstag:help.appveyor.com,2012-11-13:Comment/441454872017-12-30T01:41:17Z2017-12-30T01:41:17ZArtifacts are not published after uploading ftp file<div><p>Mike,</p>
<p>I checked your build and I do not see that you use <strong>PSFTP</strong> which broke SSL settings in original post. Let us try to identify what happens in your case.</p>
<p>Can you please insert <code>[Net.ServicePointManager]::SecurityProtocol</code> before and after your custom scripts (and any other steps you suspect can be the root cause) and see if some script/step changed that settings.</p>
<p>If you found offending script, first try to add <code>[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Ssl3 -bor [System.Net.SecurityProtocolType]::Tls -bor [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls12</code> after it.</p>
<p>If this does not help, please share your build configuration in YAML format and offending script content (if you found it). Feel free to delete/replace all secrets from YAML and script.</p>
<p>Ilya.</p></div>Ilya Finkelshteyn