# Error while parsing secondary index info string

**URL:** <https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988>\
**Category:** Operations\
**Created:** [January 23, 2023, 1:34pm UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988 "2023-01-23T13:34:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![helper\_bro](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/helper_bro/32/1769_2.png) [@helper\_bro](https://discuss.aerospike.com/u/helper_bro)\
**Post date:** [January 23, 2023, 1:34pm UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988/1 "2023-01-23T13:34:27Z")

</div>

while restoring aerospike backup taken from AS 4.x to AS 6.x i am getting below error

```plaintext
2023-01-23 13:20:28 GMT [INF] [11083] Restoring 38 secondary index(es)
2023-01-23 13:20:28 GMT [ERR] [11083] Invalid path type string
2023-01-23 13:20:28 GMT [ERR] [11083] Error while parsing secondary index info string ns=test:indexname=Campaign_lineItemId_IDX:set=Campaign:bin=lineItemId:type=string:indextype=default:context=null:state=RW
2023-01-23 13:20:28 GMT [ERR] [11083] Error while checking index test:Campaign:Campaign_lineItemId_IDX (lineItemId)
2023-01-23 13:20:28 GMT [ERR] [11083] Error while restoring secondary indexes to cluster
2023-01-23 13:20:29 GMT [INF] [11101] 0 UDF file(s), 0 secondary index(es), 0 record(s) (0 KiB/s, 0 rec/s, 0 B/rec, backed off: 0)

```

When i skip restoring index, restoration is working fine. Is there a way to fix this?

---

<div class="post-metadata">

**Author:** ![meher](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/meher/32/1644_2.png) [@meher](https://discuss.aerospike.com/u/meher)\
**Post date:** [January 24, 2023, 1:04am UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988/2 "2023-01-24T01:04:55Z")

</div>

Did you use the `asbackup` and `asrestore` from the same tools package? Which version of the tools / `asbackup` did you use? There were changes around sindex backup file format. I noticed this Jira:

- [TOOLS-2263] - (ASBACKUP) Backup file format changed for sindexes starting in asbackup 3.12.0.

That is addressed in the [8.0.2](https://download.aerospike.com/download/tools/notes.html#8.0.2) tools package. But from the error message described, I am not sure this is related to your issue… If urgent, you can always recreate the sindex manually but if you provide the version details for `asbackup` or the tools package used, we could check to see whether there are some known compatibility issues.

---

<div class="post-metadata">

**Author:** ![helper\_bro](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/helper_bro/32/1769_2.png) [@helper\_bro](https://discuss.aerospike.com/u/helper_bro)\
**Post date:** [January 24, 2023, 1:11am UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988/3 "2023-01-24T01:11:41Z")

</div>

> [@meher](#):
>
> use the `asbackup` and `asrestore` from the same tools package? Which version of the tools / `asbackup` did you use? There were changes around sindex backup file format. I noticed this Jira:
> 
> - [TOOLS-2263] - (ASBACKUP) Backup file format changed for sindexes starting in asbackup 3.12.0.

```auto
asbackup --version

Aerospike Backup Utility

Version 3.2.9

C Client Version 4.3.20

Copyright 2015-2017 Aerospike. All rights reserved.

```

taking dump from 4.5.0.3 and restoring to 6.2.0.2

---

<div class="post-metadata">

**Author:** ![helper\_bro](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/helper_bro/32/1769_2.png) [@helper\_bro](https://discuss.aerospike.com/u/helper_bro)\
**Post date:** [January 24, 2023, 1:12am UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988/4 "2023-01-24T01:12:11Z")

</div>

dump and restore are being done on same machine hence same package.

---

<div class="post-metadata">

**Author:** ![meher](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/meher/32/1644_2.png) [@meher](https://discuss.aerospike.com/u/meher)\
**Post date:** [January 24, 2023, 3:11am UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988/5 "2023-01-24T03:11:30Z")

</div>

Would you be able to try it with the latest `asbackup` version?

---

<div class="post-metadata">

**Author:** ![helper\_bro](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/helper_bro/32/1769_2.png) [@helper\_bro](https://discuss.aerospike.com/u/helper_bro)\
**Post date:** [January 24, 2023, 3:30am UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988/6 "2023-01-24T03:30:18Z")

</div>

i did try, the latest version was not able to connect to AS 4.x. It was saying version incompatibility.

---

<div class="post-metadata">

**Author:** ![meher](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/meher/32/1644_2.png) [@meher](https://discuss.aerospike.com/u/meher)\
**Post date:** [January 24, 2023, 6:15am UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988/7 "2023-01-24T06:15:40Z")

</div>

Ah… didn’t realize this. Not sure if backing up with the `asbackup` that shipped with 4.5 and restoring with the `asrestore` that shipped with 6.2. This may still not work, I am not sure, and may not be practical to try. Let me see if I figure something internally… (just for reference, I have opened an internal Jira: TOOLS-2338).

---

<div class="post-metadata">

**Author:** ![helper\_bro](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/helper_bro/32/1769_2.png) [@helper\_bro](https://discuss.aerospike.com/u/helper_bro)\
**Post date:** [January 24, 2023, 6:35am UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988/8 "2023-01-24T06:35:44Z")

</div>

the data restore seems to be working fine. facing issues only with index restore. Please let me know if we need to be cautious around data restore as well.

---

<div class="post-metadata">

**Author:** ![meher](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/meher/32/1644_2.png) [@meher](https://discuss.aerospike.com/u/meher)\
**Post date:** [January 25, 2023, 3:18am UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988/9 "2023-01-25T03:18:16Z")

</div>

I wouldn’t expect any issue with the data portion… I see a developer has started to look at this issue, will keep you posted.

---

<div class="post-metadata">

**Author:** ![Dylan\_W](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/dylan_w/32/1314_2.png) [@Dylan\_W](https://discuss.aerospike.com/u/Dylan_W)\
**Post date:** [January 25, 2023, 6:44pm UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988/10 "2023-01-25T18:44:58Z")

</div>

Looks like the issue is a combination of a change in the info protocol between 3.x servers, 6.x, and the way old asrestore parses secondary index info responses. When asrestore restores secondary indexes it makes this info request to the target server `sindex-list:ns=<namespace>` it compares the results to the secondary indexes in the backup file to make sure it isn’t overwriting an identical version of the sindex. The code for parsing that info response in asbackup 3.2.9 is case sensitive. Newer tools including asbackup 3.14.0 (current newest) are case insensitive. Looking at the info response between server 4.8.0.13 and 6.2.0.2 we see…

4.8.0.13

```auto
ns=test:set=demo:indexname=idx_foo:bin=foo:type=STRING:indextype=NONE:path=foo:state=RW;ns=test:set=demo:indexname=idx_bar:bin=foo:type=NUMERIC:indextype=NONE:path=foo:state=RW;

```

6.2.0.2

```auto
ns=test:indexname=idx_foo:set=demo:bin=foo:type=string:indextype=default:context=null:state=RW;ns=test:indexname=idx_bar:set=demo:bin=foo:type=numeric:indextype=default:context=null:state=RW

```

The case difference at “type” means that when we run asrestore 3.2.9 against server 6.2.0.2 the sindex parsing code fails because of case sensitivity with `[ERR] [11] Invalid path type string` .

Using a recent asbackup (3.14.0) with the old backup files should work fine and works for me.

```auto
% asrestore -d TOOLS-2338 -n test -h 127.0.0.1:3003
2023-01-25 18:41:49 UTC [INF] [73702] [src/main/aerospike/as_cluster.c:202][as_cluster_add_nodes_copy] Add node BB9030011AC4202 127.0.0.1:3003
2023-01-25 18:41:49 UTC [INF] [73702] [src/main/aerospike/as_cluster.c:202][as_cluster_add_nodes_copy] Add node BB9030011AC4202 127.0.0.1:3003
2023-01-25 18:41:49 UTC [INF] [73702] Starting restore to 127.0.0.1:3003 (bins: [all], sets: [all]) from TOOLS-2338
2023-01-25 18:41:49 UTC [INF] [73702] Processing 1 node(s)
2023-01-25 18:41:49 UTC [INF] [73702] Found 1 backup file(s) in TOOLS-2338
2023-01-25 18:41:49 UTC [INF] [73702] Restoring records
2023-01-25 18:41:49 UTC [INF] [73739] Restoring TOOLS-2338/BB9020011AC4202_00000.asb
2023-01-25 18:41:49 UTC [INF] [73739] Opened backup file TOOLS-2338/BB9020011AC4202_00000.asb
2023-01-25 18:41:50 UTC [INF] [73702] Skipped 2 matched index(es)
2023-01-25 18:41:50 UTC [INF] [73738] 0 UDF file(s), 2 secondary index(es), 72087 record(s) (129188 rec/s, 12237 KiB/s, 97 B/rec, retries: 0)
2023-01-25 18:41:50 UTC [INF] [73738] Expired 0 : skipped 0 : err_ignored 0 : inserted 206: failed 71881 (existed 0 , fresher 71881)
2023-01-25 18:41:50 UTC [INF] [73738] 100% complete, ~0s remaining

```

For completeness here is the sindex portion of my backup file from the old server.

```auto
Version 3.1
# namespace test
# first-file
* i test demo idx_foo N 1 foo S
* i test demo idx_bar N 1 foo N

```

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/system/32/2274_2.png) [@system](https://discuss.aerospike.com/u/system)\
**Post date:** [April 19, 2023, 6:45pm UTC](https://discuss.aerospike.com/t/error-while-parsing-secondary-index-info-string/9988/11 "2023-04-19T18:45:20Z")

</div>

This topic was automatically closed 84 days after the last reply. New replies are no longer allowed.
