Page MenuHomePhabricator

Error with video2commons: Error type: b"'NoneType' object has no attribute '__getitem__'"
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
Sandra_Hanbo
Oct 28 2021, 8:04 AM
Referenced Files
F34714615: image.png
Oct 28 2021, 10:21 PM
F34714478: image.png
Oct 28 2021, 7:07 PM
F34714279: image.png
Oct 28 2021, 1:46 PM
F34714277: image.png
Oct 28 2021, 1:46 PM
F34713786: Finishing_Process.png
Oct 28 2021, 8:04 AM

Description

Error type: b"'NoneType' object has no attribute '__getitem__'"

Finishing_Process.png (51×1 px, 7 KB)

Event Timeline

@Sandra_Hanbo: Thanks for reporting this. For future reference, please use the bug report form (linked from the top of the task creation page) to create a bug report, and provide steps to reproduce. Thanks.

Aklapper changed the subtype of this task from "Task" to "Bug Report".Oct 28 2021, 10:52 AM

If you have time and can still reproduce the situation: Please add a more complete description to this task. That should be

  • a clear and complete list of exact steps to reproduce the situation, step by step, so that nobody needs to guess or interpret how you performed each step,
  • what happens after performing these steps to reproduce,
  • what you expected to happen instead,
  • a link to a web address where the issue can be seen. Thanks again!
Sandra_Hanbo set the point value for this task to 10.Oct 28 2021, 1:46 PM
  • Using google chrome browser Version 95.0.4638.54 go to [[ URL | https://video2commons.toolforge.org/ ]]
  • Upload the needed video normally on that website
  • after waiting for the whole process, from rendering, into converting, then adding to commons, at the last step the error is produced:

"An exception occurred: TypeError: b"'NoneType' object has no attribute 'getitem'""

image.png (281×1 px, 40 KB)

  • The expected result:

Your task is done. You may find your upload at (its location in Wikimedia Commons)

image.png (68×1 px, 10 KB)

  • The frequent of happening, always today
JJMC89 removed the point value for this task.Oct 28 2021, 3:45 PM
[2021-10-28 14:05:21,534: WARNING/ForkPoolWorker-38] -1: Configuring Pywikibot...
[2021-10-28 14:05:21,546: VERBOSE/ForkPoolWorker-38] Found 1 commons:commons processes running, including this one.
[2021-10-28 14:05:21,637: WARNING/ForkPoolWorker-38] -1: Uploading...
[2021-10-28 14:05:21,734: WARNING/ForkPoolWorker-38] -1: Uploading...
[2021-10-28 14:05:21,736: WARNING/ForkPoolWorker-38] -1: Cleaning up...
[2021-10-28 14:05:21,738: VERBOSE/ForkPoolWorker-38] Dropped throttle(s).
[2021-10-28 14:05:21,801: ERROR/ForkPoolWorker-38] Task video2commons.backend.worker.main[103dff53-8c71-4f82-82c8-f07d9cf6f011] raised unexpected: TypeError("'NoneType' object has no attribute '__getitem__'",)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 385, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 648, in __protected_call__
    return self.run(*args, **kwargs)
  File "/srv/v2c/video2commons/backend/worker.py", line 138, in main
    filedesc, username, statuscallback, errorcallback
  File "/srv/v2c/video2commons/backend/upload/__init__.py", line 48, in upload
    size, statuscallback, errorcallback
  File "/srv/v2c/video2commons/backend/upload/__init__.py", line 91, in upload_pwb
    chunk_size=chunked, async=bool(chunked)  # , ignore_warnings=['exists-normalized']
  File "/usr/local/lib/python2.7/dist-packages/pywikibot/tools/__init__.py", line 1447, in wrapper
    return obj(*__args, **__kw)
  File "/usr/local/lib/python2.7/dist-packages/pywikibot/site.py", line 5979, in upload
    token = self.tokens['edit']
  File "/usr/local/lib/python2.7/dist-packages/pywikibot/site.py", line 1786, in __getitem__
    key = self.site.validate_tokens([key])[0]
  File "/usr/local/lib/python2.7/dist-packages/pywikibot/site.py", line 3299, in validate_tokens
    'token')['type']
TypeError: 'NoneType' object has no attribute '__getitem__'

Maybe something changed on the mediawiki api and our outdated pywikibot can't handle it? Logs indicate the error started in the last couple of days. First error entry in 2021-10-26 22:05:27,717

{c0cf17c} was the fix included in pywikibot 6.6.1; however, pywikibot hasn't supported python2 since 3.0.20200703.

yeah, let me see if I can get python3 working on the backend

Mentioned in SAL (#wikimedia-cloud) [2021-10-28T17:25:28Z] <chicocvenancio> move enconding04 to python3 T294520

Mentioned in SAL (#wikimedia-cloud) [2021-10-28T17:49:50Z] <chicocvenancio> move encoding05 and encoding06 to python3 T294520

This error should be fixed with the upgrade to python3.

@Chicocvenancio New bug had reached as I tried now.

  1. Using Chrome or Firefox I received this bug:

An exception occurred: AttributeError: b"'bytes' object has no attribute 'encode'"

image.png (45×1 px, 7 KB)

The steps: the same steps as before but in the error has resulted directly.

Aklapper renamed this task from Error with video2commons Tool to Error with video2commons: Error type: b"'NoneType' object has no attribute '__getitem__'".Oct 28 2021, 8:38 PM

@Chicocvenancio
A new error after trying
After waiting to be uploaded I received this bug :
An exception occurred: FileNotFoundError: b'[Errno 2] No such file or directory'

image.png (41×1 px, 7 KB)

Please file new tickets for new problems, and follow https://www.mediawiki.org/wiki/How_to_report_a_bug - thanks a lot! :)