lwhitelock/ITGlue-Hudu-Migration

Fleixble Assets are blank

thelawrencearm opened this issue · 5 comments

The asset is created but the contents are empty. Below is a side by side screenshot. Our ITG instance is rather large and probably super messy, but I figured basic stuff like this would come over. I'm just grateful this script exists, so thank you.

image

Have a check in your MigrationLogs folder as that should show you what was matching to what and where things went wrong

Have a check in your MigrationLogs folder as that should show you what was matching to what and where things went wrong

Thanks for the reply.

Not sure how to troubleshoot the logs but based on this entry in the Assets.json it looks like it should have worked? There aren't any specific error logs that I can find.

{ "Name": "Other ZAR Recovery", "ITGID": "1546004", "HuduID": 2737, "Matched": false, "HuduObject": { "id": 2737, "company_id": 6, "asset_layout_id": 21, "slug": "other-zar-recovery-653033b022ce", "name": "Other ZAR Recovery", "primary_serial": null, "primary_mail": null, "primary_model": null, "primary_manufacturer": null, "company_name": "Five Nines", "object_type": "Asset", "asset_type": "Licensing", "archived": false, "url": "http://REDACTED.huducloud.com/a/other-zar-recovery-653033b022ce", "created_at": "2021-07-29T21:38:35.243Z", "updated_at": "2021-07-29T21:38:35.243Z", "fields": [ { "id": 437, "value": "Other", "label": "Manufacturer", "position": 1 }, { "id": 436, "value": "ZAR Recovery", "label": "Name", "position": 2 }, { "id": 432, "value": 1, "label": "Seats", "position": 4 }, { "id": 434, "value": "<p>REDACTED</p>", "label": "License Key(s)", "position": 5 }, { "id": 431, "value": "2017-04-27T00:00:00Z", "label": "Purchase Date", "position": 6 }, { "id": 433, "value": 70, "label": "Renewal Cost", "position": 8 }, { "id": 435, "value": "<p>Installed on as of 4-27-2017</p>\n\n<p> </p>\n\n<p> </p>\n\n<p><a href=\"http://www.z-a-recovery.com/support.aspx\">http://www.z-a-recovery.com/support.aspx</a></p>", "label": "Additional Notes", "position": 9 }, { "id": 189, "value": "2021-07-29T23:35:19.883Z", "label": "Imported from ITGlue", "position": 500 } ], "cards": [] }, "ITGObject": { "id": "1546004", "type": "flexible-assets", "attributes": { "organization-id": 1461812, "organization-name": "Redacted", "resource-url": "https://redacted.itglue.com/1461812/assets/41390-licensing/records/1546004", "restricted": false, "my-glue": false, "psa-integration": null, "flexible-asset-type-id": 41390, "flexible-asset-type-name": "Licensing", "name": "Other ZAR Recovery", "traits": { "manufacturer": "Other", "name": "ZAR Recovery", "seats": "1.0", "license-key-s": "<p>REDACTED</p>", "purchase-date": "2017-04-27", "renewal-cost": "70.0", "additional-notes": "<p>Installed on as of 4-27-2017</p>\n\n<p> </p>\n\n<p> </p>\n\n<p><a href=\"http://www.z-a-recovery.com/support.aspx\">http://www.z-a-recovery.com/support.aspx</a></p>" }, "archived": false, "created-at": "2017-04-27T18:02:03Z", "updated-at": "2017-04-27T18:47:21Z" }, "relationships": {} }, "Imported": "Created-By-Script" },

I am having a similar issue where most of the Flexible Asset Fields are blank after the migration is run. The issue appears to be the fields are not being created in Hudu, so the data cannot be imported. I can see in the console it is getting an "Internal Server Error", but it is not happening on every flexible asset, just the majority of them. An example on a flexible asset I see in the console while running the script:

Starting BitLocker
Fetching Flexible Asset Fields from IT Glue
Retrieved 4
Fetching Flexible Assets from IT Glue (This may take a while)
Retrieved 1
Invoke-HuduRequest: C:\Users\xxxxx\Documents\PowerShell\Modules\HuduAPI\1.22\Public\Set-HuduAssetLayout.ps1:70
Line |
  70 |  … $Response = Invoke-HuduRequest -Method put -Resource "/api/v1/asset_l …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | '{"status":500,"error":"Internal Server Error"}'

Finished ITGlue-BitLocker

Any help is appreciated and the script is is already saving me a ton of migration time. Thank you!

Are you self hosted or on the cloud? That error is saying the server didn't like something, so it could be some strange characters or something odd. The best thing to do if you are self hosted is connect to the hudu app docker container using "docker attach"
and have a look at what errors are happening server side when the 500 errors happen.

So this issue could happen if an Asset Layout with the same name already existed in Hudu without having the fields with matching names.