NSA320S Metarepository stopped working - try to upgrade from SMP1

Options
Norbi
Norbi Posts: 18  Freshman Member
First Anniversary 10 Comments
Hello!

I've read several articles/comments from Mijzelf, and some years ago I've successfully installed Metarepository and other third-party packages to my NSA320S (Firmware: V4.70(AANV.0)).
I've used it for years, never changed, but now I have problems with SMB1, so I started to search methods to install better samba and found Mijzelf's excellent guide (thanks again!): https://zyxel.diskstation.eu/forum/viewtopic.php?f=4&t=24

When I open the NAS admin page, the package list was empty - it is stange, because when I last time saw, it was full of packages. So I restarted.
The NAS booted successfully, every package started as always, but the package manager - after some spinning - remains empty. After several reboots nothing changed. :-(

After searching for the solution, I found this: 
https://community.zyxel.com/en/discussion/comment/41914#Comment_41914
As always Mijzelf tried to help this time again, and suggested, there must be a text file: \\<NAS>\admin\zy-pkgs\web_prefix with an url in it. And yes, I have this file with this url:
http://localhost:59999/

He also suggests, there must be some logfile, and yes there is, but it's content is very strange:

Request: /i-data/md0/admin/zy-pkgs/MetaRepository/NSA320S/4.70/zypkg/ZYPKG_INFO.tgzBusyBox v1.17.2 (2014-02-10 15:19:59 CST) multi-call binary.
Usage: dirname FILENAME
TarHeaderFetch ^_.^H˛^Xka^B^CíX[oŰ6^  ..(~1400 bytes of binary content).. ^G^G`zŹ( - failed 

I've stuck in this point, not understanding what's the problem with BusyBox - it works fine as I tried some commands.

Thanks for your help!

Accepted Solution

  • Mijzelf
    Mijzelf Posts: 2,605  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    How can I add the mirror you mentioned to my MetaRepository?

    Good question. Normally you do that in the webinterface. As MetaRepository is running, maybe it's webinterface also works:

    http://${address}/${revision}/adv,/pkg/MetaRepository/

    To find the revision you have to look at the url when you have logged in on the webinterface. If it isn't visible in the address bar of your browser, copy the url and paste in in notepad, or something like that.
    When the webinterface doesn't work, you'll have to use the Telnet backdoor, (or ffp telnet or ssh) and edit the configuration file /usr/local/zy-pkgs/etc/MetaRepository.conf. You have RandomTools installed, so probably you can use nano for that. If that doesn't work you have only vi (or one of the ffp editors). Vi is a nasty editor, but it gets it's job done. Google for instructions.

«1

All Replies

  • Mijzelf
    Mijzelf Posts: 2,605  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    Did that empty package list problem start when you installed Entware Samba?

    Anyway, i think you have a corrupted file, somewhere, and I hope it's in the database. Can you rename the MetaRepository directory in the admin share to something else, and then reboot? After refreshing the package list again, a new database should be build. (Without the ZyXEL packages, btw, as ZyXEL removed them. A work around is here)
  • Norbi
    Norbi Posts: 18  Freshman Member
    First Anniversary 10 Comments
    Options
    Thanks for the fast answer!

    No, my problems starts before I can do anything, because when I started to try to install Entware Samba, I realized, that the package list is empty :-(

    Now I tried to rename MetaRepository directory as you mentioned, and yes, it created again after reboot and page refreshed. And created another logfile (ZYPKG_INFO.tgz.log) with the following content:

    HandleZYPKG_INFO /NSA320S/4.70/zypkg
    FindApp md5sum found /sbin/md5sum
    ReadConfig Repositories
            Start of block
            /i-data/md0/admin/MyRepo/ Local
            End of block
    8 start: 07:59:26
    9 start: 07:59:26
    8: FetchZYPKG_INFO /i-data/md0/admin/MyRepo/ 8 Local
    9: FindApp curl found /usr/bin/curl
    8: FindApp curl found /usr/bin/curl
    8: Fetch /i-data/md0/admin/MyRepo/ZYPKG_INFO.tgz /i-data/md0/admin/zy-pkgs/MetaRepository/_i-data_md0_admin_MyRepo_.tmp failed
    8: Fetch /i-data/md0/admin/MyRepo/ZYPKGS /i-data/md0/admin/zy-pkgs/MetaRepository/_i-data_md0_admin_MyRepo_.tmp failed
    8: Failed
    8 stop: 07:59:27
    9: Fetch http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ZYPKG_INFO.tgz /i-data/md0/admin/zy-pkgs/MetaRepository/http___zyxel.diskstation.eu_Users_
    9: Fetch http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ZYPKGS /i-data/md0/admin/zy-pkgs/MetaRepository/http___zyxel.diskstation.eu_Users_Mijzelf_
    9: sh: -f: unknown operand
    9 stop: 07:59:36
    Pushlist...
    ReadConfig Pushlist
            Start of block
            End of block
    Blacklist...
    ReadConfig Blacklist
            Start of block
            End of block
    Sort...
    Choose packages...
    Choose DEPS...
    Create ZYPKG_INFO.tgz
    TarHeader
    FindApp curl found /usr/bin/curl
    Fetch /i-data/md0/admin/zy-pkgs/MetaRepository/NSA320S/4.70/zypkg/ZYPKG_INFO.tgz - succeeded


    I see that there are another shell problem: sh: -f: unknown operand
    Without the actual command it is hard to say why.
    Where is the script which fail with this error?
    Do you know what the problem?

    Thanks a lot!
  • Mijzelf
    Mijzelf Posts: 2,605  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    edited August 2022
    Options
    Oh dear. Do you have a directory 'admin/zy-pkgs/MetaRepository/http___zyxel.diskstation.eu_Users_Mijzelf_', and what is inside it? MetaRepository creates a subdirectory for each repo, and the name is the url of that repo, with 'unconvenient' characters exchanged by underscores. Seeing your directory name, and the shell error, I wonder if it chokes in the '-' in zypkg-repo.
    The script which does this is /usr/local/zy-pkgs/gui/MetaRepository/ZYPKG_INFO.sh, which is called by pkgcgi.cgi (also a shell script), which is called by a busybox incarnation of inetd.

    Do you know which version of MetaRepository you are running?
  • Norbi
    Norbi Posts: 18  Freshman Member
    First Anniversary 10 Comments
    Options
    Sorry my last repeated post, but I realized late that the post will only appear after verification.

    So, yes, I have that directory with a slighly longer name: http___zyxel.diskstation.eu_Users_Mijzelf_zypkg-repo_fw4
    And yes, there is a dash character inside.

    It's content:
    -rwxrwxrwx 1 nobody nobody  389 Aug 26 09:59 CalibreCOPS_1.1.3_arm_008.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  341 Aug 26 09:59 Darkstat_3.0.719_arm_005.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  332 Aug 26 09:59 Dropbear_2014.63_arm_002.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  381 Aug 26 09:59 EncryptedShares_20140603_arm_001.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  411 Aug 26 09:59 Entware-ng_20181002_arm_006.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  291 Aug 26 09:59 MetaRepository_20181001_arm_015.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  307 Aug 26 09:59 MidnightCommander_4.6.1_arm_003.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  425 Aug 26 09:59 MuninLite_1.0.4_arm_003.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  396 Aug 26 09:59 PlexMediaServer_20161213_arm_003.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody 1372 Aug 26 09:59 RandomTools_20170220_arm_012.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  291 Aug 26 09:59 SyncThing_1.13.1_arm_01.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  410 Aug 26 09:59 Tweaks_20200310_arm_035.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  319 Aug 26 09:59 anyterm_9652_arm_001.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  326 Aug 26 09:59 btsync_1.4.110_arm_007.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  328 Aug 26 09:59 exFAT_1.0.1_arm_001.zpkg.ZYPKG
    -rwxrwxrwx 1 nobody nobody  290 Aug 26 09:59 ffp_0.7_arm_006.zpkg.ZYPKG
    drwxrwxrwx 3 nobody nobody 4096 Aug 26 09:59 i-data

    I'm trying hard to understand the script, but it's too complicated for me - at least at first glance.

    I found in the ZSPKGS file that the MetaRepository version is 20181001zypkg015 (MetaRepository_20181001_arm_015.zpkg 491520 bytes).

    Thanks,
    Norbi
  • Mijzelf
    Mijzelf Posts: 2,605  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    edited September 2022
    Options
    So, yes, I have that directory with a slighly longer name: http___zyxel.diskstation.eu_Users_Mijzelf_zypkg-repo_fw4

    Ah, in that case it's OK. The directory name looked truncated in the log, but I suppose that is a forum thingy.

    Further the log looks normal, except for that shell error. The firmware package manager asks for <baseurl>/NSA320S/4.70/zypkg/ZYPKG_INFO.tgz, and it gets the dynamically generated \\admin\zy-pkgs\MetaRepository\NSA320S\4.70\zypkg\ZYPKG_INFO.tgz.

    Does that file look normal? It should contain a file /i-data/md0/admin/zy-pkgs/ZYPKGS, which looks like https://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ZYPKGS (not exactly, of course).


  • Norbi
    Norbi Posts: 18  Freshman Member
    First Anniversary 10 Comments
    Options
    Yes, there is the ZYPKG_INFO.tgz file in the correct path, it is extractable, the ZYPKGS file is like yours. Anyways, it looks fine.

    Whats next?
  • Mijzelf
    Mijzelf Posts: 2,605  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    Do you have any packages (zypkgs) installed, which are not listed in the generated ZYPKG_INFO.tgz? In older firmwares the firmware package manager didn't like that, up to and including not showing installed and available packages. But I thought in 4.70 that problem was solved. Although I have no idea if 4.70 on an 320S is mostly identical to 4.70 on a 325.

    Anyway, when you have any orginal ZyXEL packages installed, the ZYPKGS_INFO.tgz will probably not show them, as the ZyXEL package server is down. In that case you could add the mirror 'http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/zyxel_fw4_zypkgs/' to your MetaRepository.


  • Norbi
    Norbi Posts: 18  Freshman Member
    First Anniversary 10 Comments
    Options
    It's a hard question: which packages I've installed more then a year ago...

    I found an Installed.list file, and it's content is very familiar:
    I'm sure, that I've installed MidnightCommander, PHP-MySQL-phpMyAdmin (I think it was a factory default), PlexMediaServer (never worked correctly, I want to remove it, but it runs after restarting) and ffp.
    There is the RandomTools package, I've not recognized.

    I remember, that some day I've installed the Transmission client, but it not running now and not in list.
    And there is the TwonkyServer and htop, which are running, but not in the installed list

    How can I add the mirror you mentioned to my MetaRepository? I've tried to put it into the /admin/zy-pkgs/web_prefix file and restarted the NAS with MetaRepository directory deleted, but the web_prefix file's content changed to http://localhost:59999/
    and the ZYPKG_INFO.tgz.log content:

    <div>HandleZYPKG_INFO /NSA320S/4.70/zypkg</div><div>FindApp md5sum found /sbin/md5sum</div><div>ReadConfig Repositories</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Start of block</div><div>&nbsp; &nbsp; &nbsp; &nbsp; http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ Mijzelf</div><div>&nbsp; &nbsp; &nbsp; &nbsp; /i-data/md0/admin/MyRepo/ Local</div><div>&nbsp; &nbsp; &nbsp; &nbsp; End of block</div><div>9 start: 09:25:24</div><div>8 start: 09:25:24</div><div>8: FetchZYPKG_INFO /i-data/md0/admin/MyRepo/ 8 Local</div><div>9: FetchZYPKG_INFO http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ 9 Mijzelf</div><div>8: FindApp curl found /usr/bin/curl</div><div>9: FindApp curl found /usr/bin/curl</div><div>8: Fetch /i-data/md0/admin/MyRepo/ZYPKG_INFO.tgz /i-data/md0/admin/zy-pkgs/MetaRepository/_i-data_md0_admin_MyRepo_.tmp failed</div><div>8: Fetch /i-data/md0/admin/MyRepo/ZYPKGS /i-data/md0/admin/zy-pkgs/MetaRepository/_i-data_md0_admin_MyRepo_.tmp failed</div><div>8: Failed</div><div>8 stop: 09:25:25</div><div>9: Fetch http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ZYPKG_INFO.tgz /i-data/md0/admin/zy-pkgs/MetaRepository/http___zyxel.diskstation.eu_Users_Mijzelf_zypkg-repo_fw4_.tmp failed</div><div>9: Fetch http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ZYPKGS /i-data/md0/admin/zy-pkgs/MetaRepository/http___zyxel.diskstation.eu_Users_Mijzelf_zypkg-repo_fw4_.tmp succeeded</div><div>9: sh: -f: unknown operand</div><div>9 stop: 09:25:29</div><div>Pushlist...</div><div>ReadConfig Pushlist</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Start of block</div><div>&nbsp; &nbsp; &nbsp; &nbsp; End of block</div><div>Blacklist...</div><div>ReadConfig Blacklist</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Start of block</div><div>&nbsp; &nbsp; &nbsp; &nbsp; End of block</div><div>Sort...</div><div>Choose packages...</div><div>Choose DEPS...</div><div>Create ZYPKG_INFO.tgz</div><div>TarHeader</div><div>FindApp curl found /usr/bin/curl</div><div>Fetch /i-data/md0/admin/zy-pkgs/MetaRepository/NSA320S/4.70/zypkg/ZYPKG_INFO.tgz - succeeded</div>

    In the admin panel nothing changed: it remains empty after some spinning.

    As always, I really appreciate your help!
  • Norbi
    Norbi Posts: 18  Freshman Member
    First Anniversary 10 Comments
    Options
    File content change to html, so again:

    HandleZYPKG_INFO /NSA320S/4.70/zypkg
    FindApp md5sum found /sbin/md5sum
    ReadConfig Repositories
            Start of block
            http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ Mijzelf
            /i-data/md0/admin/MyRepo/ Local
            End of block
    9 start: 09:25:24
    8 start: 09:25:24
    8: FetchZYPKG_INFO /i-data/md0/admin/MyRepo/ 8 Local
    9: FetchZYPKG_INFO http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ 9 Mijzelf
    8: FindApp curl found /usr/bin/curl
    9: FindApp curl found /usr/bin/curl
    8: Fetch /i-data/md0/admin/MyRepo/ZYPKG_INFO.tgz /i-data/md0/admin/zy-pkgs/MetaRepository/_i-data_md0_admin_MyRepo_.tmp failed
    8: Fetch /i-data/md0/admin/MyRepo/ZYPKGS /i-data/md0/admin/zy-pkgs/MetaRepository/_i-data_md0_admin_MyRepo_.tmp failed
    8: Failed
    8 stop: 09:25:25
    9: Fetch http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ZYPKG_INFO.tgz /i-data/md0/admin/zy-pkgs/MetaRepository/http___zyxel.diskstation.eu_Users_Mijzelf_zypkg-repo_fw4_.tmp failed
    9: Fetch http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw4/ZYPKGS /i-data/md0/admin/zy-pkgs/MetaRepository/http___zyxel.diskstation.eu_Users_Mijzelf_zypkg-repo_fw4_.tmp succeeded
    9: sh: -f: unknown operand
    9 stop: 09:25:29
    Pushlist...
    ReadConfig Pushlist
            Start of block
            End of block
    Blacklist...
    ReadConfig Blacklist
            Start of block
            End of block
    Sort...
    Choose packages...
    Choose DEPS...
    Create ZYPKG_INFO.tgz
    TarHeader
    FindApp curl found /usr/bin/curl
    Fetch /i-data/md0/admin/zy-pkgs/MetaRepository/NSA320S/4.70/zypkg/ZYPKG_INFO.tgz - succeeded
    
    <br>

  • Mijzelf
    Mijzelf Posts: 2,605  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    How can I add the mirror you mentioned to my MetaRepository?

    Good question. Normally you do that in the webinterface. As MetaRepository is running, maybe it's webinterface also works:

    http://${address}/${revision}/adv,/pkg/MetaRepository/

    To find the revision you have to look at the url when you have logged in on the webinterface. If it isn't visible in the address bar of your browser, copy the url and paste in in notepad, or something like that.
    When the webinterface doesn't work, you'll have to use the Telnet backdoor, (or ffp telnet or ssh) and edit the configuration file /usr/local/zy-pkgs/etc/MetaRepository.conf. You have RandomTools installed, so probably you can use nano for that. If that doesn't work you have only vi (or one of the ffp editors). Vi is a nasty editor, but it gets it's job done. Google for instructions.

Consumer Product Help Center