These are chat archives for fossasia/open-event-server

20th
May 2017
Aseem Shrey
@LuD1161
May 20 2017 03:36
I just cloned another copy of the orga server and tried to use the old database , it all runs fine until the moment I don't open localhost:5000 in the browser. This is the error I'm getting :
[2017-05-20 09:00:34 +0000] [6238] [ERROR] Error handling request /
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/async.py", line 52, in handle
    self.handle_request(listener_name, req, client, addr)
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/async.py", line 103, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1994, in __call__
    return self.wsgi_app(environ, start_response)
  File "/root/open-event-orga-server/app/__init__.py", line 79, in __call__
    return self.app(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask_restplus/api.py", line 557, in error_router
    return original_handler(e)
  File "/usr/local/lib/python2.7/dist-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1547, in handle_exception
    return self.finalize_request(handler(e), from_error_handler=True)
  File "/root/open-event-orga-server/app/helpers/flask_ext/error_handlers.py", line 35, in server_error
    return render_template('gentelella/errors/500.html'), 500
  File "/usr/lib/python2.7/dist-packages/flask/templating.py", line 132, in render_template
    ctx.app.update_template_context(context)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 764, in update_template_context
    context.update(func())
  File "/root/open-event-orga-server/app/helpers/flask_ext/jinja/variables.py", line 25, in template_context
    settings=get_settings(),
  File "/root/open-event-orga-server/app/settings/__init__.py", line 15, in get_settings
    s = Setting.query.order_by(desc(Setting.id)).first()
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2659, in first
    ret = list(self[0:1])
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2457, in __getitem__
    return list(res)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2761, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2776, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
    exc_info
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
InternalError: (psycopg2.InternalError) current transaction is aborted, commands ignored until end of transaction block
 [SQL: 'SELECT settings.id AS settings_id, settings.app_environment AS settings_app_environment, settings.app_name AS settings_app_name, settings.tagline AS settings_tagline, settings.secret AS settings_secret, settings.storage_place AS settings_storage_place, settings.aws_key AS settings_aws_key, settings.aws_secret AS settings_aws_secret, settings.aws_bucket_name AS settings_aws_bucket_name, settings.aws_region AS settings_aws_region, settings.gs_key AS settings_gs_key, settings.gs_secret AS settings_gs_secret, settings.gs_bucket_name AS settings_gs_bucket_name, settings.google_client_id AS settings_google_client_id, settings.google_client_secret AS settings_google_client_secret, settings.fb_client_id AS settings_fb_client_id, settings.fb_client_secret AS settings_fb_client_secret, settings.tw_consumer_key AS settings_tw_consumer_key, settings.tw_consumer_secret AS settings_tw_consumer_secret, settings.in_client_id AS settings_in_client_id, settings.in_client_secret AS settings_in_client_secret, settings.stripe_client_id AS settings_stripe_client_id, settings.stripe_secret_key AS settings_stripe_secret_key, settings.stripe_publishable_key AS settings_stripe_publishable_key, settings.paypal_mode AS settings_paypal_mode, settings.paypal_sandbox_username AS settings_paypal_sandbox_username, settings.paypal_sandbox_password AS settings_paypal_sandbox_password, settings.paypal_sandbox_signature AS settings_paypal_sandbox_signature, settings.paypal_live_username AS settings_paypal_live_username, settings.paypal_live_password AS settings_paypal_live_password, settings.paypal_live_signature AS settings_paypal_live_signature, settings.email_service AS settings_email_service, settings.email_from AS settings_email_from, settings.email_from_name AS settings_email_from_name, settings.sendgrid_key AS settings_sendgrid_key, settings.smtp_host AS settings_smtp_host, settings.smtp_username AS settings_smtp_username, settings.smtp_password AS settings_smtp_password, settings.smtp_port AS settings_smtp_port, settings.smtp_encryption AS settings_smtp_encryption, settings.analytics_key AS settings_analytics_key, settings.google_url AS settings_google_url, settings.github_url AS settings_github_url, settings.twitter_url AS settings_twitter_url, settings.support_url AS settings_support_url, settings.facebook_url AS settings_facebook_url, settings.youtube_url AS settings_youtube_url, settings.android_app_url AS settings_android_app_url, settings.web_app_url AS settings_web_app_url \nFROM settings ORDER BY settings.id DESC \n LIMIT %(param_1)s'] [parameters: {'param_1': 1}]
Afroz Ahamad
@enigmaeth
May 20 2017 04:29
Try running database migrations beacuse the error seems to be in running the sql query @LuD1161
Aseem Shrey
@LuD1161
May 20 2017 04:31
@enigmaeth But isn't it the database already created ?
cause I had it running yesterday
Afroz Ahamad
@enigmaeth
May 20 2017 04:38
There might have been changes to the database schema in the new repo that you pulled.. that will need migrations to update the db
See through the error logs again.. there may be some error like <some column> could not be found
Aseem Shrey
@LuD1161
May 20 2017 04:43
@enigmaeth so what do you suggest , I should drop database , recreate it and then populate it , all over again :worried: ?
Afroz Ahamad
@enigmaeth
May 20 2017 04:47
I am not sure. Let's ask @SaptakS , @aviaryan , @mejariamol
Saptak Sengupta
@SaptakS
May 20 2017 04:48
@LuD1161 try doing python manage.py db upgrade
Aseem Shrey
@LuD1161
May 20 2017 04:49
@SaptakS Thanks a lot , you saved a lot of time
Saptak Sengupta
@SaptakS
May 20 2017 04:49
@LuD1161 you always need to do this after some new migration file has been added to change DB chema
Niranjan Rajendran
@niranjan94
May 20 2017 04:50
@LuD1161 all this is well documented in the project README. Why haven't you gone through that yet ?
Saptak Sengupta
@SaptakS
May 20 2017 04:50
schema*
Aseem Shrey
@LuD1161
May 20 2017 04:50
@SaptakS what was it ? database changes ?
Where did it come from , any recent PR ?
Niranjan Rajendran
@niranjan94
May 20 2017 04:50

@SaptakS what was it ? database changes ? Where did it come from , any recent PR ?

Probably

Saptak Sengupta
@SaptakS
May 20 2017 04:51
@LuD1161 if I remember correctly there was not 1 but 2 changes in the DB schema. Please do keep a look on what others are working and how they are working as well...
You can also see changes made in every commit by git log -p
Aseem Shrey
@LuD1161
May 20 2017 04:51
@SaptakS @niranjan94 ok , thanks :smile:
Afroz Ahamad
@enigmaeth
May 20 2017 04:54
@niranjan94 Please assign #3585 to me. It is not assigned to anyone.
Aseem Shrey
@LuD1161
May 20 2017 04:54
blob
Any reason why I'm getting twice the price in sales ?
Cause the ticket price is ₹ 10 and 10 tickets have been sold , which is correctly shown in the top column but while totaling it doubles
Afroz Ahamad
@enigmaeth
May 20 2017 04:56
@SaptakS :+1:
Niranjan Rajendran
@niranjan94
May 20 2017 04:56
@LuD1161 just check the code... If you find a bug, open an issue. I'll assign it to you. You can make a PR
Aseem Shrey
@LuD1161
May 20 2017 04:57
@niranjan94 ok
Aseem Shrey
@LuD1161
May 20 2017 08:56
When I'm trying to import sample downloaded from here : FOSSASIA16.zip
I'm getting internal error :
Celery Error
[2017-05-20 14:12:15,424: WARNING/Worker-2] /usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py:2029: SAWarning: Usage of the 'collection append' operation is not currently supported within the execution stage of the flush process. Results may not be consistent.  Consider using alternative event listeners or connection-level operations instead.
  % method)
[2017-05-20 14:12:15,424: WARNING/Worker-2] /usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py:2029: SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent.  Consider using alternative event listeners or connection-level operations instead.
  % method)
[2017-05-20 14:12:15,618: WARNING/Worker-2] Traceback (most recent call last):
  File "/root/open-event-orga-server (another copy)/app/api/helpers/tasks.py", line 27, in import_event_task
    result = import_event_task_base(self, file, source_type, creator_id)
  File "/root/open-event-orga-server (another copy)/app/api/imports.py", line 54, in import_event_task_base
    new_event = import_event_json(task_handle, file_path)
  File "/root/open-event-orga-server (another copy)/app/api/helpers/import_helpers.py", line 330, in import_event_json
    raise make_error('event', er=e)
  File "/root/open-event-orga-server (another copy)/app/api/helpers/import_helpers.py", line 113, in make_error
    if not er.code:
AttributeError: 'exceptions.AssertionError' object has no attribute 'code'
[2017-05-20 14:12:15,633: WARNING/Worker-2] /usr/lib/python2.7/dist-packages/sqlalchemy/orm/dependency.py:773: SAWarning: Object of type <User> not in session, add operation along 'UsersEventsRoles.user' won't proceed
  (mapperutil.state_class_str(child), operation, self.prop))
[2017-05-20 14:12:15,687: WARNING/Worker-2] Sendgrid key not defined
[2017-05-20 14:13:09,837: WARNING/Worker-4] /usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py:2029: SAWarning: Usage of the 'collection append' operation is not currently supported within the execution stage of the flush process. Results may not be consistent.  Consider using alternative event listeners or connection-level operations instead.
  % method)
[2017-05-20 14:13:09,837: WARNING/Worker-4] /usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py:2029: SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent.  Consider using alternative event listeners or connection-level operations instead.
  % method)
[2017-05-20 14:13:09,883: WARNING/Worker-4] Traceback (most recent call last):
  File "/root/open-event-orga-server (another copy)/app/api/helpers/tasks.py", line 27, in import_event_task
    result = import_event_task_base(self, file, source_type, creator_id)
  File "/root/open-event-orga-server (another copy)/app/api/imports.py", line 54, in import_event_task_base
    new_event = import_event_json(task_handle, file_path)
  File "/root/open-event-orga-server (another copy)/app/api/helpers/import_helpers.py", line 330, in import_event_json
    raise make_error('event', er=e)
  File "/root/open-event-orga-server (another copy)/app/api/helpers/import_helpers.py", line 113, in make_error
    if not er.code:
AttributeError: 'exceptions.AssertionError' object has no attribute 'code'
[2017-05-20 14:13:09,884: WARNING/Worker-4] /usr/lib/python2.7/dist-packages/sqlalchemy/orm/dependency.py:773: SAWarning: Object of type <User> not in session, add operation along 'UsersEventsRoles.user' won't proceed
  (mapperutil.state_class_str(child), operation, self.prop))
[2017-05-20 14:13:09,926: WARNING/Worker-4] Sendgrid key not defined
Output on terminal
[2017-05-20 14:12:39 +0000] [21558] [INFO] Worker reloading: /root/open-event-orga-server (another copy)/app/views/users/events.py modified
[2017-05-20 14:12:39 +0000] [21558] [INFO] Worker exiting (pid: 21558)
[2017-05-20 14:12:39 +0000] [25426] [INFO] Booting worker with pid: 25426
get_file_from_request() INVOKED. We have: request.files = ImmutableMultiDict([('file', <FileStorage: u'FOSSASIA16.zip' ('application/zip')>)])
Could it be that the sample fails, due to the database schema changes ?
Shubham Padia
@shubham-padia
May 20 2017 14:35
@niranjan94 What will be our approach in moving towards the new api, will a new branch be created for that or some other approach . As events will be requiring the platform, I don't think we can completely phase out the existing application and api completely as discussed in the meetup call until the frontend and new api are ready.
Niranjan Rajendran
@niranjan94
May 20 2017 14:37
@shubham-padia we will be starting with a new branch. Since eventyay will continue to require hotfixes.
Shubham Padia
@shubham-padia
May 20 2017 14:39
:+1: , any plans on when we might start working on the new branch ?
Niranjan Rajendran
@niranjan94
May 20 2017 14:40
Yep. I wanted to get a few of the current high priority bug-fixes out.
Shubham Padia
@shubham-padia
May 20 2017 14:41
makes sense :+1:
Niranjan Rajendran
@niranjan94
May 20 2017 14:42
In the mean time .. I'll get a branch and heroku instance ready
Shubham Padia
@shubham-padia
May 20 2017 14:44
Okay, in that branch we will be removing the existing api completely, right?
Niranjan Rajendran
@niranjan94
May 20 2017 14:44
Yes. The API will be removed completely.
But let the UI stay untouched.
Shubham Padia
@shubham-padia
May 20 2017 14:46
:+1:
I was thinking if we had some basic groundwork laid for the api before the coding period begins, it would be a great headstart for us. Once you create the branch, it would be great if we can open some relevant sub issues too for laying the groundwork.
Niranjan Rajendran
@niranjan94
May 20 2017 14:50
That's a good idea :) ...
Will create and let you know
Shubham Padia
@shubham-padia
May 20 2017 14:50
Thanks !!
Niranjan Rajendran
@niranjan94
May 20 2017 14:51
Branch ready.
You can create sub-issues for the json-api issue
And send PRs to the nextgen branch.
Shubham Padia
@shubham-padia
May 20 2017 14:52
Okay :smile: .
I'll research a little more on flask-rest-jsonapi and open the sub-issues by tomorrow
Niranjan Rajendran
@niranjan94
May 20 2017 14:54
Sure
Mario Behling
@mariobehling
May 20 2017 15:41
Your blog posts for the first week of the bonding period are still missing. Please add them to the spreadsheet that was shared with you for review! Please ensure your blog posts follow the guidelines at https://docs.google.com/document/d/1E4kNgrOSw64R2IAG45JSIgQL9Yxia-mG2dqlRcrUo-U/edit#heading=h.jb3la4u20kec
@CosmicCoder96 @enigmaeth @anantprsd5 @anu-007 @arp95 @LuD1161 @chiragw15 @geekyd @fluepke @SarishiNoHara @harshit98 @harshitagupta30 @iamareebjamal @jithinbp @jyoth1raditya @kavithaenair @madhavrathi @magdalenesuo @mayank408 @mejariamol @mohitmanuja @nikhilrayaprolu @CloudyPadmal @betterclever @Princu7 @rohanagarwal94 @Ronak-59 @shubham-padia @SkrPl @Marauderer97 @Subhankar29 @meets2tarun @uday96 @utkarshnath @vinaysajjanapu @viveksb007
Varun Kumar
@heysadboy
May 20 2017 21:54
I have been trying to create event but after a while it stops working