# Open-weather errors. What is happening?

**URL:** <https://discourse.nodered.org/t/open-weather-errors-what-is-happening/87112>\
**Category:** General\
**Created:** [9 April 2024 21:10 UTC](https://discourse.nodered.org/t/open-weather-errors-what-is-happening/87112 "2024-04-09T21:10:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [9 April 2024 21:10 UTC](https://discourse.nodered.org/t/open-weather-errors-what-is-happening/87112/1 "2024-04-09T21:10:01Z")

</div>

I use open-weather a lot and just recently it is throwing weird errors at me.

As _we_ are going into winter, (ok, Autumn) it is raining more and more.

For now I am doing a series of weather gets from midnight to mid day to see how much rain has fallen.  
(Each hour, there about)

This shows the error (kind of) and the time. `02:00` and `The API call returned invalid JSON`

 ![Screenshot from 2024-04-10 06-41-54](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a190854ef26110299f69a650d05b17412287ca47.png)

This is a list of attempts to see what is the problem:  
Yeah, not perfect as the `objects` aren't expandable, but let's accept that and move on - for now.

 ![Screenshot from 2024-04-10 06-42-30](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/f/6f7cbd9eee4a52603aa9c4cf98b71536154d0bd2.png)

You can see the _replies_ (messages) at `00:00`, `01:00`, `03:00`, `04:00`, `05:00` and `06:00`.  
The big red arrow points to where the error causing `02:00` message should have been.

There isn't/wasn't a message sent.

Looking at the flow.  
Yes, it is a bit full on.  
Let's concentrate on the red area/s.

the `open-weather` node. The output goes to a `link` node. That then goes down and is _logged_.  
A `timestamp` is created for WHEN it happened, a `template` node _formats_ the message and a `queue` node queues them, and finally a `debug` shows them.

I need to do work on getting it to expand the `objects`, but I'm not sure that is the problem.

As you can see nothing was output at `02:00`, so that has me confused to the `invalid JSON` message.  
If anything was output, it would/should have been logged - yes?

This is happening with annoying regularity recently. But not always at 02:00 - or I am not 100% sure.  
The last few times - where were the start of this trend - I didn't really check that.  
I saw the error message and kind of grumbled.  
But now it seems to have established itself as a daily thing.

Just to mention - though I don't think it is relevant: Sunday morning (today is Wednesday) we went from SUMMER TIME back to NORMAL TIME.  
But as just said, that was now `5` days ago.  
Which is why I didn't worry the first couple of times - stupidly.

Any ideas?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 April 2024 22:10 UTC](https://discourse.nodered.org/t/open-weather-errors-what-is-happening/87112/2 "2024-04-09T22:10:28Z")

</div>

> [@Trying\_to\_learn](#):
>
> As _we_ are going into winter, (ok, Autumn) it is raining more and more.

That's great news, thanks Andrew, it must mean that summer is now heading our way here in the UK 😉

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 April 2024 09:18 UTC](https://discourse.nodered.org/t/open-weather-errors-what-is-happening/87112/3 "2024-04-10T09:18:54Z")

</div>

Is/Are there restrictions on what you can send into the node?

I have _test_ buttons and I can press them _until the cows come home_ and it works.  
It fails daily between 00:00 and 12:00  
Ok, that is a 6 hour gap in which I can look, but.... 😉

I did notice that somehow the node wasn't getting a simple incoming message.  
Say like `go`.  
But more like: `02:00 2024-04-10 1` Alas I wiped the debug list/output.

I have (today) put in a `change` node just before the input to the node and made it a `go` message.  
I'll see what happens tonight.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 April 2024 09:46 UTC](https://discourse.nodered.org/t/open-weather-errors-what-is-happening/87112/4 "2024-04-10T09:46:13Z")

</div>

More information after more testing.

 ![Screenshot from 2024-04-10 19-41-35](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/c/4ca2b5c54a79b904d79a02b08f2c49e7054b3d2a.png)

The code on the screen is _called_ with the `link call`, `link in` and `link out` nodes.

I invoked the code from the higher level and noticed that I am getting this error.

Strange.

The node is set to `return to calling node`.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/7/97ae93abfd7f75cff9fee9fd082e195a279ae317.png)

So, is this part of the problem?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 April 2024 11:25 UTC](https://discourse.nodered.org/t/open-weather-errors-what-is-happening/87112/5 "2024-04-10T11:25:40Z")

</div>

Somewhere down your flow (between the LINK-IN and the LINK-OUT return) a node is either discarding the important "return data" (i.e. data that tells the return node which LINK-CALL to send the msg back to) OR you have a naughty node that is generating NEW `msg`s (the effect is the same).

Add debug nodes along the flow (set to show FULL message) - you will see at the beginning of the flow there is some extra data that indicates which LINK-CALL to return to, then further along, it will be gone.

common causes are misbehaving nodes and functions that generate new messages (instead of returning the original `msg`)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 April 2024 11:29 UTC](https://discourse.nodered.org/t/open-weather-errors-what-is-happening/87112/6 "2024-04-10T11:29:22Z")

</div>

Ah!

That's an interesting spin on things.

Yes, I'll put my hand up now and say that is very possible to have happened.

ITMT, I've put it back to _simple_ `link-in/out` nodes. It isn't used by anyone else.  
I used the `call` node only to get some understanding on it's workings.

Seems that you found something I didn't think of and I will say that is the problem.

The last pictures shows the `COMPLETE RETURN MESSAGE` and that will probably have _wrong_ information compared to the inbound message.

THANKS!

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 April 2024 11:33 UTC](https://discourse.nodered.org/t/open-weather-errors-what-is-happening/87112/7 "2024-04-10T11:33:43Z")

</div>

(Although.......)

In the first few pictures, you see most of the messages seem to be getting through and _working_.

Just now and then one doesn't.

If it was that my code was corrupting the message:  
Why only certain ones?

Maybe if there was/wasn't rain something happened.

But for the sake of all: I will accept your reply.  
This was just an after thought I saw after marking that as the solution.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 April 2024 11:33 UTC](https://discourse.nodered.org/t/open-weather-errors-what-is-happening/87112/8 "2024-04-24T11:33:58Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
