CLI command error: **json: cannot unmarshal

Good day Geniuses,

Ran into an issue with customer with below details.

Redhat 8 Enterprise - RHEL 8.2 (Ootpa) Kernel 4.18.0-193.el8.x86_64
Go version 1.18+
GC version 54
gc telephony providers edges metrics list --edgeIds 2e84e642-8bba-4355-ac0d-b6a8173660db,e0a9b79f-f6b8-4c45-95b2-97ec10b4d6b8

Error:
json: cannot unmarshal array into Go value of type models.Entities

When I run this command on my WLS (Windows Linux Subsystem (Ubuntu)) it works fine, I'm on GC 53.
When customer runs the same command with GC version 23, it works.

I suspect it's something on the OS layer but I cannot say what.
Some insight on what could be the cause would be much appreciated.

The CLI is currently on version 57 (see Releases for the up-to-date list); you should always be using the latest version. Are you able to reproduce when using the latest version?

Hi Tim, Yes, same happens on 57, had the customer test, apologies, should have added that.

Thanks! I've asked someone from the CLI team to take a look.

1 Like

Hi Smit,

Could you please have your customer run gc logging enable. This will write some additional logging out to the operating system. In Linux, this file should be written here /tmp/GenesysCloud/gc.log). Please let me know what see as it might provide some clues as to what is going.

FWIW: Please be careful about posting the log contents here. If you do please make sure there is no PII or sensitive information in the logs.

Thanks,
John Carnell
Manager, Developer Engagement

1 Like

Good day John,

This is the logging line:
INFO: 2023/02/03 12:18:15 API response Correlation ID: 842931de-acda-41ec-a364-8e76058543e6, method: GET, URI: /api/v2/telephony/providers/edges/metrics?edgeIds=2e84e642-8bba-4355-ac0d-b6a8173660db%2Ce0a9b79f-f6b8-4c45-95b2-97ec10b4d6b8, timestamp(ms): 1675419495200
FATAL: 2023/02/03 12:18:15 json: cannot unmarshal array into Go value of type models.Entities

Hi Dewald,

Just a quick update.

I honestly cannot reproduce the issue. I checked the correlation id you sent me and the API calls completely fine. I was able to run the same command locally. I tried to reproduce it using Vagrant/Redhat, but unfortunately, I seem to be running into a macOs/ARM compatibility issue with Vagrant and am not able to run Redhat. I might try spin this up in AWS.

You could always try to pulldown the source for the CLI on the redhat box and add some trace logic and then build it, but that's a little extreme. I have opened a ticket with my team to dive deeper on this, but I am not sure what to tell you.

Thanks,
John Carnell
Director, Developer Engagement

1 Like

Thanks for the update.
Question: Could it be a missing module or out of date module on the Linux OS causing the unmarshal error?

Hi Dewald,

It shouldn't. Everything is written in go and statically linked into a single binary. So the cli shouldn't be trying to load dynamically linked modules.

Thanks,
John

Good day John, just checking in if the team has come up with anything we could try?

Hi Dewald,

We have not gotten much further on this. We have a ticket on it which means someone will look at it. Unfortunately, we have several higher-priority issues in front of it.

Thanks,
John

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