URL: load error: HTTP Error 406: Not Acceptable

Posted on
Sun Aug 29, 2021 2:11 pm
Brian Gaiser offline
Posts: 38
Joined: Jul 28, 2013

URL: load error: HTTP Error 406: Not Acceptable

I have been using control pages for years (on an iPad Client) and connecting to the Indigo (2021.1.1) Server and Web Server.
For over two years now, I've been putting up Web "Widgets" on that page that shows the upcoming daily forcast and a dynamic monthly calendar. The URL looks like this:

https://mtg.actiontiles.com/calendar.ph ... lor=FFFFFF

Attached is the setup screen and what the URL is "Supposed" to look like.
All of a sudden I now get a "broken image" on the screen and if you load the widget in a separate window it says:

https://mtg.actiontiles.com/calendar.ph ... lor=FFFFFF load error: HTTP Error 406: Not Acceptable

This just started in the last few days. The image loads if you cut/paste the URL into a browser directly.
Attached is what the widget looks like if loaded directly in a browser and the settings that have not changed in forever.

What is up?
Attachments
Settings.png
Settings.png (32.51 KiB) Viewed 5855 times
widget.png
widget.png (102.39 KiB) Viewed 5855 times

Posted on
Sun Aug 29, 2021 3:16 pm
jay (support) offline
Site Admin
User avatar
Posts: 18185
Joined: Mar 19, 2008
Location: Austin, Texas

Re: URL: load error: HTTP Error 406: Not Acceptable

Are you loading this from the Indigo Touch app or from Safari on the iPad? Does it behave the same way on each? Have you upgraded iPadOS recently?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Aug 29, 2021 4:22 pm
jay (support) offline
Site Admin
User avatar
Posts: 18185
Joined: Mar 19, 2008
Location: Austin, Texas

Re: URL: load error: HTTP Error 406: Not Acceptable

I've recreated it, but still unclear who is generating the 406. We'll debug more tomorrow to see who is generating the HTTP 406 error.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Aug 29, 2021 5:37 pm
Brian Gaiser offline
Posts: 38
Joined: Jul 28, 2013

Re: URL: load error: HTTP Error 406: Not Acceptable

Hey Jay.

No the iPad is static. I've tried all kinds of clients including older Macs and iPhones and such. Same result.

The web server under INDIGO is pumping errors in the log as well:

Aug 29, 2021 at 7:31:38 PM
Web Server https://mtg.actiontiles.com/calendar.ph ... lor=FFFFFF load error: HTTP Error 406: Not Acceptable
Web Server https://mtg.actiontiles.com/weather.php ... &loc=44256 load error: HTTP Error 406: Not Acceptable

Also - - the PREVIEW when editing the Control Page shows it correctly! HA!

I've also tried (perhaps not successfully as the /Library directory was not restored) - - to go back to 7.5... same result it seems.

See the attachment for the preview:

Posted on
Sun Aug 29, 2021 5:43 pm
Brian Gaiser offline
Posts: 38
Joined: Jul 28, 2013

Re: URL: load error: HTTP Error 406: Not Acceptable

Ooops.. here is the attachment.
Attachments
Preview.png
Preview.png (430.04 KiB) Viewed 5796 times

Posted on
Sun Aug 29, 2021 7:14 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: URL: load error: HTTP Error 406: Not Acceptable

I believe the problem is coming from your Web server (or whoever hosts actionstiles.com). Here is a simplified version of the python code Indigo is using to download the image file, which you can run inside Terminal (after starting with "python"):

Code: Select all
import urllib2
imageUrl = "https://mtg.actiontiles.com/calendar.php?backgroundColor=282E33&bodyColor=1DDDFF&titleColor=FFFFFF"
imageReq = urllib2.Request(imageUrl)
result = urllib2.urlopen(imageReq)

You'll notice the python code throws error 406 which is what is being returned by the actiontiles.com Web server:

Code: Select all
urllib2.HTTPError: HTTP Error 406: Not Acceptable

So for some reason the Web server doesn't like the request. Perhaps it is expecting more details (about the type of image to serve) in the HTTP header than what urllib2 is sending, but I would expect the defaults of an urllib2.Request() call to be good enough for it to fulfill the request. Did something change on the Web server side recently?

Image

Posted on
Mon Aug 30, 2021 5:47 am
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: URL: load error: HTTP Error 406: Not Acceptable

It looks like the server is requesting confirmation on the type of client making the request. If you add a relevant header to the request identifying yourself as an acceptable browser, you should be in business (without the header, requests() also returns a 406).

This works:

Code: Select all
import requests
import shutil

headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
url = 'https://mtg.actiontiles.com/calendar.php?backgroundColor=282E33&bodyColor=1DDDFF&titleColor=FFFFFF'
response = requests.get(url, stream=True, headers=headers)
with open('/Users/Dave/Temp/figure_name.png', 'wb') as out_file:
   response.raw.decode_content = True
   shutil.copyfileobj(response.raw, out_file)

I realize that this doesn't help with requests made through the control page URL tool, but perhaps you could use a Python script to download the elements and load them from a local file?
Attachments
figure_name.png
figure_name.png (7.39 KiB) Viewed 5707 times

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Aug 30, 2021 8:19 am
Brian Gaiser offline
Posts: 38
Joined: Jul 28, 2013

Re: URL: load error: HTTP Error 406: Not Acceptable

So - - that Action Tile site is pretty static. They posted one thing in the forum 5 months ago.

I can't imagine it changed... but I don't know ..

I guess I could download an image. Thanks.

Posted on
Mon Aug 30, 2021 8:31 am
Brian Gaiser offline
Posts: 38
Joined: Jul 28, 2013

Re: URL: load error: HTTP Error 406: Not Acceptable

I opened a ticked with Action Tile. See what that yields.

Thanks again Jay.

Posted on
Mon Aug 30, 2021 8:55 am
Brian Gaiser offline
Posts: 38
Joined: Jul 28, 2013

Re: URL: load error: HTTP Error 406: Not Acceptable

I created a Schedule that executed the fetch of the two tiles I wanted to a local file as suggested.

Worked great (as a temporary solution!)

My Control Page looks great again!
Attachments
sweet.png
sweet.png (468.21 KiB) Viewed 5662 times

Posted on
Mon Aug 30, 2021 9:48 am
jay (support) offline
Site Admin
User avatar
Posts: 18185
Joined: Mar 19, 2008
Location: Austin, Texas

Re: URL: load error: HTTP Error 406: Not Acceptable

So, basically, their site began requiring a User-Agent header, which the Indigo Web Server doesn't provide when trying to fetch images. That would be a change on their site. We'll look into it for the next Indigo release.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron