Closed dilpreetsio closed 6 years ago
Not a bug, maybe an issue from the side of heroku, please try again. https://httpstatuses.com/503
@shubham-padia Okay but it does not happen when we add logo-url
, the problem also persists for custom-placeholder API
I don't get it :sweat_smile: , please rephrase :)
Error 503 only occurs when we try to add original-image-url
, however when we try to add logo-url
in events API it works. The same problem also occurs in custom-placeholder API. Its strange!
@shubham-padia not exactly an heroku server problem. This is the heroku logs.
2017-08-19T07:35:16.454003+00:00 app[web.1]: Exception on /v1/events/3c4b51ec [PATCH]
2017-08-19T07:35:16.453927+00:00 app[web.1]: im = Image.open(image_file)
2017-08-19T07:35:16.454004+00:00 app[web.1]: Traceback (most recent call last):
2017-08-19T07:35:16.453928+00:00 app[web.1]: % (filename if filename else fp))
2017-08-19T07:35:16.454004+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
2017-08-19T07:35:16.454005+00:00 app[web.1]: response = self.full_dispatch_request()
2017-08-19T07:35:16.454005+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
2017-08-19T07:35:16.454005+00:00 app[web.1]: rv = self.handle_user_exception(e)
2017-08-19T07:35:16.454006+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
2017-08-19T07:35:16.454006+00:00 app[web.1]: return cors_after_request(app.make_response(f(*args, **kwargs)))
2017-08-19T07:35:16.454007+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
2017-08-19T07:35:16.454007+00:00 app[web.1]: reraise(exc_type, exc_value, tb)
2017-08-19T07:35:16.454007+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
2017-08-19T07:35:16.454008+00:00 app[web.1]: rv = self.dispatch_request()
2017-08-19T07:35:16.454008+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
2017-08-19T07:35:16.454008+00:00 app[web.1]: return self.view_functions[rule.endpoint](**req.view_args)
2017-08-19T07:35:16.454009+00:00 app[web.1]: File "/app/.heroku/src/flask-rest-jsonapi/flask_rest_jsonapi/api.py", line 133, in decorated
2017-08-19T07:35:16.454009+00:00 app[web.1]: return self.check_permissions(view, view_args, view_kwargs, *args, **kwargs)
2017-08-19T07:35:16.454009+00:00 app[web.1]: File "/app/app/api/helpers/permission_manager.py", line 436, in permission_manager
2017-08-19T07:35:16.454010+00:00 app[web.1]: return permissions[args[0]](view, view_args, view_kwargs, *args, **kwargs)
2017-08-19T07:35:16.454010+00:00 app[web.1]: File "/app/app/api/helpers/permissions.py", line 43, in decorator
2017-08-19T07:35:16.454011+00:00 app[web.1]: return fn(*args, **kwargs)
2017-08-19T07:35:16.454011+00:00 app[web.1]: File "/app/app/api/helpers/permission_manager.py", line 58, in is_coorganizer
2017-08-19T07:35:16.454011+00:00 app[web.1]: return view(*view_args, **view_kwargs)
2017-08-19T07:35:16.454012+00:00 app[web.1]: File "/app/.heroku/src/flask-rest-jsonapi/flask_rest_jsonapi/decorators.py", line 32, in wrapper
2017-08-19T07:35:16.454012+00:00 app[web.1]: return func(*args, **kwargs)
2017-08-19T07:35:16.454013+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/views.py", line 84, in view
2017-08-19T07:35:16.454013+00:00 app[web.1]: return self.dispatch_request(*args, **kwargs)
2017-08-19T07:35:16.454013+00:00 app[web.1]: File "/app/.heroku/src/flask-rest-jsonapi/flask_rest_jsonapi/resource.py", line 68, in dispatch_request
2017-08-19T07:35:16.454014+00:00 app[web.1]: response = method(*args, **kwargs)
2017-08-19T07:35:16.454014+00:00 app[web.1]: File "/app/.heroku/src/flask-rest-jsonapi/flask_rest_jsonapi/decorators.py", line 56, in wrapper
2017-08-19T07:35:16.454014+00:00 app[web.1]: return func(*args, **kwargs)
2017-08-19T07:35:16.454015+00:00 app[web.1]: File "/app/.heroku/src/flask-rest-jsonapi/flask_rest_jsonapi/resource.py", line 300, in patch
2017-08-19T07:35:16.454015+00:00 app[web.1]: self._data_layer.update_object(obj, data, kwargs)
2017-08-19T07:35:16.454015+00:00 app[web.1]: File "/app/.heroku/src/flask-rest-jsonapi/flask_rest_jsonapi/data_layers/alchemy.py", line 126, in update_object
2017-08-19T07:35:16.454016+00:00 app[web.1]: self.before_update_object(obj, data, view_kwargs)
2017-08-19T07:35:16.454016+00:00 app[web.1]: File "/app/app/api/events.py", line 301, in before_update_object
2017-08-19T07:35:16.454016+00:00 app[web.1]: uploaded_images = create_save_image_sizes(data['original_image_url'], 'event', event.id)
2017-08-19T07:35:16.454017+00:00 app[web.1]: File "/app/app/api/helpers/files.py", line 156, in create_save_image_sizes
2017-08-19T07:35:16.454017+00:00 app[web.1]: 'original_image_url': create_save_resized_image(image_file, 0, 0, 0, original_upload_path, resize=False),
2017-08-19T07:35:16.454018+00:00 app[web.1]: File "/app/app/api/helpers/files.py", line 77, in create_save_resized_image
2017-08-19T07:35:16.454018+00:00 app[web.1]: im = Image.open(image_file)
2017-08-19T07:35:16.454018+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/PIL/Image.py", line 2319, in open
2017-08-19T07:35:16.454019+00:00 app[web.1]: % (filename if filename else fp))
2017-08-19T07:35:16.454019+00:00 app[web.1]: IOError: cannot identify image file <cStringIO.StringI object at 0x7f35b3349f10>
@poush @magdalenesuo @enigmaeth please look into this. I face the same issue in local system also.
@geekyd Testing on my local system. Can you share the sample orginal_image_url, the one you are trying?
Done able to create Event with this image,
{
"data": {
"relationships": {
"organizers": {
"links": {
"self": "/v1/events/22/relationships/organizers",
"related": "/v1/users"
}
},
"ticket-tags": {
"links": {
"self": "/v1/events/22/relationships/ticket-tags",
"related": "/v1/events/22/ticket-tags"
}
},
"speakers-call": {
"links": {
"self": "/v1/events/22/relationships/speakers-call",
"related": "/v1/events/22/speakers-call"
}
},
"tax": {
"links": {
"self": "/v1/events/22/relationships/tax",
"related": "/v1/events/22/tax"
}
},
"coorganizers": {
"links": {
"self": "/v1/events/22/relationships/coorganizers",
"related": "/v1/users"
}
},
"session-types": {
"links": {
"self": "/v1/events/22/relationships/session-types",
"related": "/v1/events/22/session-types"
}
},
"microlocations": {
"links": {
"self": "/v1/events/22/relationships/microlocations",
"related": "/v1/events/22/microlocations"
}
},
"orders": {
"links": {
"self": "/v1/events/22/relationships/orders",
"related": "/v1/events/22/orders"
}
},
"speakers": {
"links": {
"self": "/v1/events/22/relationships/speakers",
"related": "/v1/events/22/speakers"
}
},
"event-copyright": {
"links": {
"self": "/v1/events/22/relationships/event-copyright",
"related": "/v1/events/22/event-copyright"
}
},
"attendees": {
"links": {
"self": "/v1/events/22/relationships/attendees",
"related": "/v1/events/22/attendees"
}
},
"custom-forms": {
"links": {
"self": "/v1/events/22/relationships/custom-forms",
"related": "/v1/events/22/custom-forms"
}
},
"track-organizers": {
"links": {
"self": "/v1/events/22/relationships/track-organizers",
"related": "/v1/users"
}
},
"event-type": {
"links": {
"self": "/v1/events/22/relationships/event-type",
"related": "/v1/events/22/event-type"
}
},
"discount-codes": {
"links": {
"self": "/v1/events/22/relationships/discount-codes",
"related": "/v1/events/22/discount-codes"
}
},
"event-sub-topic": {
"links": {
"self": "/v1/events/22/relationships/event-sub-topic",
"related": "/v1/events/22/event-sub-topic"
}
},
"sessions": {
"links": {
"self": "/v1/events/22/relationships/sessions",
"related": "/v1/events/22/sessions"
}
},
"event-topic": {
"links": {
"self": "/v1/events/22/relationships/event-topic",
"related": "/v1/events/22/event-topic"
}
},
"registrars": {
"links": {
"self": "/v1/events/22/relationships/registrars",
"related": "/v1/users"
}
},
"sponsors": {
"links": {
"self": "/v1/events/22/relationships/sponsors",
"related": "/v1/events/22/sponsors"
}
},
"tracks": {
"links": {
"self": "/v1/events/22/relationships/tracks",
"related": "/v1/events/22/tracks"
}
},
"access-codes": {
"links": {
"self": "/v1/events/22/relationships/access-codes",
"related": "/v1/events/22/access-codes"
}
},
"role-invites": {
"links": {
"self": "/v1/events/22/relationships/role-invites",
"related": "/v1/events/22/role-invites"
}
},
"tickets": {
"links": {
"self": "/v1/events/22/relationships/tickets",
"related": "/v1/events/22/tickets"
}
},
"social-links": {
"links": {
"self": "/v1/events/22/relationships/social-links",
"related": "/v1/events/22/social-links"
}
},
"moderators": {
"links": {
"self": "/v1/events/22/relationships/moderators",
"related": "/v1/users"
}
},
"event-invoices": {
"links": {
"self": "/v1/events/22/relationships/event-invoices",
"related": "/v1/events/22/event-invoices"
}
}
},
"attributes": {
"payment-country": null,
"paypal-email": null,
"code-of-conduct": "",
"schedule-published-on": null,
"payment-currency": null,
"organizer-description": "",
"is-map-shown": false,
"original-image-url": "http://localhost/static/media/events/22/original/YjRJVVR5Z2/68ab8252-2c95-4f98-8992-c8bb0d309ac7.jpg",
"onsite-details": null,
"organizer-name": null,
"longitude": null,
"large-image-url": "http://localhost/static/media/events/22/large/UkZ0Vzdidm/8169625e-5ebf-4c76-afa8-25144c90fdc3.jpg",
"timezone": "Asia/Kolkata",
"can-pay-onsite": false,
"deleted-at": null,
"ticket-url": null,
"can-pay-by-paypal": false,
"location-name": null,
"is-sponsors-enabled": false,
"is-sessions-speakers-enabled": false,
"privacy": "public",
"has-organizer-info": false,
"state": "Draft",
"latitude": null,
"starts-at": "2002-05-30T04:00:10+00:00",
"searchable-location-name": null,
"is-ticketing-enabled": true,
"can-pay-by-cheque": false,
"description": "",
"pentabarf-url": null,
"xcal-url": null,
"logo-url": null,
"can-pay-by-bank": false,
"is-tax-enabled": false,
"icon-image-url": "http://localhost/static/media/events/22/icon/WW9JM3k2Ym/42e319f4-9707-48ab-bd8a-51845995b395.jpg",
"ical-url": null,
"name": "New Event",
"bank-details": null,
"thumbnail-image-url": "http://localhost/static/media/events/22/thumbnail/TkkyMjlXWj/4ed4fb87-84e1-4553-a18c-b0ad138f9e4a.jpg",
"created-at": "2017-08-19T10:29:26.159338+00:00",
"can-pay-by-stripe": false,
"cheque-details": null,
"external-event-url": null,
"identifier": "240646f6",
"ends-at": "2022-05-30T04:00:10+00:00"
},
"type": "event",
"id": "22",
"links": {
"self": "/v1/events/22"
}
},
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "/v1/events/22"
}
}
@SaptakS Try to reproduce it. I'm not able to do reproduce it here.
@poush you won't be able to reproduce in your local system if you are using management command. If you use nginx in your server with same configuration as in heroku, then you might. This is mainly being caused because of timeout to download the image from the url. Please implement it using celery. @fossasia/open-event-server-devs please look into this.
@poush @shubham-padia For the given heroku logs, the problem was I guess fixed in #4496 . Please check. Thanks.
Seems to be fixed. Please reopen and comment if anything is left.
I'm submitting a ... (check one with "x")
API Endpoint
Payload
ERROR