NAS326 - MetaRepository: Download List Fail

Options
Hello all

I keep getting the "Download list fail" message when I try to Retrive the app list from the internet. I even tried to unistall and freshly reinstall the Metarepository.
Here are the configuration and log files

/i-data/1e45b118/admin/zy-pkgs/MetaRepository/zypkg.log
Request: /i-data/sysvol/admin/zy-pkgs/MetaRepository/NAS326/zypkg/5.21/ZYPKG_INFO.tgz
/i-data/1e45b118/.PKG/MetaRepository/gui/MetaRepository/pkgcgi.cgi: line 646: dirname: Argument list too long
TarHeader
cat: write error: Broken pipe
/i-data/1e45b118/.PKG/MetaRepository/gui/MetaRepository/pkgcgi.cgi: line 646: echo: Argument list too long
failed


/i-data/1e45b118/admin/zy-pkgs/MetaRepository/ZYPKG_INFO.tgz.log
HandleZYPKG_INFO /NAS326/zypkg/5.21
FindApp md5sum found /sbin/md5sum
ReadConfig Repositories
Start of block
/i-data/sysvol/admin/zy-pkgs/MetaRepository Local
End of block
7 start: 14:02:17
8 start: 14:02:17
9 start: 14:02:17
7: FetchZYPKG_INFO /i-data/sysvol/admin/zy-pkgs/MetaRepository/ 7 Local
9: FetchZYPKG_INFO ftp://ftp2.zyxel.com/NAS326/zypkg/5.21/ 9 ZyXEL
7: FindApp curl found /usr/bin/curl
8: FindApp curl found /usr/bin/curl
9: FindApp curl found /usr/bin/curl
7: Fetch /i-data/sysvol/admin/zy-pkgs/MetaRepository/ZYPKG_INFO.tgz /i-data/sysvol/admin/zy-pkgs/MetaRepository/_i-data_sysvol_admin_zy-pkgs_MetaRepository_.tmp failed
7: Fetch /i-data/sysvol/admin/zy-pkgs/MetaRepository/ZYPKGS /i-data/sysvol/admin/zy-pkgs/MetaRepository/_i-data_sysvol_admin_zy-pkgs_MetaRepository_.tmp failed
7: Failed
7 stop: 14:02:19
9: Fetch ftp://ftp2.zyxel.com/NAS326/zypkg/5.21/ZYPKG_INFO.tgz /i-data/sysvol/admin/zy-pkgs/MetaRepository/ftp___ftp2.zyxel.com_NAS326_zypkg_5.21_.tmp succeeded
9 stop: 14:02:22
8: Fetch http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw5/ZYPKG_INFO.tgz /i-data/sysvol/admin/zy-pkgs/MetaRepository/http___zyxel.diskstation.eu_Users_Mijzelf_zypkg-repo_fw5_.tmp failed
8: Fetch http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/fw5/ZYPKGS /i-data/sysvol/admin/zy-pkgs/MetaRepository/http___zyxel.diskstation.eu_Users_Mijzelf_zypkg-repo_fw5_.tmp failed
8: Failed
8 stop: 14:02:47
Pushlist...
ReadConfig Pushlist
Start of block
End of block
Blacklist...
ReadConfig Blacklist
Start of block
YouNameIt
End of block
/bin/sed -i s/^YouNameIt/#YouNameIt/I /i-data/sysvol/admin/zy-pkgs/MetaRepository/NAS326/zypkg/5.21/List.14083
Sort...
Choose packages...
Choose DEPS...
Choose SUPPKG...
Create ZYPKG_INFO.tgz
TarHeader
FindApp curl found /usr/bin/curl
Fetch /i-data/sysvol/admin/zy-pkgs/MetaRepository/NAS326/zypkg/5.21/ZYPKG_INFO.tgz - cat: write error: Broken pipe
failed

/i-data/1e45b118/admin/zy-pkgs/web_prefix
http://localhost:59999/

/i-data/1e45b118/.PKG/MetaRepository/gui/MetaRepository/pkgcgi.cgi
RELDIR=` dirname $0 `
CONFIG=/i-data/1e45b118/.PKG/MetaRepository/etc/MetaRepository.conf
. ${CONFIG}

FindApp()
{
case $1 in
curl)
[ ! -z "$CURL" ] && echo $CURL && return
;;
wget)
[ ! -z "$WGET" ] && echo $WGET && return
;;
md5sum)
[ ! -z "$MD5SUM" ] && echo $MD5SUM && return
;;
esac
echo -n "FindApp $@ " >&2
unset app
for path in /bin/ /sbin/ /usr/bin/ /usr/sbin/ /usr/local/bin/ /usr/local/sbin/ /opt/bin/ /opt/sbin/ /ffp/bin/ /ffp/sbin/
do
[ -x ${path}$1 ] && echo found ${path}$1 >&2 && app=${path}$1 && break
done

[ -z $app ] && echo Failed! >&2 && exit 1
case $1 in
curl)
CURL=$app
;;
wget)
WGET=$app
;;
md5sum)
MD5SUM=$app
;;
esac
echo $app
}

Fetch()
{
from=$1
to=$2
if [ "$NOCURL" != "true" ]
then
    [ -z "$CURL" ] && CURL=` FindApp curl `
    [ -z "$CURL" ] && NOCURL=true
fi
[ "$NOCURL" = "true" ] && [ -z "$WGET" ] && WGET=` FindApp wget `
echo -n "Fetch $@ " >&2
case ${from} in
local res=0
if [ "$NOCURL" != "true" ] ; then
    local flags="-f"
    [ "$to" = "-" ] && $CURL $flags $from 2>/dev/null || $CURL $flags $from 2>/dev/null >$to
    res=$?
else
    $WGET -t 3 -q $from -O $to
    res=$?
fi
[ $res -eq 0 ] && echo succeeded >&2 && return $res
echo failed >&2 
return $res
;;
local res=0
if [ "$NOCURL" != "true" ] ; then
    local flags="-f --insecure"
    [ "$to" = "-" ] && $CURL $flags $from 2>/dev/null || $CURL $flags $from 2>/dev/null >$to
    res=$?
else
    $WGET -t 3 -q $from -O $to --no-check-certificate # Yeah, I know this sucks
    res=$?
fi
[ $res -eq 0 ] && echo succeeded >&2 && return $res
echo failed >&2 
return $res
;;
local res=0
if [ "$NOCURL" != "true" ] ; then
    local flags="-f"
    [ "$to" = "-" ] && $CURL $flags $from 2>/dev/null || $CURL $flags $from 2>/dev/null >$to
    res=$?
else
    local pasv="--passive-ftp"
    [ "$NOPASV" = "true" ] && pasv="" || echo -n "using PASV " >&2
    $WGET -t 3 -q $pasv $from -O $to
    res=$?
fi
[ $res -eq 0 ] && echo succeeded >&2 && return $res
echo failed >&2 
return $res
;;
esac
if [ "$to" = "-" ] ; then
[ -f $from ] && cat $from && echo succeeded >&2 && return 0
echo failed >&2
return 1
fi
[ -f $from ] && cp $from $to && echo succeeded >&2 && return 0
echo failed >&2
return 1
}

URLtoFilename()
{
echo $1 | sed 's|[/|:]|_|g'
}

StripLeadingAndTrailingSpaces()
{
[ -z "$1" ] && return
echo "$@"
}

RemoveComments()
{
    echo "$@" | sed 's/#.*$//'
}

ReadConfig()
{
echo ReadConfig $@ >&2
local field=$1
local comments=0
[ "${field}" = "Comments" ] && comments=1 && field=$2 
local myfield=0
while read line
do
line=` StripLeadingAndTrailingSpaces "$line" `
[ $comments -eq 0 ] && line=` RemoveComments "$line" `
[ "$line" = "" ] && continue
case "${line}" in
\[${field}]*)
echo -e "\tStart of block" >&2
myfield=1
continue
;;
\[*)
[ $myfield -eq 1 ] && echo -e "\tEnd of block" >&2 && return
;;
esac
[ $myfield -eq 1 ] && echo "$line" && echo -e "\t$line" >&2
done <${CONFIG}
}

HtmlHeader()
{
echo Content-type: text/html
echo 
}

TarHeader()
{
echo TarHeader >&2
        cat >&1 <<__EOF__
HTTP/1.0 200 OK
Cache-Control: private
Server: bash/2.0
Connection: Close
Content-type: application/gzip

__EOF__
}

NotFound()
{
echo NotFound $1 >&2
cat >&1 <<__EOF__
HTTP/1.0 404 Not found
Content-type: text/html

<html>
<head><title>404 Not Found</title></head>
<body>$1 Not Found</body>
</html>
__EOF__
}


ZYPKG_INFO_tgz()
{
exec 2>${SCRATCH}/ZYPKG_INFO.tgz.log

. ${RELDIR}/ZYPKG_INFO.sh

HandleZYPKG_INFO "$1"

local target="${SCRATCH}$1/ZYPKG_INFO.tgz"
[ ! -f "${target}" ] && NotFound && exit 0

TarHeader
Fetch "${target}" -
}

PKG_INFO_tgz()
{
exec 2>${SCRATCH}/PKG_INFO.tgz.log

. ${RELDIR}/ZYPKG_INFO.sh

HandlePKG_INFO "$1"

local target="${SCRATCH}$1/PKG_INFO.tgz"
[ ! -f "${target}" ] && NotFound && exit 0

TarHeader
Fetch "${target}" -
}


Index()
{
. ${RELDIR}/index.sh
Index_html
}

Main()
{
exec 2>/dev/null
echo "$0 $@" >&2
printenv >&2
echo "==========" >&2 

[ -z REQUEST_URI ] && NotFound && exit 0

Index
}

InvokeEngine()
{
local path=` dirname $1 `
local file=` basename $1 `

[ "$file" = "ZYPKG_INFO.tgz" ] && ZYPKG_INFO_tgz "$path" && exit 0 
[ "$file" = "PKG_INFO.tgz" ] && PKG_INFO_tgz "$path" && exit 0 
local target="${SCRATCH}${1}"
exec 2>${SCRATCH}/zypkg.log
echo Request: $target >&2
[ ! -f "${target}" ] && NotFound ${target} && exit 0

local url=` cat ${target} `

dirname ${url} > /tmp/.MetaRepository/tmp/lasturl

TarHeader
Fetch ${url} -
exit 0
}

ParseInput()
{
[ -f /tmp/MetaRepository.log ] && exec 2>>/tmp/MetaRepository.log
        local request=""

        while read line
        do
                [ " " ">" "$line" ] && [ "$request" != "" ] && InvokeEngine $request

                if echo $line | grep GET | grep HTTP >/dev/null
                then
                        request=` echo $line | awk '{print $2}' `
                        # let's do *some* security
                        request=` echo $request | sed 's|/../|/|g' `
                fi
        done

        cat >&1 <<__EOF__
HTTP/1.0 400 Bad request

__EOF__
exit 0
}

[ "$1" = "inetd-server" ] && ParseInput

[ -f /tmp/MetaRepository.log ] && echo "` date `: $0 $@ ${REQUEST_URI}" >>/tmp/MetaRepository.log

Main

/i-data/1e45b118/admin/zy-pkgs/MetaRepository file list
drwxrwxrwx 2 nobody nobody  4096 Nov 23 14:02 Installed
-rw-rw-rw- 1 nobody nobody    33 Nov 23 13:59 Installed.520.md5
-rw-rw-rw- 1 nobody nobody   694 Nov 23 14:02 Installed.list
-rw-rw-rw- 1 nobody nobody    10 Nov 23 14:02 Installed.name
-rw-rw-rw- 1 nobody nobody    25 Nov 23 14:02 Installed.url
drwxrwxrwx 3 nobody nobody  4096 Nov 22 18:25 NAS326
-rw-rw-rw- 1 nobody nobody  2094 Nov 23 14:02 ZYPKG_INFO.tgz.log
-rw-rw-rw- 1 nobody nobody    47 Nov 23 12:26 _i-data_1e45b118_admin_zy-pkgs_MetaRepository_.url
-rw-rw-rw- 1 nobody nobody    29 Nov 22 18:30 _i-data_sysvol_admin_MyRepo_.url
-rw-rw-rw- 1 nobody nobody    45 Nov 23 14:02 _i-data_sysvol_admin_zy-pkgs_MetaRepository_.url
-rw-r--r-- 1 root   root   15086 May  2  2020 favicon.ico
drwxrwxrwx 3 nobody nobody  4096 Nov 23 13:59 ftp___ftp2.zyxel.com_NAS326_zypkg_5.21_
-rw-rw-rw- 1 nobody nobody    33 Nov 23 13:59 ftp___ftp2.zyxel.com_NAS326_zypkg_5.21_.520.md5
-rw-rw-rw- 1 nobody nobody  1354 Nov 23 13:59 ftp___ftp2.zyxel.com_NAS326_zypkg_5.21_.list
-rw-rw-rw- 1 nobody nobody    40 Nov 23 14:02 ftp___ftp2.zyxel.com_NAS326_zypkg_5.21_.url
drwxrwxrwx 3 nobody nobody  4096 Nov 23 13:59 http___zyxel.diskstation.eu_Users_Mijzelf_zypkg-repo_fw5_
-rw-rw-rw- 1 nobody nobody     0 Nov 23 14:02 http___zyxel.diskstation.eu_Users_Mijzelf_zypkg-repo_fw5_.tmp
-rw-rw-rw- 1 nobody nobody    58 Nov 23 14:02 http___zyxel.diskstation.eu_Users_Mijzelf_zypkg-repo_fw5_.url
-rw-rw-rw- 1 nobody nobody   350 Nov 23 14:02 zypkg.log

Accepted Solution

  • Mijzelf
    Mijzelf Posts: 2,639  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    That error looks mysterious, and don't see the cause directly. You reinstalled MetaRepository, but I can't remember if that will purge the database. You can delete the contents of \\<NAS>\admin\zy-pkgs\MetaRepository to reset the database, to see if that helps.
    BTW, zyxel.diskstation.eu is a bit flaky last months, you can exchange that with metarepository.tk, which is the 'actual' server, zyxel.diskstation.eu is only a CNAME forwarder.


All Replies

  • Mijzelf
    Mijzelf Posts: 2,639  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    That error looks mysterious, and don't see the cause directly. You reinstalled MetaRepository, but I can't remember if that will purge the database. You can delete the contents of \\<NAS>\admin\zy-pkgs\MetaRepository to reset the database, to see if that helps.
    BTW, zyxel.diskstation.eu is a bit flaky last months, you can exchange that with metarepository.tk, which is the 'actual' server, zyxel.diskstation.eu is only a CNAME forwarder.


  • andisaraci
    Options
    Thank you very much Mijzelf. Will do and let you know
    By the way, it seemms that the software list is updated correctly every now and then, roughly one time every four or five
  • Mijzelf
    Mijzelf Posts: 2,639  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    Yes, there is some cronjob in the firmware which checks for new packages regularly. Can't remember the interval, but that could be 4 hours.

Consumer Product Help Center