I have an SSH deployment target, pointing to an SLE12 Linux machine. I installed mono-complete with version 4.0.2. I created an nuget package using octo.exe on Windows.
Task ID: ServerTasks-254
Task status: Failed
Task queued: Mittwoch, 29. Juli 2015 18:55
Task started: Mittwoch, 29. Juli 2015 18:55
Task duration: 6 seconds
| == Running: Deploy Padsy API release 0.1.0.58 to EXS1 ==
18:55:40 Verbose | Guided failure is not enabled for this task
18:55:46 Error | The deployment failed because one or more steps failed. Please see the deployment log for details.
| == Failed: Acquire packages ==
18:55:40 Info | Downloading packages
18:55:40 Info | Making a list of packages to download
18:55:40 Verbose | Checking package cache for package padsy_api 0.1.0.58
18:55:41 Verbose | Package padsy_api version 0.1.0.58 was found in cache. No need to download. Using file: C:\ProgramData\Octopus\OctopusServer\PackageCache\feeds-teamcity\padsy_api.0.1.0.58_585A10837E0D624D9E2BAFDE71E385EB.nupkg
18:55:41 Verbose | SHA1 hash of package padsy_api is: 1a685e42468cb8334f06b66aa9a9d7a2752d4562
18:55:46 Fatal | The step failed: One or more child activities failed.
18:55:46 Verbose | Acquire Packages completed
| Running: exs1-api001
18:55:46 Verbose | Disposing SFTP connection...
18:55:46 Verbose | Disposing SSH connection...
18:55:46 Error | The remote script failed with exit code 100
| Running: Upload package padsy_api 0.1.0.58
18:55:41 Verbose | Requesting upload...
18:55:41 Verbose | Establishing SSH connection...
18:55:41 Verbose | SSH connection established
18:55:42 Info | Beginning streaming transfer of calamari-find-package.sh to .octopus\OctopusServer\Work\20150729165540-10
18:55:42 Verbose | Establishing SFTP connection...
18:55:42 Verbose | SSFTP connection established
18:55:43 Info | Stream transfer complete
18:55:46 Error | System.NullReferenceException: Object reference not set to an instance of an object
18:55:46 Error | at System.IO.Packaging.Package.LoadRelationships () [0x00000] in <filename unknown>:0
18:55:46 Error | at System.IO.Packaging.Package.get_Relationships () [0x00000] in <filename unknown>:0
18:55:46 Error | at System.IO.Packaging.Package.GetRelationshipsByType (System.String relationshipType) [0x00000] in <filename unknown>:0
18:55:46 Error | at NuGet.ZipPackage.EnsureManifest () [0x00000] in <filename unknown>:0
18:55:46 Error | at NuGet.ZipPackage..ctor (System.String filePath, Boolean enableCaching) [0x00000] in <filename unknown>:0
18:55:46 Error | at NuGet.ZipPackage..ctor (System.String filePath) [0x00000] in <filename unknown>:0
18:55:46 Error | at Calamari.Integration.FileSystem.PackageStore.ReadPackageFile (System.String filePath) [0x00000] in <filename unknown>:0
18:55:46 Error | at Calamari.Integration.FileSystem.PackageStore.GetPackage (System.String prefix, Calamari.Integration.Packages.PackageMetadata metadata) [0x00000] in <filename unknown>:0
18:55:46 Error | at Calamari.Integration.FileSystem.PackageStore.GetPackage (Calamari.Integration.Packages.PackageMetadata metadata) [0x00000] in <filename unknown>:0
18:55:46 Error | at Calamari.Commands.FindPackageCommand.Execute (System.String commandLineArguments) [0x00000] in <filename unknown>:0
18:55:46 Error | at Calamari.Program.Main (System.String args) [0x00000] in <filename unknown>:0
| Cancelled: Step 1: Deploy NodeJs
18:55:46 Verbose | Step "Deploy NodeJs" runs only when all previous steps succeeded; skipping
Thanks for getting in touch. I’m sorry you’ve had problems getting this working. SLE12 isn’t one of our officially support linux distros however we’d like to try to help you get up and running. The issue is a bit challenging so we’ll need to try to isolate it.
I’d like to ask if you could try creating a very simple NuGet package manually to eliminate any issues with octo.exe and the package contents. Try packaging a simple text file with the NuGet Package Explorer (see http://docs.octopusdeploy.com/display/OD/Manually for more info) and see if it works. If it does, then it points to a problem in the packaging or package contents. If it still fails, it’s possible there’s an issue w/ Calamari (the component that executes the deployment on the linux box)) or something environment specific w/ the linux distro.
I’d like to work with you to try to get this working. Looking forward to your reply.
using the manually created package (see above) worked just fine:
Task ID: ServerTasks-308
Task status: Success
Task queued: Freitag, 31. Juli 2015 12:33
Task started: Freitag, 31. Juli 2015 12:33
Task duration: 1 minute
| == Success: Deploy Padsy API release 0.1.0.9999 to EXS1 ==
12:33:59 Verbose | Guided failure is not enabled for this task
12:35:19 Info | The deployment completed successfully.
| == Success: Acquire packages ==
12:33:59 Info | Downloading packages
12:33:59 Info | Making a list of packages to download
12:33:59 Info | Looking up the package location from the built-in package repository...
12:33:59 Verbose | SHA1 hash of package padsy_api is: 4defd36c6566dee9b89838d522d435fc9a16ff56
12:35:12 Info | All packages have been downloaded
12:35:12 Verbose | Acquire Packages completed
| Success: exs1-api001
12:35:11 Verbose | Disposing SFTP connection...
12:35:12 Verbose | Disposing SSH connection...
| Success: Upload package padsy_api 0.1.0.9999
12:33:59 Verbose | Requesting upload...
12:33:59 Verbose | Establishing SSH connection...
12:34:00 Verbose | SSH connection established
12:34:00 Info | Beginning streaming transfer of calamari-find-package.sh to .octopus\OctopusServer\Work\20150731103359-55
12:34:00 Verbose | Establishing SFTP connection...
12:34:01 Verbose | SSFTP connection established
12:34:01 Info | Stream transfer complete
12:34:02 Info | This server does not have version 126.96.36.1996 of the Calamari package. It will be pushed automatically.
12:34:30 Verbose | Requesting upload...
12:34:30 Info | Beginning streaming transfer of extract-calamari-package.sh to .octopus\OctopusServer\Work\20150731103359-55
12:34:31 Info | Stream transfer complete
12:34:31 Verbose | Requesting upload...
12:34:31 Info | Beginning streaming transfer of calamari.188.8.131.526.tar.gz to .octopus\OctopusServer\Work\20150731103359-55
12:35:05 Info | Stream transfer complete
12:35:09 Verbose | Requesting upload...
12:35:09 Info | Beginning streaming transfer of calamari-find-package.sh to .octopus\OctopusServer\Work\20150731103359-55
12:35:09 Info | Stream transfer complete
12:35:10 Verbose | Package padsy_api version 0.1.0.9999 hash 4defd36c6566dee9b89838d522d435fc9a16ff56 has not been uploaded.
12:35:10 Verbose | Finding earlier packages that have been uploaded to this Tentacle.
12:35:10 Verbose | No earlier packages for padsy_api has been uploaded
12:35:10 Info | Uploading package padsy_api 0.1.0.9999
12:35:10 Verbose | Requesting upload...
12:35:11 Info | Beginning streaming transfer of padsy_api.0.1.0.9999.nupkg-ec74d7d5-186d-4856-993e-761924f3ed48 to .octopus\OctopusServer\Files
12:35:11 Info | Stream transfer complete
| == Success: Step 1: Deploy NodeJs ==
12:35:19 Verbose | Deploy NodeJs completed
| Success: exs1-api001
12:35:12 Info | Deploying package '.octopus/OctopusServer/Files/padsy_api.0.1.0.9999.nupkg-ec74d7d5-186d-4856-993e-761924f3ed48' to machine 'ssh://exs1-api.cloudapp.net/'
12:35:12 Verbose | Requesting upload...
12:35:12 Verbose | Establishing SSH connection...
12:35:13 Verbose | SSH connection established
12:35:13 Info | Beginning streaming transfer of calamari-deploy-package.sh to .octopus\OctopusServer\Work\20150731103512-56
12:35:13 Verbose | Establishing SFTP connection...
12:35:13 Verbose | SSFTP connection established
12:35:14 Info | Stream transfer complete
12:35:14 Verbose | Requesting upload...
12:35:14 Info | Beginning streaming transfer of variables.json to .octopus\OctopusServer\Work\20150731103512-56
12:35:15 Info | Stream transfer complete
12:35:16 Info | Deploying package: /home/exs1-admin/.octopus/OctopusServer/Files/padsy_api.0.1.0.9999.nupkg-ec74d7d5-186d-4856-993e-761924f3ed48
12:35:16 Info | Using variables from: /home/exs1-admin/.octopus/OctopusServer/Work/20150731103512-56/variables.json
12:35:17 Verbose | Extracting package to: /home/exs1-admin/.octopus/Applications/OctopusServer/EXS1/padsy_api/0.1.0.9999
12:35:17 Verbose | Extracted 2 files
12:35:17 Info | Purging the directory '/srv/nodejs'
12:35:18 Info | Copying package contents to '/srv/nodejs'
12:35:18 Verbose | Adding journal entry:
12:35:18 Verbose | <Deployment Id="6fa74aa5-088b-49f5-9538-62f4386543b5" EnvironmentId="Environments-1" ProjectId="Projects-1" PackageId="padsy_api" PackageVersion="0.1.0.9999" InstalledOn="2015-07-31 10:35:20" ExtractedFrom="/home/exs1-admin/.octopus/OctopusServer/Files/padsy_api.0.1.0.9999.nupkg-ec74d7d5-186d-4856-993e-761924f3ed48" ExtractedTo="/home/exs1-admin/.octopus/Applications/OctopusServer/EXS1/padsy_api/0.1.0.9999" RetentionPolicySet="Environments-1/Projects-1/Step-Deploy NodeJs/Machines-1/<default>" CustomInstallationDirectory="/srv/nodejs" WasSuccessful="True" />
12:35:18 Verbose | Disposing SFTP connection...
12:35:18 Verbose | Disposing SSH connection...
| == Success: Apply retention policy on Tentacles ==
12:35:19 Info | Apply retention policies...
12:35:19 Verbose | Tentacle retention policy set to 'keep all'
12:35:19 Verbose | Apply Tentacle Retention Policy completed
So it seems to be an issue with octo.exe pack, I guess? Do you have an alternative? We need to create a nuget package from the commandline.
BTW: Is there any chance for octo.exe pack to get an -Exclude parameter?
padsy_api.0.1.0.9999.nupkg (2 KB)
Thanks for the reply. This is great! The simple nuget package shows that the deployment process is working end to end. The next step is to determine why it failed for your package. I’m skeptical that Octo.exe isn’t building the package correct but it’s probably a good idea to eliminate it.
I’d like to ask you try a few things:
- Using NuGet Package Explorer, open your package and select Tools -> Analyze Package. Does it report any issues?
- Create a .nuspec file and then use NuGet.exe to pack it. Creating a nuspec file manually allows you to specify files using wildcards as well as exclude them. Then run “NuGet.exe pack MyPackage.nuspec” and it creates your package.
The following links provides a bit more detail on this process. The blog post is a pretty good overview of the process.
Regarding updating Octo.exe to support excluding files, it’s intended to be a handy utility to pack everything in a directory. If you need to do something a bit more complicated, it’s better to create a nuspec file and pack it w/ NuGet.exe.
- Deploy the package to a Windows-based Tentacle. I’d be interested to see if it fails w/ a similar error on a Windows-based target.
I’m pretty confident that we’ll get this working pretty quickly. Let me know how you go!
I wanted to highlight one other thing. We’ve had reports of weird issues with NuGet on mono, particularly around packages with a large number of directories and files. One workaround is to tar the application files and put the tar into a nuget package, and have a deploy.sh script which unpacks the tar ball. This should work really quickly and without any issues on any Linux distro.
Let me know how you go!
We’re having a similar issue deploying a very large nuget file with a lot of directories and files to a linux machine. Deploying the same to Windows works. Any workarounds except tar?
well, are there any plans to fix this? Using tar to package the files is surely not an acceptable workaround…
While its not an ideal situation, we have had a few teams using the tar solution successfully as an interim work around. Although we have the packaging on Linux story on on our radar, we have yet to fully consider and implement a robust solution. As we haven’t yet really focused on perfecting the Octo.exe side of things for *Nix unfortunately there will have to be some work around. This is definitely something we hope to change in the future.
I’m sure this isn’t the answer you were hoping to hear, but keep your ears to the ground and hopefully we will have another solution shortly.