jackm / kijiji-manager

App for viewing, posting, reposting, and deleting your Kijiji ads
https://pypi.org/project/kijiji-manager/
MIT License
52 stars 11 forks source link

Bugs/Errors? #44

Closed jijiow closed 2 years ago

jijiow commented 2 years ago

Currently been using this for sometime w no issue and been having many issues since the image API has been updated. This is the error being spat out when uploading an ad with two images. 1.5MB per image. Would love the program to be as flawless as last time so I'd be showing logs if issues were to occur. The fear of clicking repost all of my ads and the app crashing is scary as the work to get the ads up again takes time.

127.0.0.1 - - [13/Jul/2022 15:08:32] "POST /post HTTP/1.1" 200 -
127.0.0.1 - - [13/Jul/2022 15:08:32] "GET /static/style2.css HTTP/1.1" 304 -
127.0.0.1 - - [13/Jul/2022 15:08:32] "GET /loc?location1=9004 HTTP/1.1" 200 -
127.0.0.1 - - [13/Jul/2022 15:08:33] "GET /loc?location1=9004&location2=1700272 HTTP/1.1" 200 -
[2022-07-13 15:12:11,913] ERROR in app: Exception on /post [POST]
Traceback (most recent call last):
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpcore\_exceptions.py", line 8, in map_exceptions
    yield
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpcore\backends\sync.py", line 26, in read
    return self._sock.recv(max_bytes)
  File "C:\Users\Justin\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1258, in recv
    return self.read(buflen)
  File "C:\Users\Justin\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1131, in read
    return self._sslobj.read(len)
TimeoutError: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpx\_transports\default.py", line 60, in map_httpcore_exceptions
    yield
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpx\_transports\default.py", line 187, in handle_request
    resp = self._pool.handle_request(req)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpcore\_sync\connection_pool.py", line 248, in handle_request
    raise exc
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpcore\_sync\connection_pool.py", line 232, in handle_request
    response = connection.handle_request(request)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpcore\_sync\connection.py", line 94, in handle_request
    return self._connection.handle_request(request)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpcore\_sync\http11.py", line 102, in handle_request
    raise exc
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpcore\_sync\http11.py", line 81, in handle_request
    ) = self._receive_response_headers(**kwargs)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpcore\_sync\http11.py", line 143, in _receive_response_headers
    event = self._receive_event(timeout=timeout)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpcore\_sync\http11.py", line 172, in _receive_event
    data = self._network_stream.read(
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpcore\backends\sync.py", line 24, in read
    with map_exceptions(exc_map):
  File "C:\Users\Justin\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpcore\_exceptions.py", line 12, in map_exceptions
    raise to_exc(exc)
httpcore.ReadTimeout: The read operation timed out

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

Traceback (most recent call last):
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\flask\app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\flask\app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\flask\app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\flask\app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\flask_login\utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\views\ad.py", line 273, in post
    'pic:pictures': create_picture_payload(form.data),
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\flask_login\utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\views\ad.py", line 441, in create_picture_payload
    link = kijiji_api.upload_image(current_user.id, current_user.token, value)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\kijijiapi.py", line 258, in upload_image
    r = self.session.post(api_endpoint, headers=headers, files=files)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpx\_client.py", line 1116, in post
    return self.request(
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpx\_client.py", line 802, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpx\_client.py", line 889, in send
    response = self._send_handling_auth(
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpx\_client.py", line 917, in _send_handling_auth
    response = self._send_handling_redirects(
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpx\_client.py", line 954, in _send_handling_redirects
    response = self._send_single_request(request)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpx\_client.py", line 990, in _send_single_request
    response = transport.handle_request(request)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpx\_transports\default.py", line 186, in handle_request
    with map_httpcore_exceptions():
  File "C:\Users\Justin\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\Justin\Desktop\kijiji-manager-master\kijiji_manager\venv\lib\site-packages\httpx\_transports\default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ReadTimeout: The read operation timed out
127.0.0.1 - - [13/Jul/2022 15:12:11] "POST /post HTTP/1.1" 500 -
dudududodododedede commented 2 years ago

I think it's the same timeout issue as reported in https://github.com/jackm/kijiji-manager/issues/35

jackm commented 2 years ago

The fear of clicking repost all of my ads and the app crashing is scary as the work to get the ads up again takes time.

Reposting an existing ad does not actually re-upload any image files - it simply reuses the existing hosted image URLs when posting the ad again.

Even if an ad repost fails half way through (i.e. original ad is deleted, but reposted ad didn't finish), you can still manually post the original ad again using the ad payload file (.xml) kept in your instance folder.

asyed03 commented 2 years ago

On another note, I made a change that will allow existing ads to be reposted by downloading and parsing xml files of the existing ad and then reposting. I'm not that familiar with git. How do I make a request to add this change?

jackm commented 2 years ago

On another note, I made a change that will allow existing ads to be reposted by downloading and parsing xml files of the existing ad and then reposting. I'm not that familiar with git. How do I make a request to add this change?

Github does allow users to create forks, branches, and edit files all on the Github site itself so you don't necessarily have to know how to use all of git to make a pull request.

The other alternative is to just post the code changes and I can integrate them into the repo.

prgrm commented 2 years ago

The other alternative is to just post the code changes and I can integrate them into the repo.

That would be wonderful @jackm , @asyed03 did post the code here https://github.com/jackm/kijiji-manager/issues/17#issuecomment-1259699734

jackm commented 2 years ago

Closing as duplicate of #34