zoispag
September 7, 2020, 7:44am
1
Hi there,
I cannot delete the gmail account integration from Zammad. Until recently i was using gmail, to receive emails from an actual pop3 account and then Zammad on top, to receive the email from gmail.
Because gmail took time to receive the emails some time, I removed the gmail from the equation.
So I tried to setup Zammad to receive emails directly from my email account.
No this works, but I cannot delete the existing gmail from Zammad.
Is there a rails console command to do this?
Infos:
Used Zammad version: 3.4.x
Used Zammad installation source: sourc
Operating system: Debian
Browser + version: Chrome 85.0.x
Expected behavior:
It should delete the gmail account from gmail channels menu
Actual behavior:
We receive an error
Steps to reproduce the behavior:
Add a gmail account
Deactivate account
(Add the same account as plain pop3 account)
Try to delete it (?)
Two things:
a)
What you’re experiencing is a bug - I’ve created a report for you already:
opened 02:20PM - 18 Sep 20 UTC
closed 07:51AM - 16 Sep 21 UTC
bug
UX/UI
channel
verified
<!--
Hi there - thanks for filing an issue. Please ensure the following things … before creating an issue - thank you! 🤓
Since november 15th we handle all requests, except real bugs, at our community board.
Full explanation: https://community.zammad.org/t/major-change-regarding-github-issues-community-board/21
Please post:
- Feature requests
- Development questions
- Technical questions
on the board -> https://community.zammad.org !
If you think you hit a bug, please continue:
- Search existing issues and the CHANGELOG.md for your issue - there might be a solution already
- Make sure to use the latest version of Zammad if possible
- Add the `log/production.log` file from your system. Attention: Make sure no confidential data is in it!
- Please write the issue in english
- Don't remove the template - otherwise we will close the issue without further comments
- Ask questions about Zammad configuration and usage at our mailinglist. See: https://zammad.org/participate
Note: We always do our best. Unfortunately, sometimes there are too many requests and we can't handle everything at once. If you want to prioritize/escalate your issue, you can do so by means of a support contract (see https://zammad.com/pricing#selfhosted).
* The upper textblock will be removed automatically when you submit your issue *
-->
### Infos:
* Used Zammad version: 3.4 (also verified on 3.4 develop `pre-release`)
* Installation method (source, package, ..): source & hosted
* Operating system: any
* Database + version: any
* Elasticsearch version: any
* Browser + version: Google Chrome v85
* Note: *This issue originally was found by community user [zoispag](https://community.zammad.org/u/zoispag) on [this community post](https://community.zammad.org/t/cannot-delete-gmail-account/5246)*
### Expected behavior:
When having an active email channel for your google account and a inactive google channel for the same account, you can remove the google channel if needed.
### Actual behavior:
When having an active email channel for your google account and a inactive google channel for the same account, you can't remove the google channel. The task fails with:

Zammad will log the following:
```
I, [2020-09-18T16:04:14.232299 #24235-70289493017700] INFO -- : Processing by ChannelsGoogleController#destroy as JSON
I, [2020-09-18T16:04:14.232424 #24235-70289493017700] INFO -- : Parameters: {"id"=>24}
E, [2020-09-18T16:04:14.260095 #24235-70289493017700] ERROR -- : undefined method `destroy!' for nil:NilClass (NoMethodError)
/opt/zammad/app/controllers/channels_google_controller.rb:58:in `destroy'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/abstract_controller/base.rb:194:in `process_action'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_controller/metal/rendering.rb:30:in `process_action'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/opt/zammad/app/controllers/application_controller/has_secure_content_security_policy_for_downloads.rb:18:in `block (4 levels) in <module:HasSecureContentSecurityPolicyForDownloads>'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:180:in `subscribed'
/opt/zammad/app/controllers/application_controller/has_secure_content_security_policy_for_downloads.rb:17:in `block (3 levels) in <module:HasSecureContentSecurityPolicyForDownloads>'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:180:in `subscribed'
/opt/zammad/app/controllers/application_controller/has_secure_content_security_policy_for_downloads.rb:16:in `block (2 levels) in <module:HasSecureContentSecurityPolicyForDownloads>'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in `instance_exec'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:136:in `run_callbacks'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/abstract_controller/callbacks.rb:41:in `process_action'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_controller/metal/rescue.rb:22:in `process_action'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:168:in `block in instrument'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:168:in `instrument'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
/usr/local/rvm/gems/ruby-2.6.6/gems/activerecord-5.2.4.4/lib/active_record/railties/controller_runtime.rb:24:in `process_action'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/abstract_controller/base.rb:134:in `process'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionview-5.2.4.4/lib/action_view/rendering.rb:32:in `process'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_controller/metal.rb:191:in `dispatch'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_controller/metal.rb:252:in `dispatch'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:34:in `serve'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:52:in `block in serve'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:35:in `each'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:35:in `serve'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:840:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420:in `call_app!'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-saml-1.10.1/lib/omniauth/strategies/saml.rb:89:in `other_phase'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:190:in `call!'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/omniauth-1.9.0/lib/omniauth/builder.rb:64:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/rack-2.2.3/lib/rack/etag.rb:27:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/rack-2.2.3/lib/rack/conditional_get.rb:40:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
/usr/local/rvm/gems/ruby-2.6.6/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/cookies.rb:670:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:98:in `run_callbacks'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:38:in `call_app'
/usr/local/rvm/gems/ruby-2.6.6/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:26:in `block in call'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in `block in tagged'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:28:in `tagged'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in `tagged'
/usr/local/rvm/gems/ruby-2.6.6/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:26:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/executor.rb:14:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/static.rb:127:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/railties-5.2.4.4/lib/rails/engine.rb:524:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/railties-5.2.4.4/lib/rails/railtie.rb:190:in `public_send'
/usr/local/rvm/gems/ruby-2.6.6/gems/railties-5.2.4.4/lib/rails/railtie.rb:190:in `method_missing'
/usr/local/rvm/gems/ruby-2.6.6/gems/puma-3.12.6/lib/puma/configuration.rb:227:in `call'
/usr/local/rvm/gems/ruby-2.6.6/gems/puma-3.12.6/lib/puma/server.rb:706:in `handle_request'
/usr/local/rvm/gems/ruby-2.6.6/gems/puma-3.12.6/lib/puma/server.rb:476:in `process_client'
/usr/local/rvm/gems/ruby-2.6.6/gems/puma-3.12.6/lib/puma/server.rb:334:in `block in run'
/usr/local/rvm/gems/ruby-2.6.6/gems/puma-3.12.6/lib/puma/thread_pool.rb:135:in `block in spawn_thread'
/usr/local/rvm/gems/ruby-2.6.6/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
I, [2020-09-18T16:04:14.266348 #24235-70289493017700] INFO -- : Completed 500 Internal Server Error in 34ms (Views: 0.2ms | ActiveRecord: 10.6ms)
```
Manually removing the affected channel however does work.
### Steps to reproduce the behavior:
* create a google channel
* set the google channel to inactive
* use the same account to create an email channel
* try to remove the google channel via UI
Yes I'm sure this is a bug and no feature request or a general question.
b)
To me it looks like you’re trying to workaround issues which have a different cause.
Technically pop/imap and google channels should be similare fast.
In fact, they’re both run in the same Channel fetch process.
However
If you have a lot of email channels with a lot of mails to fetch, the fetching of a specific mail channel may take longer than you might expect.
In general, Zammad runs it’s fetching process every 30 seconds which should be fairly good enough.
Anyway, yes, you can also remove a Channel from the console.
You’ll have to find the correct channel though.
The following should help.
RUN AT YOUR OWN RISK; YOU’RE REMOVING CHANNEL DATA
# Get all google channels
Channel.where(area: "Google::Account").ids
# If you have more than one Channel, check if ID
Channel.find({id-above-command-returned})
# If you found your Channel ID, make it suffer
Channel.find({bad-channel-id}).destroy
1 Like
zoispag
September 18, 2020, 3:07pm
3
Hi Marcel,
Thank you very much for your reply and for creating a bug report.
The slowness I was experiencing is not coming from Zammad, but from the way the mail was setup. It does not offer anything useful anymore, so I decided to get rid of Gmail as an intermediate.
Thanks for the console commands. Do you advice to wait for a fix, of just go ahead and remove it manually from the console?
You can safely go ahead. The fix may take more time than you’re willing to wait. :x
zoispag
September 25, 2020, 10:44am
5
It worked like a charm. Thanks
1 Like
system
Closed
January 23, 2021, 10:44am
6
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.