cumulocity-migration-tool icon indicating copy to clipboard operation
cumulocity-migration-tool copied to clipboard

Improve logging

Open dave62 opened this issue 5 years ago • 4 comments

As first "guinean pig" tester of this great solution to accelerate C8y assets/objects management across tenants, I encountered few hiccups during my first objects migration from an existing pilot tenant to my own PoC/internal tenant. Unfortunately the error message was very evasive as shown in the attached screenshot and no logging available to further debug the issue and trace down problematic object/migration step, forcing me to do a painful "try and error" migration approach almost object by object: migration_tool_issue

For more complex migrations involving multiple objects and dependencies it would greatly help to have some logging functionality wrapped around the web app itself, or maybe as part of a contained microservice app to subscribe in the tenant with status and log options (vs just a web app and like what we have for fieldbus etc for instance).

dave62 avatar Aug 06 '19 13:08 dave62

Hi Dave,

I agree that the error logging probably need improving

You'll probably find that the error in the browser console (F12 on windows) is more informative - or at least may be useful for me. If you have a moment to recreate the issue then a copy of the browser console log would be really useful.

Any idea what it didn't like migrating?

Thanks for being the guinea pig and taking time to file an issue

rpeach-sag avatar Aug 06 '19 15:08 rpeach-sag

Following up from an email with the logs...

TypeError: n.body is undefined\n[188]/p</e.prototype.getBinaryBlob

The migration tool can't get the binary for the application because the cockpit application (being built in) does not store its binary on cumulocity.

This shouldn't be a problem because the cockpit application is installed on all tenants and doesn't need to be migrated.

The logging however is a valid concern

rpeach-sag avatar Aug 07 '19 09:08 rpeach-sag

Debugged the actual code - turns out in this case it was a custom cockpit and the binary was available this was a bug and is captured in a separate issue: #2

rpeach-sag avatar Aug 07 '19 10:08 rpeach-sag

Changes to be made to logging:

  • [x] Change the Error: [Object object] popup to better display errors
  • [x] Log which object caused the migration to fail
  • [ ] Store the full migration log in the user's browser for them to see/debug
  • [ ] Maybe: Store the logs on the server?

rpeach-sag avatar Aug 07 '19 10:08 rpeach-sag