Closed unity2k closed 3 years ago
I am having also the same problem. I read the workaround in issue #305 but I don't have that option in the preferences menu to switch the provider of SMRT.
Thank you.
Timeout error just mean the server did not respond. This can happen for many reason independent of the addon. See #305
@emiliovfx did you update the addon ?
Hello! Thank you for your response. I downloaded it from the Code tab. But to be honest, I am new to github. So probably I did something wrong?
And by the way, I found that NASA prevented from downloading without creating an account. I created the account and it unblocked my IP and I was able to retrieve the srtm data.
I just created an account at opentopography.org and I'm still getting the same error.
There s no need to any account
I'm also having this issue on Mac, cannot retrieve the SRTM data. I even select Marine-geo.org, but still get the same error, "Cannot reach OpenTopography web service, check logs for more infos".
Ignore my previous edits, I updated the add-on and it's working now.
Hello everyone, first thanks for all your efforts, I also suffer from the same problem, @jimmydx what did you mean by "I updated the add-on and it's working now" are you a dev and updated the addon but still didn't upload it to github, because I thought redownloading the addon and reinstalling it might help but it didn't, and it's the same version 1.0
OS: Kubuntu 20.04.1 , Blender 2.90.1 also tried it on 2.83.4 same problem hardware: Lenovo thinkstation S20, X5650, 8gb, 1050ti, HDD.
INFO:BlenderGIS-master:82:###### Starting new Blender session : 2020-11-17 19:38:59 ERROR:BlenderGIS-master:86:Uncaught exception Traceback (most recent call last): File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 1319, in do_open encode_chunked=req.has_header('Transfer-encoding')) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/http/client.py", line 1252, in request self._send_request(method, url, body, headers, encode_chunked) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/http/client.py", line 1298, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/http/client.py", line 1247, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/http/client.py", line 1026, in _send_output self.send(msg) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/http/client.py", line 966, in send self.connect() File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/http/client.py", line 938, in connect (self.host,self.port), self.timeout, self.source_address) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/socket.py", line 728, in create_connection raise err File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/socket.py", line 716, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/shaddy/.config/blender/2.90/scripts/addons/BlenderGIS-master/operators/io_get_srtm.py", line 108, in execute with urlopen(rq) as response, open(filePath, 'wb') as outFile: File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 531, in open response = meth(req, response) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 641, in http_response 'http', request, response, code, msg, hdrs) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 563, in error result = self._call_chain(args) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 503, in _call_chain result = func(args) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 755, in http_error_302 return self.parent.open(new, timeout=req.timeout) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 531, in open response = meth(req, response) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 641, in http_response 'http', request, response, code, msg, hdrs) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 563, in error result = self._call_chain(args) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 503, in _call_chain result = func(args) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 755, in http_error_302 return self.parent.open(new, timeout=req.timeout) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 531, in open response = meth(req, response) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 641, in http_response 'http', request, response, code, msg, hdrs) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 563, in error result = self._call_chain(args) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 503, in _call_chain result = func(args) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 755, in http_error_302 return self.parent.open(new, timeout=req.timeout) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 525, in open response = self._open(req, data) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 543, in _open '_open', req) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 503, in _call_chain result = func(*args) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 1347, in http_open return self.do_open(http.client.HTTPConnection, req) File "/home/shaddy/Software/Graphics/Blender/blender-2.90.1-linux64/2.90/python/lib/python3.7/urllib/request.py", line 1321, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/shaddy/.config/blender/2.90/scripts/addons/BlenderGIS-master/operators/io_get_srtm.py", line 43, in invoke File "/home/shaddy/.config/blender/2.90/scripts/addons/BlenderGIS-master/operators/io_get_srtm.py", line 112, in execute log.error('Http request fails url:{}, code:{}, error:{}'.format(url, getattr(err, 'code', None), err.reason)) AttributeError: 'URLError' object has no attribute 'code'
I'm not a developer, but yeah, I redownloaded the whole thing from GitHub since I noticed some SRTM files were updated in the past month, and then uninstalled the previous one and installed the new one. I'm running 2.90.1 on macOS Big Sur 11.0.1 and it works now.
@domlysz please consider changing version sub number with every change so we know where we are :)
yeah I'm sorry for that, very bad practice !
To add some precisions, the 2 web services for getting elevation data (opentopography and marine-geo) have recently updated their urls. The 2 updates have been done respectively in september (#382) and in november #407.
I just tried srtm on win 10 Blender 2.90.1 and worked perfect :+1: , I have some other linux distros I will try to try if the problem persists, the problem was generated on Linux Lite 4.2(ubuntu 18.04) and Kubuntu 20.04.1
I just tried yet again on 2.90.1 using Factory Settings and only BlenderGIS enabled and still, I get the error from above.
@unity2k What is your operating system? because when I switched to Win 10 from linux it worked fine, also remember that the srtm info is depending on other sites that might be down at that moment that you're trying to pull data, also make sure to download the latest version of BlenderGIS because domlysz did updates on semptember and November concerning the srtm data providers.
I'm on Windows 10 with all the latest patches and drivers. My latest download of the GIS addon is from 48 hours. Like I said earlier, if I use the "marine" url I get the SRTM data but I'd like to retrieve the 30m data from the NASA site.
I'm still curious if there's anything in the error logs I've posted that give a hint as to what's going wrong?
@Shaddy-ElDesouky The addon is mainly developed on Linux, so it should works correctly on this OS. The error you encounter is the http error 111 : Connection refused. Could happen for many reasons !
@unity2k As I said, the timeout error is a generic error raised when the server did not respond in time. But, as the server did not respond, we have no clue on what's wrong.
In both case you can first test the url reported in the addon logs in your browser to see if it works (if so, it means the problem comes from the script and not the server). Example of url : https://portal.opentopography.org/API/globaldem?demtype=SRTMGL1&west=3.387282225963948&east=3.429734374840208&south=44.357205794143916&north=44.37691349298552&outputFormat=GTiff
It took between 10 and 15 seconds before the url you supplied responded by offering me the tiff but it did resolve.
Back to Blender and I have the same error. So I went to the Console and grabbed the url that failed in Blender, brought it into my browser and it resolves. I was able to save the tiff. So why would it time out in Blender but resolve in my browser?
Thanks for the feed back, that's interesting, there is definitely something wrong with my code.
Can you try to run the script bellow in blender ? To do this, open Blender, switch the text editor (1), create a new text (2), paste the code, run it (3) and finally tell me what's is reported in the system console (menu windows > toggle console)(4)
from urllib.request import Request, urlopen
import os, ssl
if (not os.environ.get('PYTHONHTTPSVERIFY', '') and
getattr(ssl, '_create_unverified_context', None)):
ssl._create_default_https_context = ssl._create_unverified_context
url = "https://portal.opentopography.org/API/globaldem?demtype=SRTMGL1&west=3.387282225963948&east=3.429734374840208&south=44.357205794143916&north=44.37691349298552&outputFormat=GTiff"
headers = {
#'Keep-Alive': 115 ,
'Proxy-Connection' : 'keep-alive',
'User-Agent' : "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0",
'Referer' : "bgis"
}
rq = Request(url, headers=headers)
r = urlopen(rq)
print(r.code)
Traceback (most recent call last):
File "\Text", line 21, in
The same error here, so if we can fix this code snippet then the addon can be fixed.
Sound like the issue comes from the ssl setup because the timeout is related to the ssl certificate which was not sent on time.
Can you tell me what's the Python version bundle with your blender install ?
Also can you try with Blender 2.83 if it works https://download.blender.org/release/
We can try to edit the ssl part of the code to force the creation of an unverified context and see what happen
import os, ssl
#report some values in the console
print(os.environ.get('PYTHONHTTPSVERIFY', ''))
print(getattr(ssl, '_create_unverified_context', None))
#create context
ssl._create_default_https_context = ssl._create_unverified_context
I found another way to disable the ssl check by passing a custom context to the urlopen function, can you try this :
sslContext = ssl.create_default_context()
sslContext.check_hostname = False
sslContext.verify_mode = ssl.CERT_NONE
r = urlopen(rq, context=sslContext)
Hi! I just downloaded the 2.2.4 version and when I want to get SRTM this is what comes instead: Traceback (most recent call .last): File "C:\Users\Gabsia\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\operators\io_get_srtm.py", line 44, in invoke return self.execute(context)#context.window_manager.invoke_props_dialog(self) File "C:\Users\Gabsia\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\operators\io_get_srtm.py", line 76, in execute if 'SRTM' in prefs.srtmServer: AttributeError: 'BGIS_PREFS' object has no attribute 'srtmServer'
location:
I have never used this addon before, because I'm totally new in Blender. Any help will be great... Thanks
.
@GabsFig Likewise I have just ran into what seems to be the same error, however with "unknown location" at the end. Running Blender 2.90 and the 2.2.3 version, I can get the basemap data no problem but run into this issue when requesting the SRTM data.
Traceback (most recent call last): File "C:\Users\Jake\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\operators\io_get_srtm.py", line 44, in invoke return self.execute(context)#context.window_manager.invoke_props_dialog(self) File "C:\Users\Jake\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\operators\io_get_srtm.py", line 76, in execute if 'SRTM' in prefs.srtmServer: AttributeError: 'BGIS_PREFS' object has no attribute 'srtmServer'
location: (less than sign)unknown location(more than sign):-1
When requesting OSM I get a different error "Too large extent", any ideas would be appreciated 👍 Cheers
AttributeError: 'BGIS_PREFS' object has no attribute 'srtmServer'
My apologies, I've made some edits this morning, forgot to change this variable, now it's fixed, please redownload the addon.
About the 'Too large extent' error, it's just what it say, the request is limited to an area of 20x20km in order to avoid overload the OSM server.
AttributeError: 'BGIS_PREFS' object has no attribute 'srtmServer'
My apologies, I've made some edits this morning, forgot to change this variable, now it's fixed, please redownload the addon.
About the 'Too large extent' error, it's just what it say, the request is limited to an area of 20x20km in order to avoid overload the OSM server.
Amazing thanks, works like a charm 👍
Regarding your suggestions on changing code, I don't know where I'm supposed to change that?
Tried running 2.83 with the today's update of GIS and got the following error:
Edit: I also tried a slightly older version of GIS I still had on my drive, it too produces the same error as today's.
Traceback (most recent call last): File "C:\Users\unity\Downloads\Blender\blender-2.83.9-windows64\blender-2.83.9-windows64\2.83\scripts\modules\addon_utils.py", line 382, in enable mod.register() File "C:\Users\unity\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlenderGIS-master__init__.py", line 286, in register prefs.register() File "C:\Users\unity\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlenderGIS-master\prefs.py", line 830, in register bpy.utils.register_class(cls) ValueError: bpy_struct "BGIS_PREFS" registration error: predefCrs could not register
Same as before, in the Blender text editor, bellow the full code of the 2 tests
from urllib.request import Request, urlopen
import os, ssl
#report some values in the console
print(os.environ.get('PYTHONHTTPSVERIFY', ''))
print(getattr(ssl, '_create_unverified_context', None))
#create context
ssl._create_default_https_context = ssl._create_unverified_context
url = "https://portal.opentopography.org/API/globaldem?demtype=SRTMGL1&west=3.387282225963948&east=3.429734374840208&south=44.357205794143916&north=44.37691349298552&outputFormat=GTiff"
headers = {
#'Keep-Alive': 115 ,
'Proxy-Connection' : 'keep-alive',
'User-Agent' : "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0",
'Referer' : "bgis"
}
rq = Request(url, headers=headers)
r = urlopen(rq)
print(r.code)
from urllib.request import Request, urlopen
import os, ssl
url = "https://portal.opentopography.org/API/globaldem?demtype=SRTMGL1&west=3.387282225963948&east=3.429734374840208&south=44.357205794143916&north=44.37691349298552&outputFormat=GTiff"
headers = {
#'Keep-Alive': 115 ,
'Proxy-Connection' : 'keep-alive',
'User-Agent' : "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0",
'Referer' : "bgis"
}
rq = Request(url, headers=headers)
sslContext = ssl.create_default_context()
sslContext.check_hostname = False
sslContext.verify_mode = ssl.CERT_NONE
r = urlopen(rq, context=sslContext)
print(r.code)
@unity2k I've fixed the code for Blender 2.83, sorry for the setback
Error message from the first block:
<function _create_unverified_context at 0x000001F19C71FCA8>
Traceback (most recent call last):
File "\Text", line 20, in
Second Block:
Traceback (most recent call last):
File "\Text", line 17, in
Confirming that BlenderGIS is working again from my pc on Windows using 2.83.9 LTS
@domlysz It works perfecty now, thank you!!
To be clear, the most recent 2.83 fix did not fix the issue for 2.90. I've tried it on a Factory Setup with nothing else installed. So the same machine with 2 versions of Blender set up identically on Windows, 2.83 works while 2.90 does not.
Yes this error is very weird, Blender 2.83 does not use the same Python version (3.6 I think) than 2.90 (Python 3.7) and maybee the problem is related to this update.
What happen if we try to manually increase the timeout ? (code bellow) :
from urllib.request import Request, urlopen
import socket
socket.setdefaulttimeout(120)
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
url = "https://portal.opentopography.org/API/globaldem?demtype=SRTMGL1&west=3.387282225963948&east=3.429734374840208&south=44.357205794143916&north=44.37691349298552&outputFormat=GTiff"
headers = {
#'Keep-Alive': 115 ,
'Proxy-Connection' : 'keep-alive',
'User-Agent' : "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0",
'Referer' : "bgis"
}
rq = Request(url, headers=headers)
r = urlopen(rq)
print(r.code)
That returned the number 200 in the console - No Error!
that's great, finally it was so simple ! very weird however, can't find what is the defaut timeout value for a Python request. Anyway, I've made a quick update https://github.com/domlysz/BlenderGIS/commit/f6032cc10b4bc2fdc44ed0304cc7b7525592e1de, give it a try.
It works beautifully! So is this thread ready to be closed? Thanks for sticking with me as I was nearly sure it was operator error and I was missing something basic.
Thank you for the fix!
Yes we can close it. I have to admit that I didn't pay much attention to timeout errors because most of the time it's a server side error, lesson learned !
Blender 2.90.1 official release on Windows 10
Cannot retrieve SRTM data that I was able to retrieve last night. I've tried reading the error log to see if it's simply not reaching the server but can't see this as the same as your warning for submissions.
So I was having this problem with Blender 2.92 Alpha...no big surprise there. I performed a clean install of 2.90.1 along with clean config files. I've tried opening Blender as Admin, with factory defaults and only BlenderGIS enabled as an addon and I get the following message:
Traceback (most recent call last): File "C:\Users\John\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\operators\io_get_srtm.py", line 44, in invoke return self.execute(context)#context.window_manager.invoke_props_dialog(self) File "C:\Users\John\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\operators\io_get_srtm.py", line 108, in execute with urlopen(rq) as response, open(filePath, 'wb') as outFile: File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\urllib\request.py", line 222, in urlopen return opener.open(url, data, timeout) File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\urllib\request.py", line 525, in open response = self._open(req, data) File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\urllib\request.py", line 543, in _open '_open', req) File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\urllib\request.py", line 503, in _call_chain result = func(*args) File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\urllib\request.py", line 1362, in https_open context=self._context, check_hostname=self._check_hostname) File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\urllib\request.py", line 1322, in do_open r = h.getresponse() File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\http\client.py", line 1344, in getresponse response.begin() File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\http\client.py", line 306, in begin version, status, reason = self._read_status() File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\http\client.py", line 267, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\socket.py", line 589, in readinto return self._sock.recv_into(b) File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\ssl.py", line 1071, in recv_into return self.read(nbytes, buffer) File "C:\Program Files\Blender Foundation\Blender\2.90\python\lib\ssl.py", line 929, in read return self._sslobj.read(len, buffer) socket.timeout: The read operation timed out
location::-1