Legacy Dev Forum Posts

 View Only

Sign Up

CLI command error: **json: cannot unmarshal

  • 1.  CLI command error: **json: cannot unmarshal

    Posted 06-05-2025 18:24

    Dewald_Smit | 2023-02-06 08:43:12 UTC | #1

    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.


    tim.smith | 2023-01-27 14:23:33 UTC | #2

    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?


    Dewald_Smit | 2023-01-27 14:37:21 UTC | #3

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


    tim.smith | 2023-01-27 14:42:47 UTC | #4

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


    John_Carnell | 2023-01-27 15:01:52 UTC | #5

    Dewald_Smit, post:1, topic:18165
    2e8

    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


    Dewald_Smit | 2023-02-03 23:01:02 UTC | #6

    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


    John_Carnell | 2023-02-06 20:15:48 UTC | #7

    Dewald_Smit, post:1, topic:18165
    gc telephony providers edges metrics list --edgeIds 2e84e642-8bba-4355-ac0d-b6a8173660db,e0a9b79f-f6b8-4c45-95b2-97ec10b4d6b8

    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


    Dewald_Smit | 2023-02-06 20:57:11 UTC | #8

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


    John_Carnell | 2023-02-07 13:20:55 UTC | #9

    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


    Dewald_Smit | 2023-02-16 19:32:00 UTC | #10

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


    John_Carnell | 2023-02-17 13:50:27 UTC | #11

    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


    system | 2023-03-19 13:51:27 UTC | #12

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


    This post was migrated from the old Developer Forum.

    ref: 18165