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

Wikidata Script Error #10385

Open
UKChris-osm opened this issue Jan 21, 2025 · 7 comments
Open

Wikidata Script Error #10385

UKChris-osm opened this issue Jan 21, 2025 · 7 comments
Labels
chore enhancement Actionable - add an enhancement to the source code javascript Pull requests that update Javascript code

Comments

@UKChris-osm
Copy link
Collaborator

UKChris-osm commented Jan 21, 2025

I've just tried running npm run Wikidata, and the first few batches work fine, up until it gets to batch 210, which contains Q124398113 for Autohopper which states an error with "fetch" and fails and retry's in an endless loop.

It shows an English label is added, then displays a fetch error, and then loops through this again, and again, stating that an English label is added multiple times.

Looking at the Wikidata for Autohopper it doesn't seem to add the English label, but does show a default label for all languages that was added two days ago, and I wonder if this is tripping up the NSI Wikidata Script?

Image

@UKChris-osm UKChris-osm added bug javascript Pull requests that update Javascript code labels Jan 21, 2025
@Snowysauce
Copy link
Collaborator

I just ran npm run wikidata to try and look into this, and I couldn't replicate the error. I tried a dry run first, and when it went past batch 210 with no problems, I then tried a normal run, which ran to completion. Very strange.

@UKChris-osm
Copy link
Collaborator Author

UKChris-osm commented Jan 22, 2025

I tried again today and it worked fine, no warning about adding an English label, but I checked and it seems an English label now exists on the Wikidata item since you ran npm run wikidata.

Perhaps my account doesn't have permission to write labels to Wikidata I wonder, and the script didn't know how to handle the rejected permission?

@Snowysauce
Copy link
Collaborator

That's entirely possible. When I registered for the OAuth application, I remember requesting a few more permissions than what was selected by default. I just looked at the application, and by default the only option selected is "Basic rights", which I assume amounts to read-only status.

@Snowysauce
Copy link
Collaborator

I double-checked my registration at https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/list, and I checked "Edit existing pages" and "Edit protected pages" in addition to the default "Basic rights". I updated the Secrets File wiki page with this info.

Still, I agree that the Wikidata sync script should account for situations where the registration is valid but the editing permissions weren't selected. Based on the existing code, this would probably be best done by adding some kind of permissions check here:

}
// To update wikidata

@UKChris-osm
Copy link
Collaborator Author

I thought I'd given myself the correct permissions when I applied:

Image

@Snowysauce
Copy link
Collaborator

I had to look up the definitions for each permission, but apparently there's subtle differences in rights between "Edit existing pages" and "Create, edit, and move pages". The most relevant difference (in terms of this issue) looks like the right "Change Item terms (labels, descriptions, aliases)", which is included with "Edit existing pages" but not "Create, edit, and move pages". I have no idea why.

@UKChris-osm
Copy link
Collaborator Author

UKChris-osm commented Jan 25, 2025

I've signed up again for a new set of credentials and made sure to select edit existing pages as well, so hopefully that'll allow the script to run freely now.

Seems to work find now:

Image

I'll leave this open though as I think you are right to say:

Still, I agree that the Wikidata sync script should account for situations where the registration is valid but the editing permissions weren't selected.

@UKChris-osm UKChris-osm added enhancement Actionable - add an enhancement to the source code chore and removed bug labels Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore enhancement Actionable - add an enhancement to the source code javascript Pull requests that update Javascript code
Projects
None yet
Development

No branches or pull requests

2 participants