i-nex / I-Nex

System information tool written in gambas3, python, bash
http://i-nex.linux.pl/
174 stars 24 forks source link

"JSON.ReadObject.123: Comma expected" when starting I-Nex 7.4.0 #10

Closed alphastar868 closed 8 years ago

alphastar868 commented 9 years ago

Been working on getting this going under Centos 7. Installed the following RPMS:

gambas3* (3.8.1) from Fedora Rawhide (fc23/fc24) at https://fedoraproject.org/wiki/Releases/Rawhide libcpuid11 (0.2.1) from brollylssj (fc23) at https://copr.fedoraproject.org/coprs/brollylssj/I-Nex/

and various versions of i-nex rpms OpenSUSE brollylssj, and custom compiled using a modified brollylssj SRPM SPEC file and I-Nex-master.zip sources from GitHub to produce i-nex-7.4.0-1.el7.centos.x86_64.rpm and i-nex-data-7.4.0-1.el7.centos.noarch.rpm.

Unfortunately, the OpenSUSE RPMs fail after a few lines of messages with

[INFO] [Finfosys.Form_Open.267] Check Dospam uptime

The brollylssj and custom Centos 7 RPMS go further, but both fail as follows:

[09/26/2015 19:12:07.632] [INFO] [Finfosys.Form_Open.49] Starting log
[09/26/2015 19:12:07.636] [INFO] [Finfosys.Form_Open.78] Check whereis inex-cpuid and get JSON Data
[09/26/2015 19:12:08.529] [INFO] [Finfosys.Form_Open.80] Decode JSON Data
[09/26/2015 19:12:08.539] [INFO] [Finfosys.Form_Open.82] Add Values CPUID
[09/26/2015 19:12:08.539] [INFO] [Finfosys.Form_Open.113] Create Labels ToolButtons TextLabels in ScrollView1
[09/26/2015 19:12:08.579] [INFO] [Finfosys.Form_Open.205] Check available procesors
[09/26/2015 19:12:08.579] [INFO] [Finfosys.Form_Open.225] /home/user/.i-nex/i-nex.conf
[09/26/2015 19:12:08.58] [INFO] [Finfosys.Form_Open.226] /home/user/.i-nex
[09/26/2015 19:12:08.58] [INFO] [Finfosys.Form_Open.229] Call to MInit for copy nedded files to I-Nex config dir in User.Home
[09/26/2015 19:12:08.58] [INFO] [MInit._inits.26] i-nex in home folder is exist
[09/26/2015 19:12:08.58] [INFO] [MInit._inits.27] Try to remove files
[09/26/2015 19:12:08.581] [INFO] [MInit._inits.36] Copy nedded files
[09/26/2015 19:12:08.581] [INFO] [MInit._inits.39] Copy gputemp from Data/gputemp to /home/user/.i-nex/gputemp
[09/26/2015 19:12:08.581] [INFO] [Finfosys.Form_Open.231] Settings default dir = /home/user/.i-nex
[09/26/2015 19:12:08.581] [INFO] [Finfosys.Form_Open.232] Check for Battery
[09/26/2015 19:12:08.581] [INFO] [Finfosys.Form_Open.234] Check for Usb device plugged
[09/26/2015 19:12:08.651] [INFO] [Finfosys.Form_Open.236] Check for Drives
[09/26/2015 19:12:08.652] [INFO] [Disk_Drives._inits.71] Add Drives to ComboBox
[09/26/2015 19:12:08.652] [INFO] [Finfosys.Form_Open.238] Check for Drives..
[09/26/2015 19:12:08.652] [INFO] [Disk_Drives._init_2.83] Add Drives to ComboBox..
[09/26/2015 19:12:08.652] [INFO] [Disk_Drives.get_informations.100] Deleting data from variables
[09/26/2015 19:12:08.652] [INFO] [Disk_Drives.get_informations.102] Get informations of Drives
[09/26/2015 19:12:08.653] [INFO] [Disk_Drives.get_informations.141] Get informations of Drives Done
[09/26/2015 19:12:08.667] [INFO] [Finfosys.Form_Open.240] Check for Drives....
[09/26/2015 19:12:08.667] [INFO] [Disk_Drives.get_informations.100] Deleting data from variables
[09/26/2015 19:12:08.667] [INFO] [Disk_Drives.get_informations.102] Get informations of Drives
[09/26/2015 19:12:08.668] [INFO] [Disk_Drives.get_informations.141] Get informations of Drives Done
[09/26/2015 19:12:08.68] [INFO] [Finfosys.Form_Open.242] Check for Input Drives
[09/26/2015 19:12:08.68] [INFO] [Input_Devices._inits.30] Add Input Devices to ComboBox..
[09/26/2015 19:12:08.687] [INFO] [Finfosys.Form_Open.244] Check available network devices
[09/26/2015 19:12:08.687] [INFO] [Network.inits.26] Add Network Devices to ComboBox
[09/26/2015 19:12:08.689] [INFO] [Finfosys.Form_Open.246] Check available graphic DSub, DVI etc
[09/26/2015 19:12:08.689] [INFO] [Finfosys.Form_Open.248] Call to Graphic
[09/26/2015 19:12:08.764] [INFO] [Finfosys.Form_Open.250] Check sound cards
[09/26/2015 19:12:10.606] [INFO] [Finfosys.Form_Open.252] Check for default display manager
[09/26/2015 19:12:10.606] [INFO] [Finfosys.Form_Open.266] Check Dospam uptime
[09/26/2015 19:12:10.622] [INFO] [Finfosys.Form_Open.268] Check System
 user@localhost.localdomain
 OS: "centos" 
 Kernel: x86_64 Linux 3.10.0-229.el7.x86_64
 Uptime: 5h 38m
 Packages: Unknown
 Shell: inex.gambas
 Resolution: 3840x1080
 DE: Gnome 3.8.4
 WM: GNOME Shell
 WM Theme: Adwaita
Adwaita [GTK2]
, Adwaita [GTK3]
 Icon Theme: gnome
 Font: Cantarell 11
 CPU: Intel Core2 CPU 6600 @ 2.394GHz
 GPU: AMD/ATI RV515 [Radeon X1300/X1550]
 RAM: 2882MB / 7918MB
JSON.ReadObject.123: Comma expected
MStart.Main.62 

For the record, I can run i-nex-usage successfully:

{
    "MEMORY_TOTAL": 7918 ,
    "MEMORY_USED": 2418 ,
    "MEMORY_FREE": 3348 ,
    "MEMORY_SHARED": 12 ,
    "MEMORY_BUFFERS": 1 ,
    "MEMORY_CACHED": 2150 ,
            "OTH": {
            "LOW": {
                "TOTAL": 7918 ,
                "USED": 4570 ,
                "FREE": 3348 
            },
            "HIGH": {
                "TOTAL": 0 ,
                "USED": 0 ,
                "FREE": 0 
            }
    },
    "USED_PLUS_CACHED": 266 ,
    "FREE_PLUS_CACHED": 5500 ,
            "TOTAL": {
            "TOTAL": {
                "TOTAL": 15854 ,
                "USED": 2418 ,
                "FREE": 11284 
            }
    },
    "SWAP_TOTAL": 7935 ,
    "SWAP_USED": 0 ,
    "SWAP_FREE": 7935 ,
    "UPTIME_DAYS": 0 ,
    "UPTIME_HOURS": 5 ,
    "UPTIME_MINUTES": 27 ,
    "UPTIME_SECONDS": 53 ,
    "LOAD_AVG_1MIN": 40 ,
    "LOAD_AVG_5MIN": 25 ,
    "LOAD_AVG_15MIN": 22 ,
    "TOTAL_RAM": 7918 ,
    "FREE_RAM": 3348 ,
    "SHARED_RAM": 0 ,
    "BUFFERED_RAM": 1 ,
    "TOTAL_RAM_UNIT": 7918 ,
    "FREE_RAM_UNIT": 3348 ,
    "TOTAL_SWAP": 7935 ,
    "FREE_SWAP": 7935 ,
    "TOTAL_HIGH": 0 ,
    "FREE_HIGH": 0 ,
    "NUMBER_OF_PROCESSES": 384 
}

Have I missed something in the dependencies, or is this a bug? Could my issues be based on the version of gambas3?

Thanks in advance for your help, alphastar

<bountysource-plugin>

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26976895-json-readobject-123-comma-expected-when-starting-i-nex-7-4-0?utm_campaign=plugin&utm_content=tracker%2F488098&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F488098&utm_medium=issues&utm_source=github).
</bountysource-plugin>
alphastar868 commented 9 years ago

Here is some more info on the full list of RPMS I installed for I-Nex on Centos 7. Perhaps this can turn into a HowTo on the I-Nex Install page (http://i-nex.linux.pl/install/) for CentOS, once someone confirms that it works:

#Prerequisites

From Fedora Rawhide gambas3-runtime-3.8.1-1.fc24.x86_64 gambas3-gb-desktop-3.8.1-1.fc24.x86_64 gambas3-gb-form-3.8.1-1.fc24.x86_64 gambas3-gb-form-dialog-3.8.1-1.fc24.x86_64 gambas3-gb-form-stock-3.8.1-1.fc24.x86_64 gambas3-gb-gtk-3.8.1-1.fc24.x86_64 gambas3-gb-image-3.8.1-1.fc24.x86_64 gambas3-gb-settings-3.8.1-1.fc24.x86_64 gambas3-gb-qt4-3.8.1-1.fc24.x86_64 gambas3-gb-qt4-ext-3.8.1-1.fc24.x86_64

From brollylssj's fc23 build libcpuid11-0.2.1-1.x86_64

procps-ng-3.3.10-3.el7.x86_64 from Centos repo

#I-Nex RPMs, choices

You can now install the OpenSUSE fc20 RPMs using "rpm -Uvh --nodeps _I-Nex_rpmURL _I-Nex_Data_rpmURL" to bypass the now obsolete(?) requirement for gambas3-gb-geom coded in the OpenSUSE fc20 RPM.
Alternatively, you can install the brollylssj I-Nex builds using "yum install _I-Nex_rpmURL _I-Nex_Data_rpmURL".

Note that all the I-Nex installs require the installation of i-nex and i-nex-data RPMS at the same time are they are both (intentionally) dependencies of each other. Also, while the i-nex* RPM is architecture specific (i.e. "x86_64" or "i386" subfolder) the i-nex-data* RPM is found in the "noarch" subfolder.

#Custom building the latest I-Nex on GitHub for Centos

I built custom rpmbuild RPMs using a modified specfile from brollylssj's fc23 .src.rpm:

  1. "yum install rpm-build"
  2. Installed i-nex-7.4.0-1.fc23.src.rpm from brollylssj using "rpm -i"
  3. Edited brollylssj's ~/rpmbuild/SPECS/i-nex.spec (added "/etc/i-nex" and "/etc/udev/rules.d/i2c_smbus.rules" under %files section), and
  4. Downloaded I-Nex-master.zip from GitHub (renamed folder to "I-Nex-7.4.0" and rezipped as 7.4.0.tar.gz; copied to ~/rpmbuild/SOURCES/)**
  5. Run "rpmbuild -ba ~/rpmbuild/SPECS/i-nex.spec" as ordinary user.

Produces the following files in ~/rpmbuild/RPMS/ if successful:

i-nex-7.4.0-1.el7.centos.x86_64 i-nex-data-7.4.0-1.el7.centos.noarch

#Required RPMs for Build Environment

To successfully compile the above on Centos 7, install the following RPMs and SRPMs using "yum install rpmname" e.g. "yum install rpm-build":

rpm-build-4.11.1-25.el7.x86_64

i-nex-7.4.0-1.fc23.src.rpm from brollylssj

ImageMagick-6.7.8.9-10.el7.x86_64 autoconf-2.69-11.el7.noarch automake-1.13.4-3.el7.noarch freeglut-2.8.1-3.el7.x86_64 gambas3-devel-3.8.1-1.fc24.i686 from Rawhide procps-ng-devel-3.3.10-3.el7.x86_64

fdupes-1.51-10.fc23.x86_64 from Rawhide

libXau-devel-1.0.8-2.1.el7.x86_64 libxcb-devel-1.9-5.el7.x86_64 libX11-devel-1.6.0-2.1.el7.x86_64 libXfixes-devel-5.0.1-2.1.el7.x86_64 mesa-libglapi-10.2.7-5.20140910.el7_1.1.x86_64 libXdamage-devel-1.1.4-4.1.el7.x86_64 libXext-devel-1.3.2-2.1.el7.x86_64 libXxf86vm-devel-1.1.3-2.1.el7.x86_64 mesa-libgbm-10.2.7-5.20140910.el7_1.1.x86_64 mesa-libGL-10.2.7-5.20140910.el7_1.1.x86_64 mesa-libGL-devel-10.2.7-5.20140910.el7_1.1.x86_64

libcpuid-devel-0.2.1-1.x86_64 from brollylssj

gcc-4.8.3-9.el7.x86_64

Note that the version numbers above may vary with the build version of CentOS 7. The above files were used on CentOS Linux release 7.1.1503 (Core)

alphastar868 commented 9 years ago

Well, here's the progress I have made:

  1. Reviewed the source code some more and found where the error originates.
  2. Tested a temporary hack on the source to confirm/resolve issue.
  3. Rebuilt RPMs using the above method to test if I-Nex loads...

Voila!

09272015141810215

# Technical Details

I discovered that the script in I-Nex/i-nex/Data/Data/screenfetch-dev produces a file called ~/.i-nex/screenfetch.json. Unfortunately, the "OS:" section of this file is output in double quotes i.e. ""centos"", which causes JSON.module to throw the ReadObject error at line 123 when I-Nex-7.4.0/I-Nex/i-nex/.src/Finfosys.class calls JSON.Decode on line 330.

# Quick Fix

The quick and dirty fix is to change I-Nex/i-nex/Data/Data/screenfetch-dev to read as follows on line 3381:

"Distro": $distro,

...thus allowing the screenfetch.json file to be properly parsed. I-Nex 7.4.0 (modified as above) takes quite a long time to load on my Core2Duo (almost 40 seconds, I think), so I'm not sure if everything is 100%, but it seems to run fine and I can access all functions (no SPD love though).

Also, the RPMs I built also included the additional bugfix for the I-Nex Library app on x86_64 architectures as well.

If these changes are applied to Step 4 (above) of the Custom Building instructions (before rezipping the source code), then you should be able to successfully build and install I-Nex 7.4.0 on Centos 7.

alphastar868 commented 9 years ago

09272015151345808

alphastar868 commented 8 years ago

This issue is fixed for CentOS in https://github.com/eloaders/I-Nex/commit/5813d16340787a2287513f65755b3caa9599ef86