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

JS TypeError in OZentry, when evaluating e.length #827

Closed
hyanwong opened this issue Apr 24, 2024 · 10 comments
Closed

JS TypeError in OZentry, when evaluating e.length #827

hyanwong opened this issue Apr 24, 2024 · 10 comments

Comments

@hyanwong
Copy link
Member

When testing the "new" prod, I'm getting the following error. Perhaps the API is failing because of not having a valid cert. Nevertheless, I suspect it should be failing more gracefully?

Screenshot 2024-04-24 at 15 26 30
@lentinj
Copy link
Collaborator

lentinj commented Apr 24, 2024

I'm fairly sure this is what happens if an attempt to fetch node details returns no results (read: the DB is empty).

Fairly sure it's 'nowt to do with certs, but it should certainly be failing more gracefully.

@hyanwong
Copy link
Member Author

Thanks. This is running from the production DB, so I would hope it wasn't empty (and indeed it seems not to be, when I log directly into the database)

@lentinj
Copy link
Collaborator

lentinj commented Apr 24, 2024

Yup, if you look at the network tab the https://www.onezoom.org/API/node_details.json calls are returning no nodes. That's the root of the error, but as you say, it really shouldn't be empty.

@hyanwong
Copy link
Member Author

Ah, maybe it's because it's asking via https then? I can't actually seem to visit the http:// version of the site: it switches me back to https even if I clear the website details. So I can't test it until we have proper certs for the new site

@lentinj
Copy link
Collaborator

lentinj commented Apr 24, 2024

It's not related to the self-signed certs, there's server-side upset:

With new onezoom:

$ curl https://www.onezoom.org/API/node_details.json --insecure --data-raw 'node_ids=195509%2C195510%2C195511&image_source=best_any'
{}

With old onezoom (i.e. /etc/hosts bodge commented out):

$ curl https://www.onezoom.org/API/node_details.json --insecure --data-raw 'node_ids=195509%2C195510%2C195511&image_source=best_any'
{"nodes":[[195509,null,44211.96582291409,null,null,0,0,0,0,1,1,0,0,0,3995689,3995702,null,null,null,null,null,null],[195510,null,null,null,null,0,0,0,0,0,3,0,0,0,3995662,3995684,null,null,null,null,null,null],[195511,null,44262.58643716552,null,null,0,0,0,0,0,2,0,0,0,3995684,null,null,null,null,null,null,null]],"leaves":[[195506,3995662,44211.96582291409,"Chrysodracon forbesii",null,1000],[195507,3995684,44313.20705141694,"Chrysodracon aurea",null,1000],[195504,3995689,44211.96582291409,"Chrysodracon fernaldii",null,1000],[195505,3995702,44211.96582291409,"Chrysodracon halapepe",null,1000]],"lang":"en","vernacular_by_ott":[[3995662,"Waianae Range hala pepe"],[3995684,"golden hala pepe"],[3995689,"Lanai hala pepe"],[3995702,"royal hala pepe"]],"vernacular_by_name":[],"leafIucn":[[3995662,"EN"],[3995684,"EN"],[3995689,"EN"],[3995702,"VU"]],"leafPic":[[3995662,30804491,99,40000],[3995684,26934277,99,25000],[3995689,27965724,99,40000],[3995702,30804496,99,40000]],"reservations":[]}

The {} could be from an exception that's been caught and hidden.

@lentinj
Copy link
Collaborator

lentinj commented Apr 24, 2024

Yup. The problem will be somewhere behind this:

except: # E.g. if bad data has been passed in
return {}

My bet would be it complaining about a lack of ordered_nodes.rnk.

@hyanwong
Copy link
Member Author

Ah, thanks for the triage. The ordered_nodes.rnk field is there and full of NULLs, but that's what it's like on the beta site too, so it's a bit puzzling.

@hyanwong
Copy link
Member Author

Ah:

"Table 'onezoom_prod.tourstop' doesn't exist"

@davidebbo
Copy link
Contributor

So just a matter of turning on migrate=1 in private/appconfig.ini?

@hyanwong
Copy link
Member Author

Yep, I tried that, but for some reason it's not doing the migrations correctly, so I simply copied the table definition from beta using raw SQL. It seems to be working.

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

No branches or pull requests

3 participants