OpenWeather "Météo" no longer works

Good evening
I recently discovered Gladys, which seems very interesting to me. I tried to install the weather without success.
The creation in the dashboard of the weather in OpenWeather
I don’t have the box created
Is

Hello and welcome to the Gladys community. I edited your post to hide the key (which is private).

Did you test the OpenWeather service when you configured it?

When you add the box to a screen, don’t forget to save (at the bottom right)

Hello,
Thanks for your reply.
I’m using Gladys version V4.9.2 — the service was implemented automatically.
Is there a command to test it?
Despite registering it in the dashboard, I still get the error.
Regards.

Can you give us more information about the error? :slight_smile:

Hello,

I have not resolved the problem despite several attempts.

I miss

Do you have access to the Gladys logs to potentially see the response from the OpenWeather API?

On your machine you can run:

docker logs gladys

Good evening,
Here are the logs, I’m not sure these are the right ones…

Thank you for your reply.

root@gladys:/var/log# tail -n /var/log/messages
tail: invalid number of lines: ‘/var/log/messages’
root@gladys:/var/log# tail -n 20 /var/log/messages
Sep 11 17:43:57 gladys kernel: [ 31.710703] cam1-reg: disabling
Sep 11 17:44:53 gladys kernel: [ 40.284913] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
Sep 11 17:44:53 gladys kernel: [ 40.299417] Bridge firewalling registered
Sep 11 17:44:57 gladys kernel: [ 44.450866] docker0: port 1(vethc796f6f) entered blocking state
Sep 11 17:44:57 gladys kernel: [ 44.450878] docker0: port 1(vethc796f6f) entered disabled state
Sep 11 17:44:57 gladys kernel: [ 44.451172] device vethc796f6f entered promiscuous mode
Sep 11 17:44:57 gladys kernel: [ 44.506888] IPv6: ADDRCONF(NETDEV_CHANGE): veth24605c0: link bec omes ready
Sep 11 17:44:57 gladys kernel: [ 44.506998] IPv6: ADDRCONF(NETDEV_CHANGE): vethc796f6f: link bec omes ready
Sep 11 17:44:57 gladys kernel: [ 44.507039] docker0: port 1(vethc796f6f) entered blocking state
Sep 11 17:44:57 gladys kernel: [ 44.507044] docker0: port 1(vethc796f6f) entered forwarding stat e
Sep 11 17:44:57 gladys kernel: [ 44.507108] IPv6: ADDRCONF(NETDEV_CHANGE): docker0: link becomes ready
Sep 11 17:45:01 gladys kernel: [ 48.192284] docker0: port 1(vethc796f6f) entered disabled state
Sep 11 17:45:01 gladys kernel: [ 48.193171] eth0: renamed from veth24605c0
Sep 11 17:45:01 gladys kernel: [ 48.223812] docker0: port 1(vethc796f6f) entered blocking state
Sep 11 17:45:01 gladys kernel: [ 48.223824] docker0: port 1(vethc796f6f) entered forwarding stat e
Sep 11 17:45:05 gladys gladys-init: Gladys Setup Progress image exist, Cool…
Sep 11 17:45:05 gladys gladys-init: Watchtower container exist, Cool…
Sep 11 17:45:05 gladys gladys-init: Gladys container exist, Cool…
Sep 11 17:56:32 gladys kernel: [ 739.367933] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/ Full - flow control rx/tx
Sep 11 17:56:32 gladys kernel: [ 739.367976] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes re ady
root@gladys:/var/log#

Kind regards

Hi! These aren’t the right ones, did you run the command I

Hello,

I’m discovering Gladys as well, it’s really cool to use—congratulations.
I have the same issue, the weather isn’t working.

Below is the error log

_header: 'GET /data/2.5/onecall?lat=47.58798008319857\u0026lon=1.332848840870007\u00262004cb7f4ef216a56e086522c0ba HTTP/1.1\\r\\n' +
      'Accept: application/json, text/plain, */*\\r\\n' +
      'User-Agent: axios/0.21.1\\r\\n' +
      'Host: api.openweathermap.org\\r\\n' +
      'Connection: close\\r\\n' +
      '\\r\\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: noopPendingOutput],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 80,
      protocol: 'http:',
      options: [Object],
      requests: {},
      sockets: [Object],
      freeSockets: {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'GET',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/data/2.5/onecall?lat=47.58798008319857\u0026lon=1.332848840870007\u0026lang=frf4ef216a56e086522c0ba',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      socket: [Socket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      headers: [Object],
      rawHeaders: [Array],
      trailers: {},
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 401,
      statusMessage: 'Unauthorized',
      client: [Socket],
      _consuming: false,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'http://api.openweathermap.org/data/2.5/onecall?lat=47.587980r\u0026units=metric\u0026cnt=1\u0026appid=ma-clé-api',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(RequestTimeout)]: undefined
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'api.openweathermap.org',
    protocol: 'http:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 0,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'http://api.openweathermap.org/data/2.5/onecall?lat=47.587980r\u0026units=metric\u0026cnt=1\u0026appid=ma-clé-api',
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'user-agent': [Array],
      host: [Array]
    }
  },
  response: {
    status: 401,
    statusText: 'Unauthorized',
    headers: {
      server: 'openresty',
      date: 'Mon, 12 Sep 2022 09:13:58 GMT',
      'content-type': 'application/json; charset=utf-8',
      'content-length': '107',
      connection: 'close',
      'x-cache-key': '/data/2.5/onecall?cnt=1\u0026lang=fr\u0026lat=47.59\u0026lon=1.33\u0026units=m
      'access-control-allow-origin': '*',
      'access-control-allow-credentials': 'true',
      'access-control-allow-methods': 'GET, POST'
    },
    config: {
      url: 'http://api.openweathermap.org/data/2.5/onecall?lat=47.58798008319857metric\u0026cnt=1\u0026appid=ma-clé-api',
      method: 'get',
      headers: [Object],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 0,
      adapter: [Function: httpAdapter],
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      validateStatus: [Function: validateStatus],
      data: undefined
    },
    request: \u003cref *1\u003e ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      socket: [Socket],
      _header: 'GET /data/2.5/onecall?lat=47.58798008319857\u0026lon=1.332848840870008f2004cb7f4ef216a56e086522c0ba HTTP/1.1\\r\\n' +
        'Accept: application/json, text/plain, */*\\r\\n' +
        'User-Agent: axios/0.21.1\\r\\n' +
        'Host: api.openweathermap.org\\r\\n' +
        'Connection: close\\r\\n' +
        '\\r\\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: noopPendingOutput],
      agent: [Agent],
      socketPath: undefined,
      method: 'GET',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/data/2.5/onecall?lat=47.58798008319857\u0026lon=1.332848840870007\u0026lang=b7f4ef216a56e086522c0ba',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'api.openweathermap.org',
      protocol: 'http:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype]
    },
    data: {
      cod: 401,
      message: 'Invalid API key. Please see http://openweathermap.org/faq#error4
    }
  },
  isAxiosError: true,
  toJSON: [Function: toJSON]
}

This indicates that the API key is not correct, but if I test with the following command :

https://api.openweathermap.org/data/2.5/weather?q=Paris,fr\u0026APPID=ma-clé-api

It works.

Do you have any idea what the problem is?

Gladys : 4.9.2

Best regards,

This looks like a token issue.

![image|690x139](upload://svCPqoYtJQTBth6B

I just tested it at home, and it works fine too…

@VonOx The API key is indeed in the log, I think he just obfuscated it when sharing it, right?

Can you confirm that you have properly set the API key on Gladys’s « OpenWeather » page? Any issues with copy-pasting?

Well, I don’t really know, it’s weird

Re pierre-gilles

I did save it, but no result.
Regarding the logs, can you help me? I don’t have sufficient knowledge…

Here is what I saved
My API key : api5/weather? q=London, uk\u0026appid=(my-api_key)

Thanks in advance.

Wait, for the API key you’re putting « just » the API key, right?

Does your screen look like this?

![Screenshot 2022-09-12 at 14.56.28|690x270](upload://uDLHNT

Yes, I set the API key on the OpenWeather page (the same page as in the response above).
The copy/paste is OK, I checked by typing it manually, I tried another key and it gives me the same error.

Which browser are you using? Are you on the « official » version of Gladys (not a specially built branch)?

When you save and refresh the page, is the key still there?

What Pierre-Gilles means is that your API key must contain only alphanumeric characters.
not this format: api

I tried with Chrome and Firefox.
I followed the documentation so I assume it’s the official version of Gladys.
When I save and refresh, the key is still present.

I ran 2–3 tests.

If I put the line back into Gladys :

https://api.openweathermap.org/data/2.5/onecall?lat=47.58798008319857\u0026lon=1.332848840870007\u0026lang=                                   fr\u0026units=metric\u0026cnt=1\u0026appid=ma-clé-api'

and when I query the API it returns the same error Invalid API Key.

However, if I query by changing onecall to weather, I get responses

https://api.openweathermap.org/data/2.5/weather?lat=47.58798008319857\u0026lon=1.332848840870007\u0026lang=fr\u0026units=metric\u0026cnt=1\u0026appid=ma-clé-api

Do you need a specific subscription with OpenWeather?

Ah indeed!

OpenWeather must have changed the « permissions » they grant by default.

Does your OpenWeather account specify that you don’t have access to the onecall route?