Hi,
I had the following SQL truncation error reported to me by one of our devs when trying to create a release using the TeamCity Octo plugin:
Running command: octo.exe create-release --server https://myserver --apikey SECRET --project MyProject --enableservicemessages --version 1.0.0-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah --channel MyChannel --deploymenttimeout 01:00:00 --cancelontimeout --defaultpackageversion 1.0.0
Creating Octopus Deploy release
Octopus Deploy Command Line Tool, version 4.21.0
Build environment is Handshaking with Octopus server: https://myserver
Handshake successful. Octopus version: 2018.3.11; API version: 3.0.0
Authenticated as: MyAccount <null>
This Octopus Server supports channels
Finding project: MyProject
Building release plan for channel 'MyChannel'...
Finding deployment process...
Finding release template...
Using version number provided on command-line: 1.0.0-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah
Release plan for MyProject 1.0.0-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah-blah
Channel: 'MyChannel'
# Name Version Source Version rules
--- ----------------------------------------------------- ---------------------------- ---------------- -----------------------
1 MyPackage 1.0.0 User specified Range: PASS Tag: PASS
2 MyOtherPackage 2.0.0 User specified Range: PASS Tag: PASS
Creating release...
Octopus Server returned an error: Error while executing SQL command in transaction 'https://myserver/api/releases?ignoreChannelRules=False xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': String or binary data would be truncated.
The statement has been terminated.
The command being executed was:
INSERT INTO dbo.[Release] (Version, Assembled, ProjectId, ChannelId, ProjectVariableSetSnapshotId, ProjectDeploymentProcessSnapshotId, Id, JSON) values (@Version, @Assembled, @ProjectId, @ChannelId, @ProjectVariableSetSnapshotId, @ProjectDeploymentProcessSnapshotId, @Id, @JSON)
SQL Error 8152 - String or binary data would be truncated.
The statement has been terminated.
Error from Octopus server (HTTP 500 InternalServerError)
Exit code: -7
Octo.exe exit code: -7
Unable to create or deploy release. Please check the build log for details on the error.
Unable to create or deploy release. Please check the build log for details on the error.
Step Create release in Octopus Deploy (OctopusDeploy: Create release) failed
At first glance, I think it’s due to the very (very) long branch name which they’ve included in the version number (i.e. “blah-blah-blah-etc”).
They were able to resolve the issue by shortening the version number. but it would be good if it was validated server-side and the error message specifically say it’s too long, rather than return a raw SQL truncation error.
Cheers,
Mike