Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mario Lopez 168 posts 958 karma points MVP 4x c-trib
    Jan 22, 2019 @ 22:47
    Mario Lopez
    1

    Terratype - String or binary data would be truncated

    Hi all,

    I have upgraded a site from 7.7.7 to 7.13.1. I'm trying to create a new datatype from Terratype but when I save it I get 'String or binary data would be truncated.'

    The funny thing is that I already did this same upgrade with the same database and everything worked fine.

    Anyways, I'm trying to debug Umbraco and it's failing in DataTypeService.cs:538. The data trying to be saved is this:

    {
      "config": {
        "height": 400,
        "gridHeight": 400,
        "debug": 0,
        "icon": {
          "id": "redmarker",
          "url": "https://mt.google.com/vt/icon/name=icons/spotlight/spotlight-poi.png",
          "size": {
            "width": 22,
            "height": 40
          },
          "anchor": {
            "horizontal": "center",
            "vertical": "bottom"
          }
        },
        "label": {
          "enable": false,
          "editPosition": "0",
          "id": "standard"
        },
        "provider": {
          "id": "Terratype.GoogleMapsV3",
          "version": 3,
          "forceHttps": true,
          "language": "",
          "predefineStyling": "retro",
          "showRoads": true,
          "showLandmarks": true,
          "showLabels": true,
          "variety": {
            "basic": true,
            "satellite": false,
            "terrain": false,
            "selector": {
              "type": 1,
              "position": 0
            }
          },
          "streetView": {
            "enable": false,
            "position": 0
          },
          "fullscreen": {
            "enable": false,
            "position": 0
          },
          "scale": {
            "enable": false,
            "position": 0
          },
          "zoomControl": {
            "enable": true,
            "position": 0
          },
          "panControl": {
            "enable": false
          },
          "draggable": true,
          "grid": {
            "enable": false
          },
          "styles": [
            {
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#ebe3cd"
                }
              ]
            },
            {
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#523735"
                }
              ]
            },
            {
              "elementType": "labels.text.stroke",
              "stylers": [
                {
                  "color": "#f5f1e6"
                }
              ]
            },
            {
              "featureType": "administrative",
              "elementType": "geometry.stroke",
              "stylers": [
                {
                  "color": "#c9b2a6"
                }
              ]
            },
            {
              "featureType": "administrative.land_parcel",
              "elementType": "geometry.stroke",
              "stylers": [
                {
                  "color": "#dcd2be"
                }
              ]
            },
            {
              "featureType": "administrative.land_parcel",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#ae9e90"
                }
              ]
            },
            {
              "featureType": "landscape.natural",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#dfd2ae"
                }
              ]
            },
            {
              "featureType": "poi",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#dfd2ae"
                }
              ]
            },
            {
              "featureType": "poi",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#93817c"
                }
              ]
            },
            {
              "featureType": "poi.park",
              "elementType": "geometry.fill",
              "stylers": [
                {
                  "color": "#a5b076"
                }
              ]
            },
            {
              "featureType": "poi.park",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#447530"
                }
              ]
            },
            {
              "featureType": "road",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#f5f1e6"
                }
              ]
            },
            {
              "featureType": "road.arterial",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#fdfcf8"
                }
              ]
            },
            {
              "featureType": "road.highway",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#f8c967"
                }
              ]
            },
            {
              "featureType": "road.highway",
              "elementType": "geometry.stroke",
              "stylers": [
                {
                  "color": "#e9bc62"
                }
              ]
            },
            {
              "featureType": "road.highway.controlled_access",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#e98d58"
                }
              ]
            },
            {
              "featureType": "road.highway.controlled_access",
              "elementType": "geometry.stroke",
              "stylers": [
                {
                  "color": "#db8555"
                }
              ]
            },
            {
              "featureType": "road.local",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#806b63"
                }
              ]
            },
            {
              "featureType": "transit.line",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#dfd2ae"
                }
              ]
            },
            {
              "featureType": "transit.line",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#8f7d77"
                }
              ]
            },
            {
              "featureType": "transit.line",
              "elementType": "labels.text.stroke",
              "stylers": [
                {
                  "color": "#ebe3cd"
                }
              ]
            },
            {
              "featureType": "transit.station",
              "elementType": "geometry",
              "stylers": [
                {
                  "color": "#dfd2ae"
                }
              ]
            },
            {
              "featureType": "water",
              "elementType": "geometry.fill",
              "stylers": [
                {
                  "color": "#b9d3c2"
                }
              ]
            },
            {
              "featureType": "water",
              "elementType": "labels.text.fill",
              "stylers": [
                {
                  "color": "#92998d"
                }
              ]
            }
          ]
        },
        "search": {
          "enable": 0,
          "limit": {
            "countries": []
          }
        }
      },
      "position": {
        "id": "WGS84",
        "precision": 6,
        "datum": "55.406321,10.387015"
      },
      "zoom": 12
    }
    

    Is that too long to be saved? Maybe the upgrade of the DB wasn't done properly? Can I re-run it somehow?

    UPDATE: I have compared both databases schemas (the one that works and the one that doesn't) and they are exactly the same.

  • Jonathan Richards 288 posts 1742 karma points MVP
    Jan 22, 2019 @ 23:15
    Jonathan Richards
    0

    Mario,

    I have had this issue with other datatypes like large NestedContent but so far your the first to mentioned it with Terratype. I mean its possible if you have a small dataNvarchar column in dbo.cmsPropertyData, but you say your databases are identical

    I will have a think, but for now, I feel this is more an issue with your Umbraco and not something specific to Terratype - yes it complaining the json is too large, but to be honest it looks pretty normal size to me.

    Thank you for raising this, I will run some test with Version 7.13.1 specifically as I haven't tested the latest release yet.

    I'm sure you know, but for anyone else stumbling on this thread, you can fix the json being truncated issue by running

     ALTER TABLE dbo.cmsPropertyData
     ALTER COLUMN dataNvarchar nvarchar(max)
    

    (Copied from https://our.umbraco.com/forum/core/general/40332-Unable-to-publish-String-or-binary-data-would-be-truncated#comment-284473)

    I will update, if I do find anything with Umbraco Version 7.13.1

    Cheers

    Jonathan

  • Mario Lopez 168 posts 958 karma points MVP 4x c-trib
    Jan 23, 2019 @ 00:10
    Mario Lopez
    0

    Hi Jonathan,

    I didn't know about the dataNvarchar fix, thanks for that. That hasn't fixed the issue though, still getting the same error. I think I'll try starting over :(

  • Mario Lopez 168 posts 958 karma points MVP 4x c-trib
    Jan 23, 2019 @ 02:29
    Mario Lopez
    0

    No luck. I made a copy of the old DB, upgraded it to 7.13.1 and when tried to create a Terratype datatype it fails.

  • Mario Lopez 168 posts 958 karma points MVP 4x c-trib
    Jan 23, 2019 @ 05:27
    Mario Lopez
    0

    Jonathan, I found the issue. When you select a map style that is not the 'Standard', the package adds a bunch of styles in a 'styles' property in the json saved into the database. Those styles is what is causing the problem.

    The limit is in the cmsDataTypePrevalues, being value of type nvarchar(2500)

Please Sign in or register to post replies

Write your reply to:

Draft