znuny / Znuny

Znuny/Znuny LTS is a fork of the ((OTRS)) Community Edition, one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management.
https://www.znuny.org
GNU General Public License v3.0
355 stars 85 forks source link

ArticleStorageFS: Can't read plain article! Maybe there is no plain email in backend! #367

Closed fxlxx closed 1 year ago

fxlxx commented 1 year ago

Environment

Actual behaviour

I switched from Ticket::Article::Backend::MIMEBase::ArticleStorageDB to Kernel::System::Ticket::Article::Backend::MIMEBase::ArticleStorageFS and successfully run otrs.Console.pl Admin::Article::StorageSwitch --target ArticleStorageFS.

Attachments are available. But we also have Ticket::Frontend::PlainView enabled, which shows a link to see a zoomed email ticket in plain text.

For older tickets the link to plain format works fine, for new tickets i get the following error:

/var/log/syslog:

OTRS-CGI-10[2115]: [Error][Kernel::Output::HTML::Layout::Error][Line:1038]: 
Can't read plain article! Maybe there is no plain email in backend! Read backend message.

Backend Error:

Backend ERROR: OTRS-CGI-10 Perl: 5.28.1 OS: linux Time: Tue Apr 11 11:27:43 2023

 Message: Can't read plain article! Maybe there is no plain email in backend! Read backend message.

 RemoteAddress: some ip
 RequestURI: /otrs/index.pl?Action=AgentTicketPlain;TicketID=104;ArticleID=158

 Traceback (6780): 
   Module: Kernel::Output::HTML::Layout::Error Line: 1038
   Module: Kernel::Output::HTML::Layout::ErrorScreen Line: 1019
   Module: Kernel::Modules::AgentTicketPlain::Run Line: 81
   Module: Kernel::System::Web::InterfaceAgent::Run Line: 1144
   Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 39
   Module: (eval) (v1.99) Line: 207
   Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
   Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
   Module: ModPerl::Registry::handler (v1.99) Line: 32

How to reproduce

Steps to reproduce the behavior:

  1. Switch to Kernel::System::Ticket::Article::Backend::MIMEBase::ArticleStorageFS
  2. Enable Ticket::Frontend::PlainView
  3. Create new ticket
  4. Click link to plain format in first article of newly created ticket
fxlxx commented 1 year ago

Update: If in enable Ticket::Article::Backend::MIMEBase::CheckAllStorageBackends it works again.

hanneshal commented 1 year ago

Hi @motod after you changed the backend type, you (may) need to move the files from the DB backend to the FS or use the switch you already found. This depends on your use-case:

1) Move all files from DB to FS:

bin/otrs.Console.pl Admin::Article::StorageSwitch

....

Migrate article files from one storage backend to another on the fly.

Usage:
 otrs.Console.pl Admin::Article::StorageSwitch --target ... [--source ...] [--tickets-closed-before-date ...] [--tickets-closed-before-days ...] [--tickets-created-before-date ...] [--tickets-created-before-days ...] [--tolerant] [--micro-sleep ...] [--force-pid]
...

 otrs.Console.pl Admin::Article::StorageSwitch --target ArticleStorageFS

2) Move only new files to the FS and leave the old ones there: Set Ticket::Article::Backend::MIMEBase::CheckAllStorageBackends to yes All new files will be written to the FS.

Regards Johannes

fxlxx commented 1 year ago

Hi @hanneshal I proceeded exactly as in step 1.

Just so I understand. Shouldn't with active setting Kernel::System::Ticket::Article::Backend::MIMEBase::ArticleStorageFS new plain text data also been created in FS? In my understanding this is not the case.

hanneshal commented 1 year ago

Yes, this is the case. And if it is not, I would suggest to check your permissions and log for errors.

By default the path is $HOME/var/article/year/month/day/articleID

It may be the case that the could not be created due to permission issues.