ptarmiganlabs / ctrl-q

Command line tool for interacting with Qlik Sense Enterprise servers
MIT License
13 stars 2 forks source link

Importing master items to QSEoW fails #542

Closed mountaindude closed 6 hours ago

mountaindude commented 3 days ago

What version of Ctrl-Q are you using?

4.0.0

What version of Node.js are you using? Not applicable if you use the standalone version of Ctrl-Q.

No response

What command did you use to start Ctrl-Q?

-

What operating system are you using?

-

What CPU architecture are you using?

-

What Qlik Sense versions are you using?

-

Describe the Bug

Bug in Ctrl-Q or invalid definitions file? Either the bug should be fixed or a better error message implemented.

PS C:\tools\ctrl-q> .\ctrl-q.exe qseow master-item-import `
>>   --host pro2-win1.lab.ptarmiganlabs.net `
>>   --auth-user-dir LAB `
>>   --auth-user-id goran `
>>   --auth-type cert `
>>   --app-id a3e0f5d2-000a-464f-998d-33d333b175d7 `
>>   --file-type excel `
>>   --file ./ctrl-q-master-items.xlsx `
>>   --sheet Sales `
>>   --col-ref-by name `
>>   --col-item-type "Master item type" `
>>   --col-master-item-name "Master Item Name" `
>>   --col-master-item-descr Description `
>>   --col-master-item-label Label `
>>   --col-master-item-expr Expression `
>>   --col-master-item-tag Tag `
>>   --col-master-item-color Color `
>>   --col-master-item-per-value-color 'Per value color'
2024-11-15T16:55:07.245Z info: -----------------------------------------------------------
2024-11-15T16:55:07.248Z info: | Ctrl-Q
2024-11-15T16:55:07.249Z info: |
2024-11-15T16:55:07.249Z info: | Version      : 4.0.0
2024-11-15T16:55:07.249Z info: | Log level    : info
2024-11-15T16:55:07.249Z info: |
2024-11-15T16:55:07.250Z info: | Command      : master-item-import
2024-11-15T16:55:07.250Z info: |              : create master items based on definitions in a file on disk
2024-11-15T16:55:07.250Z info: |
2024-11-15T16:55:07.250Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2024-11-15T16:55:07.251Z info: |
2024-11-15T16:55:07.251Z info: | https://github.com/ptarmiganlabs/ctrl-q
2024-11-15T16:55:07.251Z info: ----------------------------------------------------------
2024-11-15T16:55:07.251Z info:
2024-11-15T16:55:07.253Z info: Import master items from definitions in Excel file "./ctrl-q-master-items.xlsx"
2024-11-15T16:55:08.025Z info: (1/12) Updated existing measure "No. of sold units"
2024-11-15T16:55:09.036Z info: (2/12) Updated existing measure "No. of sold units (LY)"
2024-11-15T16:55:10.061Z info: (3/12) Created new measure "Revenue EUR"
2024-11-15T16:55:11.074Z info: (4/12) Updated existing measure "Revenue EUR (LY)"
2024-11-15T16:55:12.092Z info: (5/12) Updated existing measure "Profit EUR"
2024-11-15T16:55:13.104Z warn: (6/12) Found an unknown master item type: "measur". Ignoring this line in the imported file.
2024-11-15T16:55:14.113Z info: (7/12) Created new measure "Profit EUR (LY)"
2024-11-15T16:55:15.175Z info: (8/12) Updated existing dimension "Country"
2024-11-15T16:55:16.196Z error: No per-value color map exists for existing dimension "Sales month": Error: Object not found
    at createEnigmaError (build.cjs:30511:16)
    at Intercept2.apiResponseInterceptor (build.cjs:31988:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Promise.all (index 0)
    at async updateDimension (build.cjs:91765:31)
    at async createMasterItems (build.cjs:92084:13)
    at async importMasterItemFromExcel (build.cjs:92279:19)
    at async importMasterItemFromFile (build.cjs:92309:5)
2024-11-15T16:55:16.197Z info: (9/12) Updated existing dimension "Sales month"
2024-11-15T16:55:17.240Z info: (10/12) Updated existing dimension "Salesperson"
2024-11-15T16:55:18.260Z error: No per-value color map exists for existing dimension "Color": Error: Object not found
    at createEnigmaError (build.cjs:30511:16)
    at Intercept2.apiResponseInterceptor (build.cjs:31988:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Promise.all (index 0)
    at async updateDimension (build.cjs:91765:31)
    at async createMasterItems (build.cjs:92084:13)
    at async importMasterItemFromExcel (build.cjs:92279:19)
    at async importMasterItemFromFile (build.cjs:92309:5)
2024-11-15T16:55:18.262Z info: (11/12) Updated existing dimension "Color"
2024-11-15T16:55:19.288Z info: (12/12) Updated existing drill-down dimension "DimDrill"
2024-11-15T16:55:20.298Z info: Imported 12 master items from Excel file ./ctrl-q-master-items.xlsx

Expected Behavior

No response

To Reproduce

No response

mountaindude commented 1 day ago

Turned out not to be a bug, but rather bad logging.

When the imported master dimensions already exists in the target app the error above would show. Just change the log level of the message to verbose and all is good.