kartaview / upload-scripts

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

Fail code:'osv' #16

Closed drkludge closed 5 years ago

drkludge commented 7 years ago

It has been awhile since I used the upload_photos_by_exif.py script. My python environment is configured to use python 3.

I received

$python upload_photos_by_exif.py -p 2016_09_10_09_41_18_196___Mapillary
Fail code:'osv'
Fail to create the sequence
Please restart the script

I updated to f587495 from 11 days ago.

  $python upload_photos_by_exif.py -p 2016_09_10_09_41_18_196___Mapillary

For login go to this URL in your browser:
http://www.openstreetmap.org/oauth/...
Traceback (most recent call last):
  File "upload_photos_by_exif.py", line 238, in main
    token_file = open("access_token.txt", "r+")
FileNotFoundError: [Errno 2] No such file or directory: 'access_token.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/share/CACHEDEV1_DATA/.qpkg/Python3/src/lib/python3.5/urllib/request.py", line 1240, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/share/CACHEDEV1_DATA/.qpkg/Python3/src/lib/python3.5/http/client.py", line 1083, in request
    self._send_request(method, url, body, headers)
  File "/share/CACHEDEV1_DATA/.qpkg/Python3/src/lib/python3.5/http/client.py", line 1128, in _send_request
    self.endheaders(body)
  File "/share/CACHEDEV1_DATA/.qpkg/Python3/src/lib/python3.5/http/client.py", line 1079, in endheaders
    self._send_output(message_body)
  File "/share/CACHEDEV1_DATA/.qpkg/Python3/src/lib/python3.5/http/client.py", line 911, in _send_output
    self.send(msg)
  File "/share/CACHEDEV1_DATA/.qpkg/Python3/src/lib/python3.5/http/client.py", line 854, in send
    self.connect()
  File "/share/CACHEDEV1_DATA/.qpkg/Python3/src/lib/python3.5/http/client.py", line 1237, in connect
    server_hostname=server_hostname)
  File "/share/CACHEDEV1_DATA/.qpkg/Python3/src/lib/python3.5/ssl.py", line 376, in wrap_socket
    _context=self)
  File "/share/CACHEDEV1_DATA/.qpkg/Python3/src/lib/python3.5/ssl.py", line 747, in __init__
    self.do_handshake()
  File "/share/CACHEDEV1_DATA/.qpkg/Python3/src/lib/python3.5/ssl.py", line 983, in do_handshake
    self._sslobj.do_handshake()
  File "/share/CACHEDEV1_DATA/.qpkg/Python3/src/lib/python3.5/ssl.py", line 628, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:646)

I've seen this problem before with the id_file.txt. So I touched the file

touch access_token.txt
chmod ugo+rw access_token.txt

And now we are back to the same error that I started with.

$python upload_photos_by_exif.py -p 2016_09_10_09_41_18_196___Mapillary
Fail code:'osv'
Fail to create the sequence
Please restart the script
bogdan-racasan commented 7 years ago

Hi @drkludge i added access token for security issues but i don't know where is the problem... you still have this issue ?

bogdan-racasan commented 7 years ago

@drkludge i'm trying to reproduce this bug ... but i can't.

drkludge commented 7 years ago

1.I grabbed f587495 from 9/7/2016. 2.I moved access_token.txt to access_token.bak. 3.I went to OSM and revoked all my OSV certificates. 4.I try $python upload_photos_by_exif.py -p 2016_09_11_16_01_19_712___Mapillary 5.As expected, I receive a new auth request to OSM. I accept the request in OSM. 6.When I hit the enter key to move on after the accepted auth request, I get a stack trace around access_token.txt file.

Traceback (most recent call last):
  File "upload_photos_by_exif.py", line 238, in main
    token_file = open("access_token.txt", "r+")
FileNotFoundError: [Errno 2] No such file or directory: 'access_token.txt'

7.If I run the program again, then I get another request for authentication. The code fails to read the access token and store it properly--I am guessing. 8.I then move the empty access_token.bak file back to access_token.txt. 9.I remove all my OSV auth tokens from OSM. 10.I run the script again and receive.

Fail code:'osv'
Fail to create the sequence
Please restart the script

I had the same problem with the id_file.txt. Until I figured out how to store my OSM user id information in the file by hand, I could not get the script to function. I think your script would work, if I stored the access token in the access_token.txt file. I have not looked up what the file format is for the access_token.txt file. It feels like you are not handling the reading of the missing access_token.txt file properly. Moreover, it feels like you are testing from an established environment verses someone who is trying to use the script for the first time. I also cannot explained how the script worked for sometime, then started to fail.

drkludge commented 7 years ago

Xevib posted a Fail code:'osv' too. It doesn't mean that his issue is the from the same problem. Perhaps these two are related?

bogdan-racasan commented 7 years ago

@drkludge Not really he dose not have an import or a library... For your problem do you put the script in a place with al privileges ?

bogdan-racasan commented 7 years ago

@drkludge can you give me some images please. I think there could be another issue that is based in images exif. Thanks

bogdan-racasan commented 7 years ago

@drkludge what device and app do you use to capture images ? Thanks 👍

drkludge commented 7 years ago

@bogdan-telenav This is not an image issue. I was able to use the Java OSVLoadr application for similar images from the same phone. Here is the link to the images in OSV. I believe the problem is how you are reading and writing the access_token.txt and the id_file.txt files. I had to seed the id_file.txt file with my OSM User Id and User Sequence number to use your application originally.

bogdan-racasan commented 7 years ago

@drkludge I didn't catch this problem on fresh computers with nothing installed than python 3... I think there could be a problem of the privileges on the folder. But as i remember you put all privileges there.

bogdans-telenav commented 5 years ago

We made major changes to our previous version of scripts and we consider this issue as being resolved. If you find any other problem in the new version please report a new issue.