007revad / Synology_HDD_db

Add your HDD, SSD and NVMe drives to your Synology's compatible drive database and a lot more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Small glitch in the code ?

Kia0ra opened this issue · comments

Hi,

Thanks a lot for your scripts, they are awesome !
I have just noticed a small parse error while running it, I am sharing it with you.

`root@nas:/volume1/script# ./syno_hdd_db.sh -nr --showedits
Synology_HDD_db v3.3.75
DS220+ DSM 7.2.1-69057-3
StorageManager 1.0.0-0017

Using options: -nr --showedits
Running from: /volume1/script/syno_hdd_db.sh

HDD/SSD models found: 1
WD160EDGZ-11B2DA0,85.00A85

No M.2 drives found

No M.2 PCIe cards found

No Expansion Units found

WD160EDGZ-11B2DA0 already exists in ds220+_host_v7.db

Support disk compatibility already enabled.

Support memory compatibility already disabled.

Max memory already set to 18 GB.

Drive db auto updates already disabled.

parse error: Expected value before ',' at line 1, column 96319

DSM successfully checked disk compatibility.

You may need to reboot the Synology to see the changes.
`

I suspect if you run it again with --showedits it will show the same error.

And if you run it without --showedits it won't show the error.

Does the following command give the same error?

jq . ds220+_host_v7.db | grep -A 11 WD160EDGZ-11B2DA0

If it does give the same error can you attach a zipped copy of your ds220+_host_v7.db file.

You can copy the file to the script shared folder with:

sudo cp /var/lib/disk-compatibility/ds220+_host_v7.db /volume1/script/ds220+_host_v7.db

I've encountered a similar error. It only happens when running with --showedits.

I suspect if you run it again with --showedits it will show the same error.

Yes

And if you run it without --showedits it won't show the error.

Exact

Does the following command give the same error?

jq . ds220+_host_v7.db | grep -A 11 WD160EDGZ-11B2DA0

root@nas:/volume1/scripts# jq . ds220+_host_v7.db | grep -A 11 WD160EDGZ-11B2DA0 parse error: Expected value before ',' at line 1, column 96319
Exact same error

If it does give the same error can you attach a zipped copy of your ds220+_host_v7.db file.

You can copy the file to the script shared folder with:

sudo cp /var/lib/disk-compatibility/ds220+_host_v7.db /volume1/script/ds220+_host_v7.db

You can find the .db file in attachment

Thanks !

ds220+_host_v7.db.zip

Ok, I've found the issue. My script has added an extra comma so the file ends in ,,"nas_model":"ds220+"} when it should end in ,"nas_model":"ds220+"}

I'll update the script to prevent that, and fix it in the db file for people who've already run Synology_HDD_db v3.3.75

This new version v3.4.76 should work correctly with the -s or --showedits option. It also edits the ,db files to fix the ,, left from v3.3.75

https://github.com/007revad/Synology_HDD_db/releases/tag/v3.4.76

I think there's still a problem with the sed command :

root@nas:/volume1/scripts# ./syno_hdd_db.sh -nr  --showedits
Synology_HDD_db v3.4.76
DS220+ DSM 7.2.1-69057-3 
StorageManager 1.0.0-0017

Using options: -nr --showedits
Running from: /volume1/scripts/syno_hdd_db.sh

HDD/SSD models found: 1
WD160EDGZ-11B2DA0,85.00A85

No M.2 drives found

No M.2 PCIe cards found

No Expansion Units found

sed: no input files
WD160EDGZ-11B2DA0 already exists in ds220+_host_v7.db

Support disk compatibility already enabled.

Support memory compatibility already disabled.

Max memory already set to 18 GB.

Drive db auto updates already disabled.

parse error: Expected value before ',' at line 1, column 96319

DSM successfully checked disk compatibility.

You may need to reboot the Synology to see the changes.

I guess it helps if I tell sed which files to edit :(

All fixed now: https://github.com/007revad/Synology_HDD_db/releases/tag/v3.4.77

It definitely helps ;)

Thanks for the support and reactiveness !

bash-4.4# ./syno_hdd_db.sh -nr --showedits
Synology_HDD_db v3.4.77
DS220+ DSM 7.2.1-69057-3 
StorageManager 1.0.0-0017

Using options: -nr --showedits
Running from: /volume1/scripts/syno_hdd_db.sh

HDD/SSD models found: 1
WD160EDGZ-11B2DA0,85.00A85

No M.2 drives found

No M.2 PCIe cards found

No Expansion Units found

WD160EDGZ-11B2DA0 already exists in ds220+_host_v7.db

Support disk compatibility already enabled.

Support memory compatibility already disabled.

Max memory already set to 18 GB.

Drive db auto updates already disabled.

    "WD160EDGZ-11B2DA0": {
      "85.00A85": {
        "compatibility_interval": [
          {
            "compatibility": "support",
            "not_yet_rolling_status": "support",
            "fw_dsm_update_status_notify": false,
            "barebone_installable": true,
            "smart_test_ignore": false,
            "smart_attr_ignore": false
          }
        ]

DSM successfully checked disk compatibility.

You may need to reboot the Synology to see the changes.