kartaview / upload-scripts

Uploader tools for KartaView
MIT License
59 stars 30 forks source link

error on upload - ' You are not allowed to add a duplicate entry (sequenceIndex)' #51

Closed danbjoseph closed 5 years ago

danbjoseph commented 6 years ago
➜  upload_photos_by_exif git:(master) ✗ source venv/bin/activate                 
(venv) ➜  upload_photos_by_exif git:(master) ✗ find /Users/danbjoseph/Desktop/osc -mindepth 1 -type d -print0 | xargs -L 1 -0 ./upload_exif.py -p
Found 341 pictures to upload
100%|██████████████████████████████████████████████████ 341/341 remaining:00:00  elapsed:00:00
Finish uploading form dir: /Users/danbjoseph/Desktop/osc/osc16/ with sequence id: 1168919
Found 501 pictures to upload
100%|██████████████████████████████████████████████████ 501/501 remaining:00:00  elapsed:00:07
Finish uploading form dir: /Users/danbjoseph/Desktop/osc/osc17/ with sequence id: 1168925
Found 372 pictures to upload
100%|██████████████████████████████████████████████████ 372/372 remaining:00:00  elapsed:00:30
Finish uploading form dir: /Users/danbjoseph/Desktop/osc/osc26/ with sequence id: 1169001
Found 501 pictures to upload
100%|██████████████████████████████████████████████████ 501/501 remaining:00:00  elapsed:00:02
Finish uploading form dir: /Users/danbjoseph/Desktop/osc/osc29/ with sequence id: 1169029
Found 201 pictures to upload
100%|██████████████████████████████████████████████████ 201/201 remaining:00:00  elapsed:00:00
Finish uploading form dir: /Users/danbjoseph/Desktop/osc/osc30/ with sequence id: 1169041
Found 94 pictures to upload
100%|████████████████████████████████████████████████████ 94/94 remaining:00:00  elapsed:00:00
Finish uploading form dir: /Users/danbjoseph/Desktop/osc/osc31/ with sequence id: 1169061
Found 337 pictures to upload
100%|██████████████████████████████████████████████████ 337/337 remaining:00:00  elapsed:00:00
Finish uploading form dir: /Users/danbjoseph/Desktop/osc/osc32/ with sequence id: 1169071
Found 391 pictures to upload
100%|██████████████████████████████████████████████████ 391/391 remaining:00:00  elapsed:00:00
Finish uploading form dir: /Users/danbjoseph/Desktop/osc/osc33/ with sequence id: 1169093
Found 397 pictures to upload
100%|██████████████████████████████████████████████████ 397/397 remaining:00:00  elapsed:00:00
Finish uploading form dir: /Users/danbjoseph/Desktop/osc/osc34/ with sequence id: 1169113
Found 104 pictures to upload
100%|██████████████████████████████████████████████████ 104/104 remaining:00:00  elapsed:00:00
Finish uploading form dir: /Users/danbjoseph/Desktop/osc/osc35/ with sequence id: 1169119
Found 482 pictures to upload
 29%|██████████████▍                                    139/482 remaining:05:03  elapsed:00:14multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 372 pictures to upload
 12%|██████▏                                             45/372 remaining:03:09  elapsed:00:11multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 343 pictures to upload
 59%|█████████████████████████████▎                     201/343 remaining:01:56  elapsed:00:47multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 482 pictures to upload
 39%|███████████████████▍                               187/482 remaining:04:14  elapsed:00:46multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 478 pictures to upload
 10%|████▉                                               46/478 remaining:03:55  elapsed:00:21multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 306 pictures to upload
 22%|███████████▎                                        68/306 remaining:04:29  elapsed:00:20multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 483 pictures to upload
 29%|██████████████▍                                    140/483 remaining:05:03  elapsed:00:11multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 446 pictures to upload
 32%|████████████████                                   143/446 remaining:03:26  elapsed:01:25multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 292 pictures to upload
 13%|██████▋                                             38/292 remaining:02:30  elapsed:00:22multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 186 pictures to upload
 61%|██████████████████████████████▍                    113/186 remaining:01:02  elapsed:01:09multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
(venv) ➜  upload_photos_by_exif git:(master) ✗ 
danbjoseph commented 6 years ago

seemed to get a little bit further if the script is run again

(venv) ➜  upload_photos_by_exif git:(master) ✗ find /Users/danbjoseph/Desktop/osc -mindepth 1 -type d -print0 | xargs -L 1 -0 ./upload_exif.py -p
Found 482 pictures to upload
 84%|█████████████████████████████████████████▊         403/482 remaining:00:43  elapsed:02:35multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 372 pictures to upload
 19%|█████████▋                                          71/372 remaining:03:25  elapsed:00:17multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 343 pictures to upload
 85%|██████████████████████████████████████████▌        292/343 remaining:00:42  elapsed:00:56multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 482 pictures to upload
 74%|█████████████████████████████████████              357/482 remaining:01:01  elapsed:01:32multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 478 pictures to upload
 67%|█████████████████████████████████▌                 321/478 remaining:01:26  elapsed:02:46multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 306 pictures to upload
 30%|███████████████▍                                    93/306 remaining:02:18  elapsed:00:11multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 483 pictures to upload
100%|██████████████████████████████████████████████████ 483/483 remaining:00:00  elapsed:03:17
Finish uploading form dir: /Users/danbjoseph/Desktop/osc/osc42/ with sequence id: 1169155
Found 446 pictures to upload
 38%|███████████████████▏                               171/446 remaining:03:02  elapsed:00:13multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 292 pictures to upload
 46%|██████████████████████▉                            134/292 remaining:01:44  elapsed:00:55multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Found 186 pictures to upload
 81%|████████████████████████████████████████▎          150/186 remaining:00:19  elapsed:00:21multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 79, in __call__
    self.make_upload(photo, data_photo)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/photo.py", line 60, in make_upload
    if conn.json()['status']['apiMessage'] == ' You are not allowed to add a duplicate entry (sequenceIndex)':
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/requests/models.py", line 808, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./upload_exif.py", line 67, in <module>
    main()
  File "./upload_exif.py", line 58, in main
    do_upload(thread, UploadPhoto(path, access_token, id_sequence, count_list, url_photo), photos_path)
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/osc/utils.py", line 67, in do_upload
    list(tqdm.tqdm(p.imap(generator, payload), total=len(payload), bar_format='{l_bar}{bar} {n_fmt}/{total_fmt} remaining:{remaining}  elapsed:{elapsed}'))
  File "/Users/danbjoseph/Documents/Github/openstreetcam/upload-scripts/upload_photos_by_exif/venv/lib/python3.6/site-packages/tqdm/_tqdm.py", line 872, in __iter__
    for obj in iterable:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
(venv) ➜  upload_photos_by_exif git:(master) ✗ 
kudarisenmon commented 6 years ago

I met the same error last night, too

bogdans-telenav commented 6 years ago

( disclaimer: I am a iOS developer on OpenStreetCam ) Hi @kudarisenmon and @danbjoseph from my experience this issue reproduces also on iOS, so from my perspective this is a server bug that happens in the next scenario: server receives the first request for let's say index 1 it sends back a bad formatted JSON response, so the client platform (iOS, Android, upload scripts) will interpret as a failed request and retry the upload for index 1, the server will now respond with an error: ' You are not allowed to add a duplicate entry (sequenceIndex)'. Working solution: On mobile we ignore this error and consider that the server already received the image at index 1 so we upload the next image, this should also be implemented on this scrips. I suspect that the script receives this duplicate error and skip a different index then the one receiving the duplicate error. I will investigate that this is implemented and working accordingly.

bogdans-telenav commented 5 years ago

Update: Started work on a new upload script to fix this issue.

rwelty1889 commented 5 years ago

for the time being, i am using this script which forces the threads to 1 to avoid retry problem, and automagically restarts otherwise. it iterates over subdirectories which helps with my GoPro stuff. it is doing ok.

/bin/sh

handle ^c somewhat gracefully

trap 'exit 1;' INT

python to use

python=python3.6

path to upload_exif.py script

upload_exif=/Users/rwelty/Projects/openstreetcam/upload-scripts-master/upload_photos_by_exif/upload_exif.py

for i in */; do while echo $python $upload_exif -p "$i" -t 1 $python $upload_exif -p "$i" -t 1 [ $? -ne 0 ] do : ; done done

bogdans-telenav commented 5 years ago

Finally done it! Thanks for your patience! If you find any issues with the new version please create a issue and we will address it as soon as possible.