The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

custom icon problem (paper_lantern)

Discussion in 'cPanel Developers' started by Sanson, Jul 31, 2017.

  1. Sanson

    Sanson Registered

    Joined:
    Jul 31, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Dear support,
    I am getting the following error while trying to install a custom icon for the paper_lantern theme.

    Please Help :)

    Code:
    [root@app /]# /usr/local/cpanel/scripts/install_plugin dockericons.tar.gz --theme paper_lantern
    info [install_plugin] Installing to paper_lantern
    warn [install_plugin] Error in installing plugin: Cpanel::Exception::JSONParseError/(XID mvbhc3) The system failed to parse the JSON stream data “    {
           "icon" : "docker.svg",
           "group_id" : "files",
           "order" : 10000,
           "name" : "Docker Manager",
           "type" : "link",
           "id" : "plugin_a",
           "uri" : "http://xxx.xxx.xxx.xxx:9999/",
           "target" : "_blank",
        }” from the file “/var/tmp/34674._USR_LOCAL_CPANEL_SCRIPTS_INSTALL_PLUGIN__.1pL4x0Mi.tmp/dockericons/install.json” because of an error: '"' expected, at character offset 232 (before "}") at /usr/local/cpanel/Cpanel/JSON.pm line 121.
    
     at /usr/local/cpanel/Cpanel/Exception/CORE.pm line 330.
            Cpanel::Exception::create("JSONParseError", HASH(0x2a70c68)) called at /usr/local/cpanel/Cpanel/Exception.pm line 46
            Cpanel::Exception::__ANON__(__CPANEL_HIDDEN__, HASH(0x2a70c68)) called at /usr/local/cpanel/Cpanel/JSON.pm line 144
            Cpanel::JSON::_throw_json_error("'\"' expected, at character offset 232 (before \"}\") at /usr/lo"..., "/var/tmp/34674._USR_LOCAL_CPANEL_SCRIPTS_INSTALL_PLUGIN__.1pL"..., SCALAR(0x1f496a0)) called at /usr/local/cpanel/Cpanel/JSON.pm line 122
            Cpanel::JSON::Load("    {\x{d}\x{a}       \"icon\" : \"docker.svg\",\x{d}\x{a}       \"group_id\" : \"fi"..., "/var/tmp/34674._USR_LOCAL_CPANEL_SCRIPTS_INSTALL_PLUGIN__.1pL"...) called at /usr/local/cpanel/Cpanel/JSON.pm line 279
            Cpanel::JSON::_LoadFile("/var/tmp/34674._USR_LOCAL_CPANEL_SCRIPTS_INSTALL_PLUGIN__.1pL"..., 0, 0, undef, 0) called at /usr/local/cpanel/Cpanel/JSON.pm line 220
            Cpanel::JSON::LoadFile("/var/tmp/34674._USR_LOCAL_CPANEL_SCRIPTS_INSTALL_PLUGIN__.1pL"...) called at /usr/local/cpanel/Cpanel/Themes/Serializer/JSON.pm line 22
            Cpanel::Themes::Serializer::JSON::_read(Cpanel::Themes::Serializer::JSON=HASH(0x176d490), "/var/tmp/34674._USR_LOCAL_CPANEL_SCRIPTS_INSTALL_PLUGIN__.1pL"...) called at /usr/local/cpanel/Cpanel/Themes/Serializer/Base.pm line 128
            Cpanel::Themes::Serializer::Base::load(Cpanel::Themes::Serializer::JSON=HASH(0x176d490)) called at /usr/local/cpanel/Cpanel/Themes/Serializer/JSON.pm line 30
            Cpanel::Themes::Serializer::JSON::build_data_tables(Cpanel::Themes::Serializer::JSON=HASH(0x176d490)) called at /usr/local/cpanel/Cpanel/Themes/Serializer/Base.pm line 95
            Cpanel::Themes::Serializer::Base::links(Cpanel::Themes::Serializer::JSON=HASH(0x176d490)) called at /usr/local/cpanel/Cpanel/Plugin/Install.pm line 83
            eval {...} called at /usr/local/cpanel/Cpanel/Plugin/Install.pm line 78
            Cpanel::Plugin::Install::install_plugin("/var/tmp/34674._USR_LOCAL_CPANEL_SCRIPTS_INSTALL_PLUGIN__.1pL"..., "paper_lantern") called at /usr/local/cpanel/scripts/install_plugin line 100
            PluginInstaller::run("dockericons.tar.gz", "--theme", "paper_lantern") called at /usr/local/cpanel/scripts/install_plugin line 9
    
    info [install_plugin] Running sprite_generator
    info [install_plugin] Queueing task to update API spec files
    [root@app /]#
    
    Also please guide me on how to uninstall this custom icon later when I want to remove/disable it.
     
    #1 Sanson, Jul 31, 2017
    Last edited by a moderator: Jul 31, 2017
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,627
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. Sanson

    Sanson Registered

    Joined:
    Jul 31, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,627
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Zip file removed, no need for that here. You might want to re-check your code.

    There are several other threads on the forum with this error easily found via google, here's one:
    The system failed to parse the JSON stream data

    You should have a peek at those for hints to the issue your having.
     
  5. Sanson

    Sanson Registered

    Joined:
    Jul 31, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    I searched the web but all problems are related to JSON when creating email/sub-domain/webmail
    But I have no problems on all that.

    I think there is a problem only in the install_plugin script on my cPanel Instillation.
     
  6. Sanson

    Sanson Registered

    Joined:
    Jul 31, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    This was my orginal code because it gave error I decided to just try with one icon and that too failed.

    Code:
    [
        {
           "order" : 1,
           "name" : "Docker",
           "type" : "group",
           "id" : "my_docker"
        },
        {
           "icon" : "container.svg",
           "group_id" : "my_docker",
           "order" : 1,
           "name" : "Docker Manager",
           "type" : "link",
           "id" : "plugin_a",
           "uri" : "http://xxx.xxx.xxx.xxx:9999/",
           "target" : "_blank",
           "featuremanager" : 1,
           "feature" : "plugin_a",
           "description" : "Manage Docker Containers"
        },
        {
           "icon" : "mapp.svg",
           "group_id" : "my_docker",
           "order" : 2,
           "name" : "Domain Mapping",
           "type" : "link",
           "id" : "plugin_b",
           "uri" : "http://xxx.xxx.xxx.xxx:9999/mapp.html",
           "target" : "_blank",
           "featuremanager" : 1,
           "feature" : "plugin_b",
           "description" : "Connect Domain to a Container"
        },
        {
           "icon" : "docker.svg",
           "group_id" : "my_docker",
           "order" : 3,
           "name" : "Docker Hub",
           "type" : "link",
           "id" : "plugin_c",
           "uri" : "https://hub.docker.com/",
           "target" : "_blank",
           "featuremanager" : 1,
           "feature" : "plugin_c",
           "description" : "Share Container Images"
        }
    ]
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you open a support ticket using the link in my signature so we can take a closer look at how you are adding this plugin?

    Thank you.
     
Loading...

Share This Page