"Download and import texture brush pack" doesn't work with the Grease Pencil Tools Add-on #115336

Closed
opened 2023-11-24 09:22:17 +01:00 by markus.hanson · 13 comments

System Information
Operating system: Windows 10 Enterprise
Graphics card: NVIDIA GeForce RTX 3070

Blender Version
Broken: 4.0.1
Worked: 3.6 LTS (maybe 4.0)

Short description of error
Blender gives an error message that the internet connection is off, though that is false, when i click on "Download and import texture brush pack". My theory is an error due to the DDoS-attack, but don't really know.

error message is: Check your internet connection, impossible to connect to url: https://download.blender.org/demo/bundles/bundles-3.0/grease-pencil-brush-pack.zip

When i paste the url in my browser the brush pack downloads fine, but then you have to append it manually.

Exact steps for others to reproduce the error

  • Enable the Grease Pencil Tools Add-on
  • Create a Grease pencil object
  • Go to Tools in the Properties Editor in Draw mode
  • Click on Brush Specials
  • Click on Download and import texture brush pack
**System Information** Operating system: Windows 10 Enterprise Graphics card: NVIDIA GeForce RTX 3070 **Blender Version** Broken: 4.0.1 Worked: 3.6 LTS (maybe 4.0) **Short description of error** Blender gives an error message that the internet connection is off, though that is false, when i click on "Download and import texture brush pack". My theory is an error due to the DDoS-attack, but don't really know. error message is: _Check your internet connection, impossible to connect to url: https://download.blender.org/demo/bundles/bundles-3.0/grease-pencil-brush-pack.zip_ When i paste the url in my browser the brush pack downloads fine, but then you have to append it manually. **Exact steps for others to reproduce the error** - Enable the Grease Pencil Tools Add-on - Create a Grease pencil object - Go to Tools in the Properties Editor in Draw mode - Click on Brush Specials - Click on Download and import texture brush pack
markus.hanson added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-11-24 09:22:17 +01:00
markus.hanson changed title from "Download and import texture brush pack" doesn't work with the Grease Pencil Tolls Add-on to "Download and import texture brush pack" doesn't work with the Grease Pencil Tools Add-on 2023-11-24 09:22:43 +01:00
Member

cc @Pullup
Website is up and packages are available there.

My theory is an error due to the DDoS-attack, but don't really know.

Maybe, yes.

Worked: 3.6 LTS (maybe 4.0)

Past versions also throwing same error

cc @Pullup Website is up and packages are available there. > My theory is an error due to the DDoS-attack, but don't really know. Maybe, yes. > Worked: 3.6 LTS (maybe 4.0) Past versions also throwing same error
Pratik Borhade added
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-11-24 10:22:36 +01:00
Author

cc @Pullup
The download of the pack is unreasonably slow. The function of the add-on is so you don't need to download from site and append manually. And the error message is false anyway, since i do have internet connection :)

Worked: 3.6 LTS (maybe 4.0)

Interesting. So maybe not the attack then.

> cc @Pullup > The download of the pack is unreasonably slow. The function of the add-on is so you don't need to download from site and append manually. And the error message is false anyway, since i do have internet connection :) > > > Worked: 3.6 LTS (maybe 4.0) > > Interesting. So maybe not the attack then.
Member

Hi @PratikPB2123 @markus.hanson

I investigated the problem and I think it's a direct consequence of the attack.
The accessibility rules of the server seem to have changed (to enhance protection from bots and DDoS I presume).
(so it's independent of the Blender versions)

To download the pack from the addon I've just set a basic python urllib request to check the page and download the file. It has always worked, but when accessed now using this method, it returns a 403 error.

Sadly, my knowledge of web scraping is very limited, and I don't know how to work around this.

It's possible the server policy changes are only temporary to mitigate the server attacks.

Maybe @pablovasquez knows if the server state will roll back to previous external access rule ?

Hi @PratikPB2123 @markus.hanson I investigated the problem and I think it's a direct consequence of the attack. The accessibility rules of the server seem to have changed (to enhance protection from bots and DDoS I presume). (so it's independent of the Blender versions) To download the pack from the addon I've just set a basic _python urllib_ request to check the page and download the file. It has always worked, but when accessed now using this method, it returns a 403 error. Sadly, my knowledge of web scraping is very limited, and I don't know how to work around this. It's possible the server policy changes are only temporary to mitigate the server attacks. Maybe @pablovasquez knows if the server state will roll back to previous external access rule ?

I have also had this issue. I can certainly understand if this is a protection against future DDoS attacks; but now that I have it on my machine via my browser, is there another means of appending these brushes automatically?

I am aware that I can simply append them from the blend file each time, which is what I'm doing in the interim; but it would be very convenient if there was an easy way to have them load at start for a 2D animation file.

I have also had this issue. I can certainly understand if this is a protection against future DDoS attacks; but now that I have it on my machine via my browser, is there another means of appending these brushes automatically? I am aware that I can simply append them from the blend file each time, which is what I'm doing in the interim; but it would be very convenient if there was an easy way to have them load at start for a 2D animation file.

I have the same issue too and try to import these brush set. It doesn't work too...

I have the same issue too and try to import these brush set. It doesn't work too...
Member

I investigated the problem and I think it's a direct consequence of the attack.

cc @ThomasDinges

> I investigated the problem and I think it's a direct consequence of the attack. cc @ThomasDinges

@Arnd Can you check please?

@Arnd Can you check please?

There's a code workaround available -- seems that we need to set at least the User-Agent on the request, otherwise we'll get back 403's. I'm unsure "which" user-agent to use that would be most appropriate and it's weird that this is all it takes to bypass the issue...

diff --git a/greasepencil_tools/import_brush_pack.py b/greasepencil_tools/import_brush_pack.py
index 9a7866e4..0b41d2b8 100644
--- a/greasepencil_tools/import_brush_pack.py
+++ b/greasepencil_tools/import_brush_pack.py
@@ -20,7 +20,9 @@ def simple_dl_url(url, dest, fallback_url=None):
     # ssl._create_default_https_context = ssl._create_unverified_context

     try:
-        urllib.request.urlretrieve(url, dest)
+        request = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
+        with urllib.request.urlopen(request) as response, open(dest, 'wb') as file:
+            file.write(response.read())
     except Exception as e:
         print('Error trying to download\n', e)
         if fallback_url:
@@ -94,7 +96,8 @@ class GP_OT_install_brush_pack(bpy.types.Operator):
         file_size = None

         try:
-            with urllib.request.urlopen(dl_url) as response:
+            request = urllib.request.Request(dl_url, headers={'User-Agent': 'Mozilla/5.0'})
+            with urllib.request.urlopen(request) as response:
                 file_size = int(response.getheader('Content-Length'))
         except:
             ## try loading from tempdir
There's a code workaround available -- seems that we need to set at least the User-Agent on the request, otherwise we'll get back 403's. I'm unsure "which" user-agent to use that would be most appropriate and it's weird that this is all it takes to bypass the issue... ```diff diff --git a/greasepencil_tools/import_brush_pack.py b/greasepencil_tools/import_brush_pack.py index 9a7866e4..0b41d2b8 100644 --- a/greasepencil_tools/import_brush_pack.py +++ b/greasepencil_tools/import_brush_pack.py @@ -20,7 +20,9 @@ def simple_dl_url(url, dest, fallback_url=None): # ssl._create_default_https_context = ssl._create_unverified_context try: - urllib.request.urlretrieve(url, dest) + request = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'}) + with urllib.request.urlopen(request) as response, open(dest, 'wb') as file: + file.write(response.read()) except Exception as e: print('Error trying to download\n', e) if fallback_url: @@ -94,7 +96,8 @@ class GP_OT_install_brush_pack(bpy.types.Operator): file_size = None try: - with urllib.request.urlopen(dl_url) as response: + request = urllib.request.Request(dl_url, headers={'User-Agent': 'Mozilla/5.0'}) + with urllib.request.urlopen(request) as response: file_size = int(response.getheader('Content-Length')) except: ## try loading from tempdir ```
Jesse Yurkovich added the
Module
Grease Pencil
label 2023-12-20 21:15:27 +01:00
Member

@deadpin I've tested the same thing (with the same user agent ^^). Not sure if it's a good and durable solution, at least it works.

But it means people using previous versions of Blender will still be denied access to the brush pack.
If we have a confirmation that the server parameter changes are definitive, then let's go for this.

@deadpin I've tested the same thing (with the same user agent ^^). Not sure if it's a good and durable solution, at least it works. But it means people using previous versions of Blender will still be denied access to the brush pack. If we have a confirmation that the server parameter changes are definitive, then let's go for this.

I'm not sure how CloudFlare operates, but to make this work without upgrading blender (the browser agent solution is not accepted yet anyways), would it not be possible to set a redirect to a less secure server there?

I'm not sure how CloudFlare operates, but to make this work without upgrading blender (the browser agent solution is not accepted yet anyways), would it not be possible to set a redirect to a less secure server there?
casey-bianco-davis added this to the Grease Pencil project 2024-01-08 16:50:32 +01:00
casey-bianco-davis removed this from the Grease Pencil project 2024-01-09 07:01:55 +01:00

@Arnd Can you please check?

@Arnd Can you please check?

I've gone and tried a few things.
I have found a way to except particular downloads from certain checks (not listing them here to not give attackers any ideas).
This should now affect the given URL and other paths that concern the demo-bundles.

I have repeatedly been able to fetch the file correctly on my instance now; but am waiting for feedback from someone helping me test the issue.

I've gone and tried a few things. I have found a way to except particular downloads from certain checks (not listing them here to not give attackers any ideas). This should now affect the given URL and other paths that concern the demo-bundles. I have repeatedly been able to fetch the file correctly on my instance now; but am waiting for feedback from someone helping me test the issue.

Initial feedback seems to indicate that the changes have solved the issue.
Closing the issue; please re-open if any incidents around this pop up after this date.

Initial feedback seems to indicate that the changes have solved the issue. Closing the issue; please re-open if any incidents around this pop up after this date.
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2024-01-10 19:08:49 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
9 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#115336
No description provided.