Page 1 of 1

Downloader and Update_all Fail

Posted: Sun Nov 20, 2022 9:22 pm
by rcc

Hello there.

Trying to run download.sh and update_all.sh, but both fails with different errors.

Downloader.sh error:
ImportError: No module named '_ssl'

Update_all.sh error:
start_time: float = 0.0
SyntaxError: invalid syntax

I have just copied the latest downloader.sh and update_all.sh from github, so it's not likely that I have outdated scripts.

Has anyone gone through either of these errors and can help me ?


Re: Downloader and Update_all Fail

Posted: Sun Nov 20, 2022 10:59 pm
by FPGA64
You have downloaded the scripts as HTML. You must always use raw to download from Github

Re: Downloader and Update_all Fail

Posted: Sun Nov 20, 2022 11:05 pm
by Malor
Did you paste the files into Notepad and then save it onto the SD? Windows uses a carriage return/line feed at the end of a line, where Unix expects only a line feed. I think you'd see symptoms like that with that problem.

If you know how to use Secure Shell, turning that in in your Mister, connecting, changing directory to /media/fat/Scripts, and using wget to download the script is potentially the easiest way to handle it. You can also use F9 command-line mode, but you can't copy and paste there, you have to type the whole URL.

(edit: read the next paragraph first, this is harder than just saving from the browser.) If that sounds complex, using a different text editor that respects Unix encoding should fix the problem. Notepad++ is very likely to work, but I haven't used it in such a long time that I'm not sure how to tell it to use Unix text mode.

edit: and, yes, as FPGA64 says, on Github, you have to drill all the way down to raw text mode. Once you have the raw file displayed (there's no formatting, just plain text), you can then save the file from the browser directly into the Scripts directory.

That should also work correctly, and you can avoid the whole copy/paste/Notepad++ thing.

Re: Downloader and Update_all Fail

Posted: Mon Nov 21, 2022 4:55 am
by aberu
https://github.com/theypsilon/Update_Al ... ate_all.sh

https://github.com/MiSTer-devel/Downloa ... nloader.sh

Right click these links and download that way. Then transfer that to the scripts folder on the MiSTer's MicroSD.

Re: Downloader and Update_all Fail

Posted: Mon Nov 21, 2022 11:01 am
by rcc
I used wget directly from Mister, also tried downloading from my PC and scp to Mister.
All same results.

I can confirm that I downloaded the actual scripts, not the html page.

I copied this straight from Mister command line:
/media/fat/Scripts# ./update_all.sh
Launching Update All

Traceback (most recent call last):
File "/home/user/work/fpga/DE10/buildroot-2017.02/output/target/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
File "/home/user/work/fpga/DE10/buildroot-2017.02/output/target/usr/lib/python3.5/runpy.py", line 85, in _run_code
File "/tmp/dont_download.zip/__main__.py", line 21, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/tmp/dont_download.zip/update_all/main.py", line 21, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/tmp/dont_download.zip/update_all/local_repository.py", line 19, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 954, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 896, in _find_spec
File "<frozen importlib._bootstrap_external>", line 1139, in find_spec
File "<frozen importlib._bootstrap_external>", line 1115, in _get_spec
File "<frozen importlib._bootstrap_external>", line 1096, in _legacy_get_spec
File "<frozen importlib._bootstrap>", line 444, in spec_from_loader
File "<frozen importlib._bootstrap_external>", line 533, in spec_from_file_location
File "/tmp/dont_download.zip/update_all/config.py", line 29
start_time: float = 0.0
^
SyntaxError: invalid syntax
Update All failed!

/media/fat/Scripts# more update_all
more: stat of update_all failed: No such file or directory
/media/fat/Scripts# more update_all.sh
#!/bin/bash
# Copyright (c) 2022 José Manuel Barroso Galindo <theypsilon@gmail.com>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# You can download the latest version of this tool from:
# https://github.com/theypsilon/Update_All_MiSTer

set -euo pipefail

download_file() {
local DOWNLOAD_PATH="${1}"

local DOWNLOAD_URL="${2}"
for (( COUNTER=0; COUNTER<=60; COUNTER+=1 )); do
if [ ${COUNTER} -ge 1 ] ; then
sleep 1s
fi
set +e
curl ${CURL_SSL:-} --fail --location -o "${DOWNLOAD_PATH}" "${DOWNLOAD_U
RL}" &> /dev/null
local CMD_RET=$?
set -e

case ${CMD_RET} in
0)
export CURL_SSL="${CURL_SSL:-}"
return
;;
60)
if [ -f /etc/ssl/certs/cacert.pem ] ; then
export CURL_SSL="--cacert /etc/ssl/certs/cacert.pem"
continue
fi

set +e
--More--(38%)

Re: Downloader and Update_all Fail

Posted: Mon Nov 21, 2022 11:10 am
by rcc
And this is the full output for downloader.sh (I ran it directly from MisterFPGA command line):
/media/fat/Scripts# ./downloader.sh
Running MiSTer Downloader

Traceback (most recent call last):
File "/home/user/work/fpga/DE10/buildroot-2017.02/output/target/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
File "/home/user/work/fpga/DE10/buildroot-2017.02/output/target/usr/lib/python3.5/runpy.py", line 85, in _run_code
File "/tmp/dont_download.zip/__main__.py", line 21, in <module>
File "/tmp/dont_download.zip/downloader/main.py", line 27, in <module>
File "/tmp/dont_download.zip/downloader/full_run_service_factory.py", line 22, in <module>
File "/tmp/dont_download.zip/downloader/file_downloader.py", line 21, in <module>
File "/home/user/work/fpga/DE10/buildroot-2017.02/output/target/usr/lib/python3.5/ssl.py", line 98, in <module>
ImportError: No module named '_ssl'
Downloader failed!

Re: Downloader and Update_all Fail

Posted: Mon Nov 21, 2022 11:38 am
by FPGA64
When did you last update ? The scripts now require Python 3 which was done last year in September

Re: Downloader and Update_all Fail

Posted: Mon Nov 21, 2022 11:43 am
by rcc
I don't know when I last updated.
Isn't downloader.sh supposed to do it for me when I run it?

Anyway.... I just rebuilt a fresh, small SDCard with the latest Mister image, and the downloader works fine.
S, I I will backup all my configs from my Mister SD card, rebuilt it from scratch, and copy my settings back.