"List index out of range" error when UXToolkit loads instances.json file

Hello,

We’re experiencing an issue where any time the UXToolkit attempts to load the instances.json file, we get a “List index out of range” exception which we’re unable to debug.

Error: (}apq.ux.toolkit.run.transfer.log)

Traceback (most recent call last):
  File "D:\codebase\compile_toolkit\src\UXInstallToolkit.py", line 3715, in <module>
  File "D:\codebase\compile_toolkit\src\UXInstallToolkit.py", line 3697, in run
  File "D:\codebase\compile_toolkit\src\UXInstallToolkit.py", line 3271, in transfer_initialize
  File "D:\codebase\compile_toolkit\src\UXInstallToolkit.py", line 3261, in initialize
  File "D:\codebase\compile_toolkit\src\UXInstallToolkit.py", line 480, in load_instances
IndexError: list index out of range
[3656] Failed to execute script 'UXInstallToolkit' due to unhandled exception!
UX Toolkit
(c) 2021 Apliqo AG
Version: 1.1.7.3 Production
Loading and parsing application settings [settings.json].
Using path to instances.json supplied from settings.json [D:\Program Files\ApliqoServer\webapps\alloc_sbx\WEB-INF\instances.json].
Application settings loaded.
Loading instances.json file [D:\Program Files\ApliqoServer\webapps\alloc_sbx\WEB-INF\instances.json].

instances.json:

[
	{
		"name": "contentStore",
		"restUri": "http://localhost:8848",
		"tm1WebUri": "http://localhost:9510/tm1web",
		"applyParenthesisFormatting": true,
		"camNamespaces": ["Cognos ANT"],
		"useSSOWithCAM": true,
		"useSSORedirecWithBaseURL": true,
		"chartColorScheme": ["#848484"],
		"loginInstances": ["alloc_sbx"]
	},
	{
		"name": "alloc_sbx",
		"restUri": "https://<RedactedURL>:9095",
		"tm1WebUri": "https://<RedactedURL>:9510/tm1web",
		"applyParenthesisFormatting": true,
		"camNamespaces": ["Cognos ANT"],
		"useSSOWithCAM": true,
		"useSSORedirecWithBaseURL": true,
		"chartColorScheme": [
			"#848484"
		]
	}
]

Is our instances.json file malformed in some way? I don’t believe it is, but I would appreciate any help that anyone can provide.

Hi,
May I ask you to verify following in settings.json (should be located in the same folder as the executable):

  • first level key in the json file is literally “contentstore” (please maintain case - the tool is case sensitive)
  • “instance” underneath “contentstore” must be always “contentStore” (again, please maintain case - this is a key that corresponds to “name” in instances.json and MUST be literally the same).

Below is a sample settings.json file from readme.pdf:

{
    "contentstore": {
        "CAMNameSpace": "",
        "instance": "contentStore",
        "password": "",
        "userName": "admin"
},
    "pathToInstances": "./instances.json"
}
1 Like

Thanks so much for your reply pbuncik! That was our issue with the instances.json file. We were using the actual name of the contentStore instance rather than literally “contentStore”. Now we’re running into an authentication issue though.

ERROR: Login attempt into content store [contentStore] with user [Default User] has failed.

Is this implying that it’s attempting to log in to an instance literally called “contentStore”? Ours has a different name. If so, and since we can’t change the instance name in settings.json nor instances.json, where can we configure this?

Hi,
This error indicates most likely an issue with the credentials. There are several checks that you may do in order to isolate the issue:

  • check if the user can login to data instance without any issues from Architect or Arc (most issues are caused by exhausted number of login attempts)

  • please check which IntegratedSecurityMode you are using

  • if mode 5 (CAM), then please check CAM Namespace and user name - this might actually differ from TM1 username, since this is username as defined in LDAP). Also make sure you are not attempting to connect using CAMID as an user name - if you are using Apliqo UX to setup your sync service, then please make sure you change input type of the Admin User field in the Store Credentials screen to “input” (please see attached screenshot) - otherwise you will always receive CAMID instead of proper user name.

  • check if you are using encrypted password - if so, try to encrypt it once more (the encrypted password will look different every single time you store it)

  • if not, please check password length. If the unencrypted password is longer than 25 characters, the tool will consider it encrypted and will attempt to decrypt it - which obviously will lead to other issues

Regarding the instance [contentStore] - this is OK, it is always naming your content store instance like that (it is symbolic name only). The only value that matters is a proper URL and port information, name is not important for the tool.

This error basically means you are trying to access a value at a List index which is out of bounds i.e greater than the last index of the list or less than the least index in the list. So the first element is 0, second is 1, so on. So if there are n elements in a python list, the last element is n-1 . If you try to access the empty or None element by pointing available index of the list, then you will get the "List index out of range " error. To solve this error, you should make sure that you’re not trying to access a non-existent item in a list.

The way Python indexing works is that it starts at 0, so the first number of your list would be [0]. Index Error: List index out of range means you are trying to get an item in a list that doesn’t exist. It means that you are referring to n-th element of the python list, while the length of the list is smaller than n. whenever you get this type of error please cross check with items that comes between/middle in range, and insure that their index is not last if you get output then you have made perfect error that mentioned.

An index in Python refers to a position within an ordered list . To retrieve an element of the list, you use the index operator ([ ]) . Using indexing you can easily get any element by its position.