Jump to content


Photo

Setup/Software Update leads to crash/hang

Solo2

  • Please log in to reply
61 replies to this topic

Re: Setup/Software Update leads to crash/hang #41 littlesat

  • PLi® Core member
  • 57,133 posts

+698
Excellent

Posted 27 December 2023 - 17:49

Here I get a timestamp.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Setup/Software Update leads to crash/hang #42 dudule22

  • Senior Member
  • 325 posts

+4
Neutral

Posted 28 December 2023 - 09:17

I am not sure that is is the good topic, but i have some troubles on DUO4K and a friend DUO4K SE.

After, a reboot there is a black screen and the the solution is to disconnect the power. Switch on and off, is not enought.

It is not all the time.

It happends on openpli 8.3 and openpli 9 (last releases)



Re: Setup/Software Update leads to crash/hang #43 Dimitrij

  • PLi® Core member
  • 10,307 posts

+348
Excellent

Posted 28 December 2023 - 11:27

Here I get a timestamp.

Not.

[UpdatePlugin] Trying to fetch time from http://downloads.openpli.org/feeds/openpli-develop/gbquad4k
[UpdatePlugin] Error in get timestamp an integer is required (got type str)
[UpdatePlugin] Trying to fetch time from http://downloads.openpli.org/feeds/openpli-develop/cortexa15hf-neon-vfpv4
[UpdatePlugin] Error in get timestamp an integer is required (got type str)
[UpdatePlugin] Trying to fetch time from http://downloads.openpli.org/feeds/openpli-develop/all
[UpdatePlugin] Error in get timestamp an integer is required (got type str)

Need this

If telnet python work:

>>> modified = datetime.strptime(urlopen("%s/Packages.gz" % url, timeout=1).info().get('Last-Modified'), '%a, %d %b %Y %H:%M:%S GMT')
>>> strftime("%Y-%m-%d %H:%M:%S", gmtime(datetime.timestamp(modified) - altzone))
'2023-12-27 20:57:28'

byt SoftwareUpdate.py not work

			try:
				print('[UpdatePlugin] Trying to fetch time from %s' % url)
				modified = datetime.strptime(urlopen("%s/Packages.gz" % url, timeout=1).info().get('Last-Modified'), '%a, %d %b %Y %H:%M:%S GMT')
				return strftime("%Y-%m-%d %H:%M:%S", gmtime(datetime.timestamp(modified) - altzone))
			except Exception as er:
				print('[UpdatePlugin] Error in get timestamp', er)

 

[UpdatePlugin] Trying to fetch time from http://downloads.openpli.org/feeds/openpli-develop/gbquad4k
[UpdatePlugin] Error in get timestamp time data 'Wed, 27 Dec 2023 19:26:56 GMT' does not match format '%a, %d %b %Y %H:%M:%S GMT'
[UpdatePlugin] Trying to fetch time from http://downloads.openpli.org/feeds/openpli-develop/cortexa15hf-neon-vfpv4
[UpdatePlugin] Error in get timestamp time data 'Wed, 27 Dec 2023 19:57:35 GMT' does not match format '%a, %d %b %Y %H:%M:%S GMT'
[UpdatePlugin] Trying to fetch time from http://downloads.openpli.org/feeds/openpli-develop/all
[UpdatePlugin] Error in get timestamp time data 'Wed, 27 Dec 2023 19:57:28 GMT' does not match format '%a, %d %b %Y %H:%M:%S GMT'

 

 

 


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: Setup/Software Update leads to crash/hang #44 littlesat

  • PLi® Core member
  • 57,133 posts

+698
Excellent

Posted 28 December 2023 - 12:16

Weird I could not verify this, but I can also not check today


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Setup/Software Update leads to crash/hang #45 WanWizard

  • PLi® Core member
  • 70,446 posts

+1,809
Excellent

Posted 28 December 2023 - 17:45

Chances are this is a problem with complex oneliners and lack of return value checking again.

 

Split the line into its pieces and do proper retuvn value checking. For example, you could get that because of the 1 second timeout,.in which case info() doesn't return any headers.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Setup/Software Update leads to crash/hang #46 littlesat

  • PLi® Core member
  • 57,133 posts

+698
Excellent

Posted 28 December 2023 - 19:01

Maybe I can check tomorrow or Saturday please be patience. When this was not perfect since python 3 then we need not to speed it up.
At the last commit I get a value with the date which I tripple checked and it was a string with the expected format. So no idea why it fails. The example above does not look like my code.

Edited by littlesat, 28 December 2023 - 19:33.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Setup/Software Update leads to crash/hang #47 Dimitrij

  • PLi® Core member
  • 10,307 posts

+348
Excellent

Posted 29 December 2023 - 10:43

	def getLatestImageTimestamp(self):
		def gettime(url):
			try:
				print('[UpdatePlugin] Trying to fetch time from %s' % url)
				#return strftime("%Y-%m-%d %H:%M:%S", gmtime(timegm(urlopen("%s/Packages.gz" % url, timeout=1).info().get('Last-Modified')) - altzone))
				data = urlopen("%s/Packages.gz" % url, timeout=3).info().get('Last-Modified')
				print(data)
				time_gm = timegm(data)
				return strftime("%Y-%m-%d %H:%M:%S", gmtime(time_gm - altzone))
			except Exception as er:
				print('[UpdatePlugin] Error in get timestamp', er)
				return ""
		return sorted([gettime(open("/etc/opkg/%s" % file, "r").readlines()[0].split()[2]) for file in listdir("/etc/opkg") if not file.startswith("3rd-party") and file not in ("arch.conf", "opkg.conf", "picons-feed.conf")], reverse=True)[0]

RU locale

[UpdatePlugin] Trying to fetch time from http://downloads.openpli.org/feeds/openpli-develop/gbquad4k
Thu, 28 Dec 2023 22:53:38 GMT
[UpdatePlugin] Error in get timestamp an integer is required (got type str)
[UpdatePlugin] Trying to fetch time from http://downloads.openpli.org/feeds/openpli-develop/cortexa15hf-neon-vfpv4
Thu, 28 Dec 2023 23:24:24 GMT
[UpdatePlugin] Error in get timestamp an integer is required (got type str)
[UpdatePlugin] Trying to fetch time from http://downloads.openpli.org/feeds/openpli-develop/all
Thu, 28 Dec 2023 23:24:12 GMT
[UpdatePlugin] Error in get timestamp an integer is required (got type str)

 


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: Setup/Software Update leads to crash/hang #48 littlesat

  • PLi® Core member
  • 57,133 posts

+698
Excellent

Posted 29 December 2023 - 11:46

There is something extreme strange playing here... when I try this via console it is working fine, But when I do the same in enigma2 then it tells me the string is not in line with the format.

from datetime import datetime
from urllib.request import urlopen
 
url = 'http://downloads.openpli.org/feeds/openpli-develop/all'
time = urlopen("%s/Packages.gz" % url, timeout=1).info().get('Last-Modified')
print(time)
 
out = datetime.strptime(time , '%a, %d %b %Y %H:%M:%S GMT')
print(out)

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Setup/Software Update leads to crash/hang #49 littlesat

  • PLi® Core member
  • 57,133 posts

+698
Excellent

Posted 29 December 2023 - 11:48

                                def gettime(url):
                                                try:
                                                                print('[UpdatePlugin] Trying to fetch time from %s' % url)
                                                               
                                                               
                                                                time = urlopen("%s/Packages.gz" % url, timeout=1).info().get('Last-Modified')
                                                                #time = "Maa, 24 Jan 2024 10:10:23 GMT"
                                                                print('     >     ', time)
                                                                out = datetime.strptime(time , '%a, %d %b %Y %H:%M:%S GMT')
                                                                print('     >     ', time)
                                                                time = gmtime(time - altzone)
                                                                print('     >     ', time)
                                                                time = strftime("%Y-%m-%d %H:%M:%S", time)
                                                                print('     >     ', time)
                                                                return time
                                                except Exception as er:
                                                                print('[UpdatePlugin] Error in get timestamp', er)
                                                                return ""
                                print('    >    ', sorted([gettime(open("/etc/opkg/%s" % file, "r").readlines()[0].split()[2]) for file in listdir("/etc/opkg") if not file.startswith("3rd-party") and file not in ("arch.conf", "opkg.conf", "picons-feed.conf")], reverse=True)) 
                                return sorted([gettime(open("/etc/opkg/%s" % file, "r").readlines()[0].split()[2]) for file in listdir("/etc/opkg") if not file.startswith("3rd-party") and file not in ("arch.conf", "opkg.conf", "picons-feed.conf")], reverse=True)[0]

Edited by littlesat, 29 December 2023 - 11:49.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Setup/Software Update leads to crash/hang #50 Dimitrij

  • PLi® Core member
  • 10,307 posts

+348
Excellent

Posted 29 December 2023 - 11:55

 

There is something extreme strange playing here... when I try this via console it is working fine, But when I do the same in enigma2 then it tells me the string is not in line with the format.

Same problem here https://forums.openp...dpost&p=1593772

Maybe problem in locale?


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: Setup/Software Update leads to crash/hang #51 littlesat

  • PLi® Core member
  • 57,133 posts

+698
Excellent

Posted 29 December 2023 - 12:05

I'm afraid indeed the translations are involved here....  The 'website' is in English...


Edited by littlesat, 29 December 2023 - 12:05.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Setup/Software Update leads to crash/hang #52 littlesat

  • PLi® Core member
  • 57,133 posts

+698
Excellent

Posted 29 December 2023 - 12:11

We miss the getdate() now that was not language depended!!! Issue found, but no solution yet.


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Setup/Software Update leads to crash/hang #53 Dimitrij

  • PLi® Core member
  • 10,307 posts

+348
Excellent

Posted 29 December 2023 - 15:23

We miss the getdate() now that was not language depended!!! Issue found, but no solution yet.

solution,but output only english,e.g. "Maa, 24 Jan 2024 10:10:23 GMT"

return urlopen("%s/Packages.gz" % url, timeout=2).info().get('Last-Modified')

 


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: Setup/Software Update leads to crash/hang #54 littlesat

  • PLi® Core member
  • 57,133 posts

+698
Excellent

Posted 29 December 2023 - 16:15

I tried to force Dutch here in the string. And your suggestion does not work as then you order on weekday name.

Edited by littlesat, 29 December 2023 - 16:17.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Setup/Software Update leads to crash/hang #55 WanWizard

  • PLi® Core member
  • 70,446 posts

+1,809
Excellent

Posted 29 December 2023 - 17:05

I'm afraid indeed the translations are involved here....  The 'website' is in English...

 

The HTTP standard describes timestamps in a response header in that format (RFC 822 / RFC 1123). Not related to "the website" as such.

 

If you are using datetime, which is locale aware, you can switch to en_US before parsing the timestamp:

locale.setlocale(locale.LC_TIME, 'en_US')

but it is suggested not to do that, as it is not thread safe (it also changes the locale in running threads).

 

It is better to use

>>> from email.utils import parsedate_to_datetime
>>> x = "Mon, 24 Jan 2024 10:10:23 GMT"
>>> parsedate_to_datetime(x)
datetime.datetime(2024, 1, 24, 10, 10, 23, tzinfo=datetime.timezone.utc)
>>> int(parsedate_to_datetime(x).timestamp())
1706091023

and continue from there.
 


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Setup/Software Update leads to crash/hang #56 Dimitrij

  • PLi® Core member
  • 10,307 posts

+348
Excellent

Posted 29 December 2023 - 17:54

	def getLatestImageTimestamp(self):
		def gettime(url):
			try:
				print('[UpdatePlugin] Trying to fetch time from %s' % url)
				from locale import setlocale
				locale.setlocale(locale.LC_TIME, 'en_US')
				modified = datetime.strptime(urlopen("%s/Packages.gz" % url, timeout=2).info().get('Last-Modified'), '%a, %d %b %Y %H:%M:%S GMT')
				return strftime("%Y-%m-%d %H:%M:%S", gmtime(datetime.timestamp(modified) - altzone))
			except Exception as er:
				print('[UpdatePlugin] Error in get timestamp', er)
				return ""
		return sorted([gettime(open("/etc/opkg/%s" % file, "r").readlines()[0].split()[2]) for file in listdir("/etc/opkg") if not file.startswith("3rd-party") and file not in ("arch.conf", "opkg.conf", "picons-feed.conf")], reverse=True)[0]

Edited by Dimitrij, 29 December 2023 - 17:55.

GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: Setup/Software Update leads to crash/hang #57 WanWizard

  • PLi® Core member
  • 70,446 posts

+1,809
Excellent

Posted 29 December 2023 - 19:37

Two issues with this:

  • you shouldn't use setlocale as it is not thread-safe
  • you've now changed the locale on your box to US English permanently

Instead, use

	def getLatestImageTimestamp(self):
		def gettime(url):
			try:
				print('[UpdatePlugin] Trying to fetch time from %s' % url)
				from email.utils import parsedate_to_datetime
				modified = int(parsedate_to_datetime(urlopen("%s/Packages.gz" % url, timeout=2).info().get('Last-Modified')).timestamp())
				return strftime("%Y-%m-%d %H:%M:%S", gmtime(modified - altzone))
			except Exception as er:
				print('[UpdatePlugin] Error in get timestamp', er)
				return ""
		return sorted([gettime(open("/etc/opkg/%s" % file, "r").readlines()[0].split()[2]) for file in listdir("/etc/opkg") if not file.startswith("3rd-party") and file not in ("arch.conf", "opkg.conf", "picons-feed.conf")], reverse=True)[0]

 


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Setup/Software Update leads to crash/hang #58 littlesat

  • PLi® Core member
  • 57,133 posts

+698
Excellent

Posted 29 December 2023 - 19:46

locale.setlocale(locale.LC_TIME, 'en_US') does not work.... locale.setlocale(locale.LC_TIME, 'en_EN.utf8') does work... I just push something.... As far I can see this is working... But I do not like it at all... as it is indeed not thread safe... but I set the language back.

Since getdate(...) is not there anymore in urllib I do not find a real solution to get this done.... So I tried to resolve it but I also have to sleep on it.

Google wasn't also not helpfull...
 


Edited by littlesat, 29 December 2023 - 19:47.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Setup/Software Update leads to crash/hang #59 WanWizard

  • PLi® Core member
  • 70,446 posts

+1,809
Excellent

Posted 29 December 2023 - 19:50

On the box en_US works, "en_EN.utf8" looks like a PC distro.

 

But I suggest you take what I posted instead, as it has no locale issues.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Setup/Software Update leads to crash/hang #60 VeryClear

  • Member
  • 22 posts

0
Neutral

Posted 28 February 2024 - 19:27

Looks like this was fixed? It's been a while since I've seen the problem.





Also tagged with one or more of these keywords: Solo2

4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users