Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Weather App says "Fatal error" after trying to add a City #86

Open
butrus opened this issue Jan 18, 2020 · 29 comments
Open

The Weather App says "Fatal error" after trying to add a City #86

butrus opened this issue Jan 18, 2020 · 29 comments
Labels

Comments

@butrus
Copy link

butrus commented Jan 18, 2020

Steps to reproduce

  1. Start the App
  2. Click "Add a city"
  3. Write the name of the city into the box
  4. Nothing happens
  5. Click on "Add"
  6. It says: "Fatal error: Please check nextcloud.log and send a bug..." (etc)
  7. Nothing appears to be written to the log (loglevel 0, it works for other Apps)

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead

Server configuration

Operating system:
Linux XXX 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5+deb10u2 (2019-08-08) x86_64 GNU/Linux

Web server:
Apache/2.4.38 (Debian)

Database:
mysql Ver 15.1 Distrib 10.3.18-MariaDB

PHP version:
PHP 7.3.11-1~deb10u1

Nextcloud version: (see Nextcloud admin page)

Updated from an older Nextcloud/ownCloud or fresh install:
fresh

Where did you install Nextcloud from:
?

Signing status:

Signing status

No errors have been found.

List of activated apps:

App list Enabled: - accessibility: 1.3.0 - activity: 2.10.1 - apporder: 0.9.0 - bookmarks: 2.3.4 - calendar: 2.0.0 - camerarawpreviews: 0.7.3 - checksum: 0.4.3 - circles: 0.17.10 - cloud_federation_api: 1.0.0 - comments: 1.7.0 - contacts: 3.1.6 - dav: 1.13.0 - event_update_notification: 1.0.1 - external: 3.4.1 - extract: 1.2.3 - federatedfilesharing: 1.7.0 - federation: 1.7.0 - files: 1.12.0 - files_accesscontrol: 1.7.0 - files_automatedtagging: 1.7.0 - files_external: 1.8.0 - files_linkeditor: 1.0.11 - files_mindmap: 0.0.15 - files_pdfviewer: 1.6.0 - files_rightclick: 0.15.1 - files_sharing: 1.9.0 - files_trackdownloads: 1.6.0 - files_trashbin: 1.7.0 - files_versions: 1.10.0 - files_videoplayer: 1.6.0 - firstrunwizard: 2.6.0 - gallery: 18.4.0 - group_everyone: 0.1.4 - groupfolders: 5.0.5 - groupquota: 0.1.2 - logreader: 2.2.0 - lookup_server_connector: 1.5.0 - mail: 1.0.0 - maps: 0.1.2 - metadata: 0.10.0 - music: 0.12.1 - notes: 3.1.1 - notifications: 2.5.0 - oauth2: 1.5.0 - password_policy: 1.7.0 - polls: 0.10.4 - pride: 0.0.3 - printer: 0.0.1 - privacy: 1.1.0 - provisioning_api: 1.7.0 - recommendations: 0.5.0 - serverinfo: 1.7.0 - sharebymail: 1.7.0 - sharingpath: 0.1.0 - spreed: 7.0.2 - support: 1.0.1 - survey_client: 1.5.0 - systemtags: 1.7.0 - tasks: 0.11.3 - text: 1.1.1 - theming: 1.8.0 - timetracker: 0.0.39 - twofactor_backupcodes: 1.6.0 - updatenotification: 1.7.0 - uploaddetails: 0.1.2 - user_external: 0.8.0 - user_usage_report: 1.1.2 - viewer: 1.2.0 - w2g2: 3.0.0 - weather: 1.6.4 - workflow_script: 1.2.0 - workflowengine: 1.7.0 - xray: 0.2.3

Nextcloud configuration:

Config report

{
"system": {
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"nextcloud.lan",
"nextcloud.home"
],
"datadirectory": "REMOVED SENSITIVE VALUE",
"dbtype": "mysql",
"version": "17.0.2.1",
"overwrite.cli.url": "http://localhost",
"dbname": "REMOVED SENSITIVE VALUE",
"dbhost": "REMOVED SENSITIVE VALUE",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"log_type": "file",
"logfile": "/var/log/nextcloud.log",
"logfilemode": 416,
"loglevel": "0",
"logdateformat": "F d, Y H:i:s",
"instanceid": "REMOVED SENSITIVE VALUE",
"maintenance": false,
"has_rebuilt_cache": true,
"mail_smtpmode": "sendmail",
"updatechecker": true,
"updater.server.url": "https://updates.nextcloud.com/updater_server/",
"updater.release.channel": "stable",
"has_internet_connection": true,
"connectivity_check_domains": [
"alive.lan"
],
"check_for_working_wellknown_setup": false,
"check_for_working_htaccess": false
}
}

Client configuration

Browser:
FF 52.8.0

Operating system:
Linux

@e-alfred
Copy link
Collaborator

Do you see any error in the browser console?

@e-alfred e-alfred added the bug label Jan 19, 2020
@elgorro
Copy link

elgorro commented Jan 25, 2020

Got the same issue after installation. Nothing in the logs. Checked the browser console and as well nothing obvious (= no error). But I found out, the master here is version 1.7.1 and in app-store it is version 1.6.4. Hope this helps.

@Pontiac76
Copy link

I was having the same problem, but found that an API is required.

Found in the configuration section at https://github.com/nextcloud/weather

@Netspider
Copy link

adding a (free) api key didn't help in my case.

Request URL: https://MYDOMAIN/apps/weather/city/add
Request Method: POST
Status Code: 502

{code: 502, response: null}

@e-alfred
Copy link
Collaborator

@Netspider @butrus @elgorro Which cities did you try to add?

@Netspider
Copy link

Netspider commented Feb 27, 2020

not working:

  • Leipzig
  • Berlin, Deutschland

working:

  • Germany, Berlin (shows weather for Germany, not Berlin)
  • Berlin, Germany (yes, Berlin!)
    ... now even "Leipzig" is working.

I disabled and enabled the plugin, but I also tried this yesterday.

@SuperSandro2000
Copy link

Same happening with the docker container without any error.

@SuperSandro2000
Copy link

After opening the example api call from openweathermap's email and re-pasting the api token from their email it works for now aperant reason.

@butrus
Copy link
Author

butrus commented Apr 17, 2020

OK, I was unaware API key is needed. But I'm not closing the bug, since a more useful error message should be presented to the user ("API key is missing, please read XYZ and set the key in X => Y => Z" instead of just "Fatal error"). Thank you!

@hashworks
Copy link

It seems like it takes a while until it actually uses the API key. Had the same bug at first, but it went away.

@ostasevych
Copy link

Wouldn't be well to move the window with the API request to the app Settings but not at the NC global level settings?

@FadeFx
Copy link

FadeFx commented Jun 9, 2020

Guys OpenWeatherMap api keys will take some time to enable after creation. Did you try again after some time?

For me it worked an hour later.

@FadeFx
Copy link

FadeFx commented Jun 10, 2020

Wouldn't be well to move the window with the API request to the app Settings but not at the NC global level settings?

As the api key is required only once per installation, this is actually the correct place

@hashworks
Copy link

Guys OpenWeatherMap api keys will take some time to enable after creation. Did you try again after some time?

If that is the case this should be noted in the settings, to avoid issues like this one.

@FadeFx
Copy link

FadeFx commented Jun 11, 2020

If that is the case this should be noted in the settings, to avoid issues like this one.

Actually the signup page at OpenWeatherMap says that, this should be enough imo

@hashworks
Copy link

"Should be" and "is" are two very different things ;)

@FadeFx
Copy link

FadeFx commented Jun 11, 2020

"Should be" and "is" are two very different things ;)

Ok, so in my opinion this is enough.

To make it clear, this is a limitation of OpenWeatherMaps and has nothing to do with the weather app itself.

@HiranChaudhuri
Copy link

HiranChaudhuri commented Nov 22, 2020

I confirm to have the same symptoms. I just installed NextCloud 19.0.5 via 'docker pull nextcloud:19', added the weather app 1.7.4 and see the symptoms described above:
When adding a city I just get an error message.
When adding the free API key the behaviour does not change.

So the message asks me to complain in github. That seems to be all I can do...

Edit: So it seems by just waiting and retrying the problem resolved on it's own. Even if the cause is on the OpenWeatherMap side, a gentle hint could be given either in the logs or in the UI. Not much work for a developer but a lot calmer for so many users.

@john-clark
Copy link

john-clark commented Jan 14, 2021

Agree with @butrus April 17, 2020 comment saying a more descriptive error is needed.

As there is no information logged into the nextcloud.log

Update: I waited more than a day and could not add city, state (2 letter abbreviation). Adding US zipcode rendered a result in Itally. I finally entered City, State (fullname) and was able to receive results. Better instructions should be indicated.

@mwerle
Copy link

mwerle commented Jan 18, 2021

Just adding my 2c that the "fatal error check your logs" (sounds scary!) should be replaced by "Contact your Administrator to configure the OpenWeatherMap API Key" (or similar).

This was actually raised/discussed in a bug all the way back in 2016.

And yes, it's in the README, but looks like many people (myself included) don't read that. Furthermore, the readme configuration section should say that it can take some time (hours) for the setting to take effect.

@elgorro
Copy link

elgorro commented Jan 23, 2021

Works for me since the update. But one big thing is the openweathermap-api:
The API has multiple inputs for search: My places' name is in several countries and in the same country a few time... So u can search with query [String]. There is a list provided by owm that includs all "supported" locations, so every place has his own unique id [int]. Also its theoreticly possible to set a place with coordinates. And only in the USA its possible with ZIP... (https://openweathermap.org/current)

My suggestion: do implement a search like: https://openweathermap.org/ (not the one in the navbar!) with displaying coordinates, i think this can be achived with the new API (https://openweathermap.org/api/geocoding-api)

@almereyda
Copy link

almereyda commented Feb 9, 2021

I had the same issue with not being able to retrieve data for locations initially.

Guys OpenWeatherMap api keys will take some time to enable after creation. Did you try again after some time?

For me it worked an hour later.

And then it worked a few minutes later.

I agree the error message could be a little clearer about what is happening, esp. since it sends you to nextcloud.log, which does not exist in Docker installs, but also stdout doesn't show an error.

Also location selection could profit from suggestions of city names that are available. These don't even need to be queried from the API, but according to https://openweathermap.org/current there is a download of a city.list.json.gz at http://bulk.openweathermap.org/sample/ which could power such suggestions. Yet this might be another issue.

@JMLatGitHub
Copy link

JMLatGitHub commented Jun 3, 2021

Hello, the problem seems to persist. NC V21.0.2, Weather-App V1.7.5, valid OpenWeatherMap API key is registered.
Very shortly and in addition to the "Fatal error" one, the following message is displayed on the main interface when launching the Weather app:
{{ cityLoadError }}

Prema aquí para obter una clave para a API
(Click here to get an API key)

@junpet
Copy link

junpet commented Dec 22, 2021

I use Nextcloud (v23.0.0) in Docker. I installed yesterday the app and saved the API key. My API key exist for months (or years), I use it on my phone for one of my weather app. Still I get the error when I try to add any City. I checked log, but I cannot find anything.

@elgorro elgorro mentioned this issue Feb 16, 2022
@vgnmnky
Copy link

vgnmnky commented Feb 18, 2022

Running Nextcloud (v23.0.1) in a Docker container (in stack with Nginx). Tried with an old (active) key, and with a new one, and getting same error as everyone else. Not got it working with any city.

(edit: en error flashes up then disappears when I go to the weather screen, saying click here to get an API, which I have already entered. Not sure that it's being recognised in the settings.)

@derekakelly
Copy link

Fresh install, and getting the same error with 502 bad gateway in chrome console.

@Ayush62
Copy link

Ayush62 commented Mar 14, 2022

does it have to do with the version?
before i had nextcloud before installed(snap install) and i did not had this problem before.

@daffydock
Copy link

Well, add me to the pile. I am also having the same error when trying to add a new city. Previous cities work, no prob.

@medismail
Copy link
Contributor

I have the same issue in nextcloud 23, the problem is that 'cod' after parsing the json result is in keys not in values check #103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests