Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Occasional 404 error and lost data...
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Occasional 404 error and lost data...

by cstanke on Mon Jun 01, 2020 11:03 am

Hello all!

I have an intermittent problem. I have seen it on a specific feed but I think I've actually seen it on a couple different devices and a couple different feeds. The symptoms are as follows:

I have a feed with history enabled that holds a number. It's called apod-delay.

Occasionally (once a month or so, I haven't closely tracked the occurrence rate), my PyPortal will receive a 404 error trying to access this feed. When I go to check the feed on io.adafruit.com, I find it has no data! At this point I set a value on the feed with a dashboard widget and things work fine until, at some point, the problem happens again.

This is a "set and forget" setting. I do not change it unless I encounter the above issue, so it isn't actively being modified. Since I don't modify the value, and out of the blue I lose it, I suspect something happening on the backend.

Any help or insight would be great!

Thanks!

EDIT:
I just confirmed this happens on a different feed on a different device as well. The feed name is here is info. History is enabled for this feed. On the io.adafruit.com Feeds overview page, the feed shows "Last Value" as "System Ready!" but, when I click on the feed itself, there is no data (Record 0 through 0 of 0). Manually adding data to this feed fixes the problem until, inevitably at some point in the future, the feed will lose its data again.

cstanke
 
Posts: 62
Joined: Thu Jul 10, 2014 8:18 pm

Re: Occasional 404 error and lost data...

by brubell on Mon Jun 01, 2020 11:18 am

my PyPortal will receive a 404 error trying to access this feed. When I go to check the feed on io.adafruit.com, I find it has no data!

Does the graph on the feed page not display/render data, or are there no data points listed on the page at all? Both?

Is feed history turned ON for both of these feeds?
feed_history_on.png
feed_history_on.png (19.05 KiB) Viewed 63 times


Which Adafruit IO Plan do you have: IO Free or IO Plus?

brubell
 
Posts: 946
Joined: Fri Jul 17, 2015 10:33 pm

Re: Occasional 404 error and lost data...

by cstanke on Mon Jun 01, 2020 11:27 am

Hi @brubell!
brubell wrote:Does the graph on the feed page not display/render data, or are there no data points listed on the page at all? Both?

There are no data points listed on the page. There is a graph if I manually add data points on the feed page.

brubell wrote:Is feed history turned ON for both of these feeds?

Yes. As mentioned in the original post, feed history is on for both feeds. I just (re)added data points today.
Screen Shot 2020-06-01 at 11.19.30 AM.png
Screen Shot 2020-06-01 at 11.19.30 AM.png (34.36 KiB) Viewed 62 times

Screen Shot 2020-06-01 at 11.19.57 AM.png
Screen Shot 2020-06-01 at 11.19.57 AM.png (25.79 KiB) Viewed 62 times


brubell wrote:Which Adafruit IO Plan do you have: IO Free or IO Plus?

I have 'IO Plus'.

Thanks!

cstanke
 
Posts: 62
Joined: Thu Jul 10, 2014 8:18 pm

Re: Occasional 404 error and lost data...

by jwcooper on Mon Jun 01, 2020 12:00 pm

cstanke wrote:Hello all!

EDIT:
I just confirmed this happens on a different feed on a different device as well. The feed name is here is info. History is enabled for this feed. On the io.adafruit.com Feeds overview page, the feed shows "Last Value" as "System Ready!" but, when I click on the feed itself, there is no data (Record 0 through 0 of 0). Manually adding data to this feed fixes the problem until, inevitably at some point in the future, the feed will lose its data again.


Can you confirm this is happening still, or has that info feed been repaired?

Also, what browser are you using? Any chance you have any errors in the javascript console that you could provide?

Thank you!

jwcooper
 
Posts: 679
Joined: Tue May 01, 2012 9:08 pm

Re: Occasional 404 error and lost data...

by cstanke on Mon Jun 01, 2020 12:50 pm

Hi @jwcooper!
jwcooper wrote:Can you confirm this is happening still, or has that info feed been repaired?

I just saw the issue again this morning and I fixed the feeds in question by manually adding data. Since the problem is intermittent on an every month or so basis, I probably won't see it again for a while. Like I said in my original post, I'm not entirely sure about frequency of occurrence because I haven't tracked it. I occasionally see the issue, fix it, then go on about my days.

Incidentally, this perplexes me...

On another feed: builtin-led, I see the last value on the feeds overview page:
Screen Shot 2020-06-01 at 12.23.04 PM.png
Screen Shot 2020-06-01 at 12.23.04 PM.png (17.22 KiB) Viewed 60 times


But on the feed page itself, I see that the feed has no data:
Screen Shot 2020-06-01 at 12.23.39 PM.png
Screen Shot 2020-06-01 at 12.23.39 PM.png (72.29 KiB) Viewed 60 times


Am I wrong in assuming if the overview knows there is data in the feed, the feed page should show it...?

jwcooper wrote:Also, what browser are you using? Any chance you have any errors in the javascript console that you could provide?

Well, the 404 error is on a PyPortal. The other device is an ESP8266 but it fails over silently. I fix the problems by manually (re)adding data on Safari for macOS and iOS. There are no Javascript errors in the Safari console.

As a point of possible interest, I had troubles with my IO account before, might this be ripples from that...? (there was also this one).

cstanke
 
Posts: 62
Joined: Thu Jul 10, 2014 8:18 pm

Re: Occasional 404 error and lost data...

by cstanke on Sun Jun 07, 2020 1:54 pm

Hi all,

I just encountered the problem again this morning...! Today, my PyPortal complains with a 404 error on my NeoPixel color feed. I went to IO to check it out. On the Feed overview page, the value is shown: #0064ff. It was set "about 2 months ago." I have not changed this feed in a couple months!
Screen Shot 2020-06-07 at 1.39.19 PM.png
Screen Shot 2020-06-07 at 1.39.19 PM.png (36.69 KiB) Viewed 49 times


But... If I click on the feed to see the data, there is nothing there! It also says the feed is offline.
Screen Shot 2020-06-07 at 1.44.12 PM.png
Screen Shot 2020-06-07 at 1.44.12 PM.png (142.86 KiB) Viewed 49 times


It's important to note that I haven't touched this feed! I have not changed it and the overview page even shows I haven't changed it since "about 2 months ago."

So... What's going on here!?

I haven't corrected the problem so it will stay in the weird state for troubleshooting. Any help?

cstanke
 
Posts: 62
Joined: Thu Jul 10, 2014 8:18 pm

Re: Occasional 404 error and lost data...

by cstanke on Sun Jun 07, 2020 7:44 pm

Oh, and I have also verified that History is turned on.

Does this data somehow get purged. In addition to the last value (that's missing) I should have a number of previous ones. This PyPortal has been running for more than a few months...

cstanke
 
Posts: 62
Joined: Thu Jul 10, 2014 8:18 pm

Re: Occasional 404 error and lost data...

by brubell on Mon Jun 08, 2020 10:40 am

cstanke wrote:Oh, and I have also verified that History is turned on.

Does this data somehow get purged. In addition to the last value (that's missing) I should have a number of previous ones. This PyPortal has been running for more than a few months...


Could you post your code? It looks like the neopixel feed is a group feed and you may be writing to it incorrectly (or the library might have a bug).

brubell
 
Posts: 946
Joined: Fri Jul 17, 2015 10:33 pm

Re: Occasional 404 error and lost data...

by cstanke on Mon Jun 08, 2020 11:40 am

brubell wrote:Could you post your code? It looks like the neopixel feed is a group feed and you may be writing to it incorrectly (or the library might have a bug).


Hi @brubell!

To be clear, my PyPortal only reads the value of the neopixel feed. I only write to it via a color widget on an IO+ Dashboard.

All my feeds are grouped. The feeds for my PyPortal are grouped in a "PyPortal-01" group. The ones I write to on the PyPortal (eg: light and temperature) do not get purged like this. The ones I write to by using an IO+ Dashboard widget (or by manually adding data to the feed itself) are the ones that have this problem every couple months. These feeds are not written to regularly—only when I want a change.

All that said, here's the code snippet for reading the neopixel feed on my PyPortal:

Code: Select all | TOGGLE FULL SIZE
def get_neopixel_color():
    global neopixel_color
   
    neopixel_color_feed = get_feed('pyportal-01.neopixel')
 
    neopixel_color_new = {}
    # Get the Neopixel Color from Adafruit IO
   
    if(neopixel_color_feed):
        try:
            neopixel_color_new = io.receive_data(neopixel_color_feed['key'])
        except (ValueError, RuntimeError, MemoryError) as e:
            print("Failed to get Neopixel color data, retrying\n", e)
            neopixel_color_new['value'] = neopixel_color
            wifi.reset()
            pass
       
        if(neopixel_color_new['value'] != neopixel_color):
            neopixel_color = neopixel_color_new['value']
            print("Neopixel color has been changed to: {}".format(neopixel_color))
       
    return neopixel_color

cstanke
 
Posts: 62
Joined: Thu Jul 10, 2014 8:18 pm

Re: Occasional 404 error and lost data...

by cstanke on Tue Jun 09, 2020 2:59 pm

OK. To capture history, I've taken screenshots of values I manually added today to two feeds using the feed page on io.adafruit.com.

The feeds are: apod-delay and neopixel. I won't touch them again. When my PyPortal throws a 404 error trying to read the missing values, I'll come back here to update this thread. So, here is today's state captured in time:

Screen Shot 2020-06-09 at 2.44.30 PM.png
Screen Shot 2020-06-09 at 2.44.30 PM.png (72.74 KiB) Viewed 43 times

Screen Shot 2020-06-09 at 2.45.17 PM.png
Screen Shot 2020-06-09 at 2.45.17 PM.png (63.45 KiB) Viewed 43 times

Screen Shot 2020-06-09 at 2.51.22 PM.png
Screen Shot 2020-06-09 at 2.51.22 PM.png (71.13 KiB) Viewed 43 times

cstanke
 
Posts: 62
Joined: Thu Jul 10, 2014 8:18 pm

Please be positive and constructive with your questions and comments.