indictranstech / GCAL

Other
8 stars 19 forks source link

getting error while install-app #11

Open rahulmr opened 8 years ago

rahulmr commented 8 years ago

I am getting below error with bench install-app gcal

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/rahul/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/rahul/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/rahul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/rahul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/rahul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/rahul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/rahul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/rahul/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/rahul/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/rahul/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/rahul/frappe-bench/apps/frappe/frappe/commands.py", line 217, in migrate
    sync_fixtures()
  File "/home/rahul/frappe-bench/apps/frappe/frappe/utils/fixtures.py", line 19, in sync_fixtures
    import_doc(frappe.get_app_path(app, "fixtures", fname), ignore_links=True, overwrite=True)
  File "/home/rahul/frappe-bench/apps/frappe/frappe/core/page/data_import_tool/data_import_tool.py", line 94, in import_doc
    frappe.modules.import_file.import_file_by_path(f, data_import=True, force=True, pre_process=pre_process)
  File "/home/rahul/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 54, in import_file_by_path
    import_doc(doc, force=force, data_import=data_import, pre_process=pre_process)
  File "/home/rahul/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 122, in import_doc
    doc.insert()
  File "/home/rahul/frappe-bench/apps/frappe/frappe/model/document.py", line 210, in insert
    self.run_post_save_methods()
  File "/home/rahul/frappe-bench/apps/frappe/frappe/model/document.py", line 607, in run_post_save_methods
    self.run_method("on_update")
  File "/home/rahul/frappe-bench/apps/frappe/frappe/model/document.py", line 551, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/rahul/frappe-bench/apps/frappe/frappe/model/document.py", line 706, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/rahul/frappe-bench/apps/frappe/frappe/model/document.py", line 689, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/rahul/frappe-bench/apps/frappe/frappe/model/document.py", line 545, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/rahul/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 39, in on_update
    validate_fields_for_doctype(self.dt)
  File "/home/rahul/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 221, in validate_fields_for_doctype
    validate_fields(frappe.get_meta(doctype, cached=False))
  File "/home/rahul/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 380, in validate_fields
    check_unique_and_text(d)
  File "/home/rahul/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 305, in check_unique_and_text
    doctype=d.parent, fieldname=d.fieldname))
  File "/home/rahul/frappe-bench/apps/frappe/frappe/database.py", line 146, in sql
    self._cursor.execute(query)
  File "/home/rahul/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/rahul/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, "Unknown column 'gcal_id' in 'field list'")
kossanah commented 8 years ago

I tested with lastest erp VM erpnext 6.16.2 frappe 6.17.3

frappe@erpnext:~/frappe-bench$ bench install-app gcal Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in run_module_as_main "main_", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in run_code exec code in run_globals File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in main() File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main click.Group(commands=commands)(prog_name='bench') File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in _call return self.main(args, kwargs) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke return callback(args, kwargs) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), args, kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func ret = f(frappe._dict(ctx.obj), args, kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 163, in install_app _install_app(app, verbose=context.verbose) File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 93, in install_app app_hooks = frappe.get_hooks(app_name=name) File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 701, in get_hooks hooks = dict(load_app_hooks(app_name)) File "/home/frappe/frappe-bench/apps/frappe/frappe/_init.py", line 674, in load_app_hooks app_hooks = get_module(app + ".hooks") File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 590, in get_module return importlib.import_module(modulename) File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module import(name) ImportError: No module named gcal.hooks frappe@erpnext:~/frappe-bench$

rahulmr commented 8 years ago

Hope, you have installed the bench using a non root user and using sudo command. This comes because of redis cache server not started or configured properly as far as I understood. Refer this wiki. While this is the link which helped me. What I did is used bench get-app gcal ...its..url.. and then installed it from the Frappe Desk website Installer.

kossanah commented 8 years ago

Thanks removed it and reinstalled it works now. moving ahead to configure it

rahulmr commented 8 years ago

You are welcome. Happy configuration.

kossanah commented 8 years ago

New Error when I install and same error when I run migrate

root@erp:/home/frappe/frappe-bench# bench migrate Migrating site1.local Updating frappe : [========================================] Updating erpnext : [========================================] Updating gcal : [========================================] Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in main() File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main click.Group(commands=commands)(prog_name='bench') File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 610, in call return self.main(_args, _kwargs) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 590, in main rv = self.invoke(ctx) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 936, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 936, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 782, in invoke return ctx.invoke(self.callback, _ctx.params) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 416, in invoke return callback(_args, _kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func ret = f(frappe._dict(ctx.obj), args, _kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 217, in migrate sync_fixtures() File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/fixtures.py", line 19, in sync_fixtures import_doc(frappe.get_app_path(app, "fixtures", fname), ignore_links=True, overwrite=True) File "/home/frappe/frappe-bench/apps/frappe/frappe/core/page/data_import_tool/data_import_tool.py", line 94, in import_doc frappe.modules.import_file.import_file_by_path(f, data_import=True, force=True, pre_process=pre_process) File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 54, in import_file_by_path import_doc(doc, force=force, data_import=data_import, pre_process=pre_process) File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 122, in import_doc doc.insert() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 210, in insert self.run_post_save_methods() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 607, in run_post_save_methods self.run_method("on_update") File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 551, in run_method return Document.hook(fn)(self, _args, _kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 706, in composer return composed(self, method, _args, _kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 689, in runner add_to_return_value(self, fn(self, _args, _kwargs)) File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 545, in fn = lambda self, _args, _kwargs: getattr(self, method)(_args, _kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 39, in on_update validate_fields_for_doctype(self.dt) File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 221, in validate_fields_for_doctype validate_fields(frappe.get_meta(doctype, cached=False)) File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 380, in validate_fields check_unique_and_text(d) File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 305, in check_unique_and_text doctype=d.parent, fieldname=d.fieldname)) File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 146, in sql self._cursor.execute(query) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute self.errorhandler(self, exc, value) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.OperationalError: (1054, "Unknown column 'gcal_id' in 'field list'") root@erp:/home/frappe/frappe-bench#

kossanah commented 8 years ago

I discovered that after running bench migrate, although It generated error. Installation went fine

kossanah commented 8 years ago

Sync is not working

Traceback (innermost last): File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 72, in application response = frappe.api.handle() File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 50, in handle return frappe.handler.handle() File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 77, in handle execute_cmd(cmd) File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 94, in execute_cmd ret = frappe.call(method, _frappe.form_dict) File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 788, in call return fn(_args, _newargs) File "/home/frappe/frappe-bench/apps/gcal/gcal/gcal_sync/doctype/sync_configuration/sync_configuration.py", line 128, in get_credentials sync_google_calendar(credentials) File "/home/frappe/frappe-bench/apps/gcal/gcal/tasks.py", line 54, in sync_google_calendar eventsResult = get_gcal_events(credentials) File "/home/frappe/frappe-bench/apps/gcal/gcal/tasks.py", line 70, in get_gcal_events calendarId='primary', timeMin=now).execute() File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/oauth2client/util.py", line 140, in positional_wrapper return wrapped(_args, **kwargs) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/googleapiclient/http.py", line 729, in execute raise HttpError(resp, content, uri=self.uri) HttpError:

rahulmr commented 8 years ago

Reproducible at my end as well. So reopening it.