SQL error when creating release with very long version number

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

Hello,

This has been tagged “integration”, but I think it’s probably a core API issue - the error appears to be coming from the Octopus server rather than generated inside octo.exe.

In my case it’s surfaced by the Octo plugin for TeamCity , but I think it’s being caused server-side behind the API. I haven’t tried specifically, but I imagine if you hit the API with the same request via powershell or fiddler you’d get the same error.

Don’t know if that makes a difference how you want to tag it or not.

Cheers,

M

Hi Mike,

Really sorry for the delay here. Definitely a bug. I logged it in github so you can track its progress: https://github.com/OctopusDeploy/Issues/issues/4625

Thanks for reporting this!

Best regards,
Dalmiro

Thanks Dalmiro.

I found another (different) area that causes issues with long names - I’ll post a separate ticket and link to it here once I’ve created it.

Cheers,

M

See also Deploying Cloud Service fails with very long branch name

Thanks Mike. I’ve assigned that new ticket to the correct team. You should hear from them soon.

Best regards,
Dalmiro

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.