Remove GCalendar module

Hi, anyone able to help remove google calendar from erpnext?

I use the command : bench --site site1.local uninstall-app gcalendar

but get the error message :

frappe.exceptions.LinkExistsError: Cannot delete or cancel because Module Def Gcalendar is linked with Data Migration Plan GCalendar Sync

please note this is a production site and I am having trouble now importing SQL to backup because of the GCalendar module. So I need to ensure I do not break the site when I remove the Calendar.

Sorry but could you explain your situation further?
What version of your Apps are installed in your “Live” or “Production” instance and what version’s are installed in your “Backup” or “Offline” version?

Hi,

Thanks for your reply. I am unsure version of erpnext at moment, as nginx is not running after latest OS automatic update stopping erpnext from starting.

bench --version returns:
4.1.0

Bench update shows:

v10.1.65 -> v10.1.65

  • [new tag] v11.0.3-beta.26 -> v11.0.3-beta.26

I am running on Ubuntu 16.04. I have not built the backup server as yet. I had the backup server running a while ago but it would not import the SQL backup as the gcalendar module was present. I was just about to sort this out when I got the error below yesterday:

sudo nginx -t
nginx: [emerg] dlopen() “/usr/share/nginx/modules/ngx_http_modsecurity_module.so” failed (/usr/share/nginx/modules/ngx_http_modsecurity_module.so: cannot open shared object file: No such file or directory) in /etc/nginx/nginx.conf:8
nginx: configuration file /etc/nginx/nginx.conf test failed

More detail as follows:

sudo apt install nginx
Reading package lists… Done
Building dependency tree
Reading statbench --version
4.1.0e information… Done
nginx is already the newest version (1.10.3-0ubuntu0.16.04.3).
The following packages were automatically installed and are no longer required:
linux-headers-4.15.0-36 linux-headers-4.15.0-36-generic linux-image-4.15.0-36-generic linux-modules-4.15.0-36-generic linux-modules-extra-4.15.0-36-generic
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up nginx-core (1.10.3-0ubuntu0.16.04.3) …
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
invoke-rc.d: initscript nginx, action “start” failed.
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2018-12-02 09:34:54 AEST; 4ms ago
Process: 20341 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Dec 02 09:34:54 kombo-erp systemd[1]: Starting A high performance web server and a reverse proxy server…
Dec 02 09:34:54 kombo-erp nginx[20341]: nginx: [emerg] dlopen() “/usr/share/nginx/modules/ngx_http_modsecurity_module.so” failed (/usr/share/nginx/m…inx.conf:8
Dec 02 09:34:54 kombo-erp nginx[20341]: nginx: configuration file /etc/nginx/nginx.conf test failed
Dec 02 09:34:54 kombo-erp systemd[1]: nginx.service: Control process exited, code=exited status=1
Dec 02 09:34:54 kombo-erp systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Dec 02 09:34:54 kombo-erp systemd[1]: nginx.service: Unit entered failed state.
Dec 02 09:34:54 kombo-erp systemd[1]: nginx.service: Failed with result ‘exit-code’.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package nginx-core (–configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
nginx depends on nginx-core (>= 1.10.3-0ubuntu0.16.04.3) | nginx-full (>= 1.10.3-0ubuntu0.16.04.3) | nginx-light (>= 1.10.3-0ubuntu0.16.04.3) | nginx-extras (>= 1.10.3-0ubuntu0.16.04.3); however:
Package nginx-core is not configured yet.
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not installed.
nginx depends on nginx-core (<< 1.10.3-0ubuntu0.16.04.3.1~) | nginx-full (<< 1.10.3-0ubuntu0.16.04.3.1~) | nginx-light (<< 1.10.3-0ubuntu0.16.04.3.1~) | nginx-extras (<< 1.10.3-0ubuntu0.16.04.3.1~); however:
Package nginx-core is not configured yet.
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not installed.

dpkg: error processing package nginx (–configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
nginx-core
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have commented out the shared lib in the nginx.conf file and it now returns the error below:

journalctl -xe
– Subject: Unit nginx.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit nginx.service has failed.

– The result is failed.
Dec 02 09:59:59 kombo-erp systemd[1]: nginx.service: Unit entered failed state.
Dec 02 09:59:59 kombo-erp systemd[1]: nginx.service: Failed with result ‘exit-code’.
Dec 02 09:59:59 kombo-erp polkitd(authority=local)[1338]: Unregistered Authentication A
Dec 02 10:00:01 kombo-erp CRON[22709]: pam_unix(cron:session): session opened for user
Dec 02 10:00:01 kombo-erp CRON[22710]: (frappe) CMD (cd /home/frappe/frappe-bench && /
Dec 02 10:00:01 kombo-erp CRON[22709]: pam_unix(cron:session): session closed for user
Dec 02 10:00:15 kombo-erp polkitd(authority=local)[1338]: Registered Authentication Age
Dec 02 10:00:15 kombo-erp gnome-session[4999]: Gtk-Message: GtkDialog mapped without a
Dec 02 10:00:20 kombo-erp polkitd(authority=local)[1338]: Operator of unix-session:c2 s
Dec 02 10:00:20 kombo-erp systemd[1]: Starting A high performance web server and a reve
– Subject: Unit nginx.service has begun start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit nginx.service has begun starting up.
Dec 02 10:00:21 kombo-erp nginx[22760]: nginx: [emerg] duplicate upstream "frappe-bench
Dec 02 10:00:21 kombo-erp nginx[22760]: nginx: configuration file /etc/nginx/nginx.conf
Dec 02 10:00:21 kombo-erp systemd[1]: nginx.service: Control process exited, code=exite
Dec 02 10:00:21 kombo-erp systemd[1]: Failed to start A high performance web server and
– Subject: Unit nginx.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit nginx.service has failed.

– The result is failed.
Dec 02 10:00:21 kombo-erp systemd[1]: nginx.service: Unit entered failed state.
Dec 02 10:00:21 kombo-erp systemd[1]: nginx.service: Failed with result ‘exit-code’.
Dec 02 10:00:21 kombo-erp polkitd(authority=local)[1338]: Unregistered Authentication A
lines 1326-1361/1361 (END)
– Subject: Unit nginx.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit nginx.service has failed.

– The result is failed.
Dec 02 09:59:59 kombo-erp systemd[1]: nginx.service: Unit entered failed state.
Dec 02 09:59:59 kombo-erp systemd[1]: nginx.service: Failed with result ‘exit-code’.
Dec 02 09:59:59 kombo-erp polkitd(authority=local)[1338]: Unregistered Authentication Ag
Dec 02 10:00:01 kombo-erp CRON[22709]: pam_unix(cron:session): session opened for user f
Dec 02 10:00:01 kombo-erp CRON[22710]: (frappe) CMD (cd /home/frappe/frappe-bench && /h
Dec 02 10:00:01 kombo-erp CRON[22709]: pam_unix(cron:session): session closed for user f
Dec 02 10:00:15 kombo-erp polkitd(authority=local)[1338]: Registered Authentication Agen
Dec 02 10:00:15 kombo-erp gnome-session[4999]: Gtk-Message: GtkDialog mapped without a t
Dec 02 10:00:20 kombo-erp polkitd(authority=local)[1338]: Operator of unix-session:c2 su
Dec 02 10:00:20 kombo-erp systemd[1]: Starting A high performance web server and a rever
– Subject: Unit nginx.service has begun start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit nginx.service has begun starting up.
Dec 02 10:00:21 kombo-erp nginx[22760]: nginx: [emerg] duplicate upstream "frappe-bench-
Dec 02 10:00:21 kombo-erp nginx[22760]: nginx: configuration file /etc/nginx/nginx.conf
Dec 02 10:00:21 kombo-erp systemd[1]: nginx.service: Control process exited, code=exited
Dec 02 10:00:21 kombo-erp systemd[1]: Failed to start A high performance web server and
– Subject: Unit nginx.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit nginx.service has failed.

– The result is failed.
Dec 02 10:00:21 kombo-erp systemd[1]: nginx.service: Unit entered failed state.
Dec 02 10:00:21 kombo-erp systemd[1]: nginx.service: Failed with result ‘exit-code’.
Dec 02 10:00:21 kombo-erp polkitd(authority=local)[1338]: Unregistered Authentication Ag
lines 1326-1361/1361 (END)
– Subject: Unit nginx.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit nginx.service has failed.

– The result is failed.
Dec 02 09:59:59 kombo-erp systemd[1]: nginx.service: Unit entered failed state.
Dec 02 09:59:59 kombo-erp systemd[1]: nginx.service: Failed with result ‘exit-code’.
Dec 02 09:59:59 kombo-erp polkitd(authority=local)[1338]: Unregistered Authentication Age
Dec 02 10:00:01 kombo-erp CRON[22709]: pam_unix(cron:session): session opened for user fr
Dec 02 10:00:01 kombo-erp CRON[22710]: (frappe) CMD (cd /home/frappe/frappe-bench && /ho
Dec 02 10:00:01 kombo-erp CRON[22709]: pam_unix(cron:session): session closed for user fr
Dec 02 10:00:15 kombo-erp polkitd(authority=local)[1338]: Registered Authentication Agent
Dec 02 10:00:15 kombo-erp gnome-session[4999]: Gtk-Message: GtkDialog mapped without a tr
Dec 02 10:00:20 kombo-erp polkitd(authority=local)[1338]: Operator of unix-session:c2 suc
Dec 02 10:00:20 kombo-erp systemd[1]: Starting A high performance web server and a revers
– Subject: Unit nginx.service has begun start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

So I am trying to sort this out and hoping at the same time (plan B) I can remove the old gcalendar integration so if I cannot fix the server and get nginx running, I can at least import my backup to a new clean install of erpnext - at least that is my plan…

My entire system has now crashed after following a guide to repair nginx and fix the above problem. I have used mysqldump to export the last working copy of my erpnext system, and need to import this into a new server with clean install of erpnext. In the event I still get same problem as before that I cannot import with the gcalendar module installed, is there a way to selectively import tables so I can recover all or most of my system?

Steps I followed to fix nginx are below:

https://www.linuxjournal.com/content/modsecurity-and-nginx

nginx is now working, but erpnext is a new clean and blank installation. All my data is lost.

When I import the backup of my erpnext sql, which runs successfully, the system still runs the new system that has no data entered?

bench --site site1.local --force restore /home/Documents/1bd3e0294da19198.sql

no errors are returned, but the erpnext version is empty?

Any help much appreciated.

from within /frappe-bench/ folder run
bench version
This will list the version of all your installed apps not just the bench version like bench --version does.
Did you bench restart after importing the SQL?
From your description it sounds as though frappe is currently pointing towards another site instead of site1.local
You can check out more of what is happening by cd into sites folder and then ls. This will show you what sites have been installed and the file currentsite.txt will tell you which site frappe is currently pointing to.
You can also enter mariadb and see how many database’s you have installed. All these should give you a better idea of what is going on.

Hi,

it returns:

bench version
erpnext 10.1.73
frappe 10.1.66
gcalendar 0.2.0

But the erpnext screen just shows three modules as attached?

The currentsite.txt contains:
site1.local

If I look in the MariaDB all the records appear to be there. Is there a way to check which database is now being used as site1.local? I think it may have created a new database and the old file is still untouched but not being presented. Ironically, we are still receiving emails from the old system, even though we cannot see or access anyt of the data via the normal web interface.

Regards,
Kieren

It looks like erpnext app isn’t installed. Check by running the below command in the terminal. It will show the installed apps.

bench list-apps

I followed the below sequence of steps to restore backup.

  1. Install fresh erpnext and frappe using easy install script. You can follow the manual method also.
  2. Complete the setup wizard on the new installation.
  3. Restore the data from the backup using bench restore command.

Refer these links also.


bench list-apps
frappe
erpnext
gcalendar

I have tried to import the sql, it runs OK but still shows the basic 3 modules. Will try new install, problem is if the latest version won’t let me import as I have the calendar file. Will try now and see how it goes.

Classic about receiving emails from invisible old system :slight_smile:
Grrrrr Enough to drive you crazy
To check what DB site1.local is using go to:
/frappe-bench/sites/site1.local/site_config.json
You can use standard mysql commands to show/import/etc all databases etc.

As for your desktop shown, If you go to explore do all the normal ERPNext modules appear on the lefthand side?
If Yes then ERPNext has been installed in site1.local and you can add all Modules / Doctypes to the desktop under User Settings.
If No then you forgot to install ERPNext after you created your frappe site. Unfortunately to fix this you have to:
From /frappe-bench/

bench drop-site site1.local
bench new-site site1.local
bench --site site1.local install-app erpnext
bench start

Nothing available. I will reinstall erpnext and import the sql to hopefully recover the system.

As for your original problem of uninstalling GCalendar 0.2.0

gcalendar 0.2.0 is a depreciated third party app. I never managed to get it to work. Google Cal integration is now built directly into ERPNext. For some reason gcalendar 0.2.0 is linked to the table TabData Migration Plan in your DB. You have two options
1: Add the app gcalendar 0.2.0 to your backup instance and then you can import your SQL file. It is available here: https://github.com/DOKOS-IO/gcalendar

2: Find the DB your live site is using. BACK IT UP VIA SQL DUMP. Find the table TabData Migration Plan and export the GCalendar Sync Row. Then delete the GCalendar Sync Row. Then try bench --site site1.local uninstall-app gcalendar again. bench migrate should add the GCalendar Sync Row again. Well I think it should??? Not 100% sure about this. If no luck then maybe search DB for gcalendar and delete all tables that you find. Then delete calendar 0.2.0 app from frappe-bench/apps
HTH

Dam :frowning:
Once up and running check to see if you site actually uses calendar 0.2.0 Maybe it doesn’t?

Strange, the site_config.json actually points to the right database. Just reinstalled erpnext, a few more issues I’m now fixing…

Not sure what is wrong. On a clean install of erpnext it does not have all the correct modules available. When I import the sql backup (and I have tried several from days earlier), they import OK but none of the old data is present?

The command:

bench list-apps
frappe
erpnext
gcalendar

looks OK

But from inside the webbrowser it shows only :slight_smile:

Starting to think the server I am using is a bit confused with all the changes I made to get nginx working.

I did follow your steps :slightly_smiling_face:
bench drop-site site1.local
bench new-site site1.local
bench --site site1.local install-app erpnext

also added:

bench setup supervisor
bench config dns_multitenant off
bench set-nginx-port site2.local 8090
bench setup nginx
sudo service nginx reload
bench restart

runs OK but still shows the same screen. I have another machine I can build OS and install erpnext and see if OK

Finally got it working. Needed to install older version of erpnext, used the following:

bench --site site3.local install-app erpnext //where erpnext is release v10.1.73
bench setup supervisor
bench config dns_multitenant off
bench set-nginx-port site3.local 8090 // since I have site1.local sort of working, I didn’t want to kill it!!
bench setup nginx
sudo service nginx reload
bench restart

All going again. Lesson learnt, get a back up running on another server.
Thanks for the help, a great open source product and fantastic community support.

1 Like

Great to hear you got it up and running. Not much you haven’t had to do so setting up any future ERPNext system should be relatively easy. :grinning: