Bug? OnlyOffice Mail: connect an email to CRM throws an error

Post Reply
christophdb
Posts: 7
Joined: Wed Jan 17, 2018 8:55 pm

Bug? OnlyOffice Mail: connect an email to CRM throws an error

Post by christophdb » Mon Dec 02, 2019 10:09 am

Hi everybody,

1) Visible Behaviour
I have a onlyoffice Community Edition - installed via docker. The Version is 10.0.4.1001.
I added a IMAP-Account to the Mail modul of onlyoffice and I can read my emails and I can write emails.

As soon as I want to use the function "export to CRM" there is an error message. I attached two screenshots.
The error message is german but this should be a good translation:
The selected item is no longer available or the connection has been lost. Please check the location of the selected CRM element and your network connection. if the error persists, please contact your portal administrator.


2) Logs
In the logs (/app/onlyoffice/CommunityServer/logs/web.sql.log) I found this error messages:

2019-12-02 10:00:26,992|95|0.6356|Connection.Open||
2019-12-02 10:00:26,992|95|0.8161|Command.ExecuteScalar|select value from core_settings where tenant = @p0 and id = @p1|@p0=-1, @p1=BaseDomain
2019-12-02 10:00:26,996|95|1.858|Command.ExecuteReader(Default)|select t.id, t.alias, t.mappeddomain, t.version, t.version_changed, t.name, t.language, t.timezone, t.owner_id, t.trusteddomains, t.trusteddomainsenabled, t.creationdatetime, t.status, t.statuschanged, t.payment_id, t.last_modified, p.partner_id, p.affiliate_id, p.campaign, t.industry, t.spam, t.calls from tenants_tenants t left outer join tenants_partners p on t.id = p.tenant_id where alias = @p0 or mappeddomain = @p1|@p0=office.MYMAILADRESS, @p1=office.MYMAILADRESS
2019-12-02 10:00:26,996|95|1.96|Command.ExecuteReader(Default)|select t.id, t.alias, t.mappeddomain, t.version, t.version_changed, t.name, t.language, t.timezone, t.owner_id, t.trusteddomains, t.trusteddomainsenabled, t.creationdatetime, t.status, t.statuschanged, t.payment_id, t.last_modified, p.partner_id, p.affiliate_id, p.campaign, t.industry, t.spam, t.calls from tenants_tenants t left outer join tenants_partners p on t.id = p.tenant_id|
2019-12-02 10:00:27,023|95|1.5776|Connection.Open||
2019-12-02 10:00:27,023|95|1.9029|Command.ExecuteReader(Default)|select id, first_name, last_name, company_name, title, notes, is_company, industry, status_id, company_id, create_on, create_by, display_name, is_shared, contact_type_id, currency from crm_contact use index (company_id) where tenant_id = @p0 and id = @p1|@p0=1, @p1=17
2019-12-02 10:00:27,027|95|0.6541|Connection.Open||
2019-12-02 10:00:27,027|95|2.2498|Command.ExecuteReader(Default)|select id, id_mailbox, id_user, tenant, address, uidl, md5, from_text, to_text, reply_to, cc, bcc, subject, introduction, importance, date_received, date_sent, size, attachments_count, unread, is_answered, is_forwarded, stream, folder, folder_restore, spam, is_removed, time_modified, mime_message_id, mime_in_reply_to, chain_id, chain_date, is_text_body_only, has_parse_error, calendar_uid from mail_mail where tenant = @p0 and id_user = @p1 and id = @p2|@p0=1, @p1=5e0b......, @p2=382
2019-12-02 10:00:27,033|95|2.6661|Command.ExecuteReader(Default)|select mm.id, mm.from_text, mm.to_text, mm.cc, mm.reply_to, mm.subject, mm.importance, mm.date_sent, mm.size, mm.attachments_count, mm.unread, mm.is_answered, mm.is_forwarded, (SELECT CAST(group_concat(tm.id_tag ORDER BY tm.time_created SEPARATOR ',') AS CHAR) from mail_tag_mail as tm WHERE tm.id_mail = mm.id) tagIds, mm.folder_restore, mm.folder, mm.chain_id, mm.chain_date, mm.id_mailbox, mm.calendar_uid, mm.stream, mm.uidl, mm.is_removed from mail_mail mm where mm.tenant = @p0 and mm.id_user = @p1 and mm.is_removed = @p2 and mm.chain_id = @p3|@p0=1, @p1=5e0b......, @p2=False, @p3=984f044bb86b6....
2019-12-02 10:00:27,053|95|19.293|Connection.Open||
2019-12-02 10:00:27,057|95|3.3912|Command.ExecuteReader(Default)|select id, id_mailbox, id_user, tenant, address, uidl, md5, from_text, to_text, reply_to, cc, bcc, subject, introduction, importance, date_received, date_sent, size, attachments_count, unread, is_answered, is_forwarded, stream, folder, folder_restore, spam, is_removed, time_modified, mime_message_id, mime_in_reply_to, chain_id, chain_date, is_text_body_only, has_parse_error, calendar_uid from mail_mail where is_removed = @p0 and tenant = @p1 and id_user = @p2 and id = @p3|@p0=False, @p1=1, @p2=5e0bc5f7-341f-49e9-b698-a77f682dd24c, @p3=382
2019-12-02 10:00:27,058|95|0.9764|Command.ExecuteReader(Default)|select id_tag from mail_tag_mail where tenant = @p0 and id_user = @p1 and id_mail = @p2|@p0=1, @p1=5e0bc5f7-341f-49e9-b698-a77f682dd24c, @p2=382
2019-12-02 10:00:27,058|95|1.2539|Command.ExecuteReader(Default)|select mail_attachment.id, mail_attachment.id_mail, mail_attachment.name, mail_attachment.stored_name, mail_attachment.type, mail_attachment.size, mail_attachment.need_remove, mail_attachment.file_number, mail_attachment.content_id, mail_attachment.tenant, mail_attachment.id_mailbox, mail_mail.stream, mail_mail.id_user from mail_attachment mail_attachment inner join mail_mail mail_mail on mail_mail.id = mail_attachment.id_mail where mail_attachment.need_remove = @p0 and mail_attachment.tenant = @p1 and mail_mail.id_user = @p2 and mail_attachment.id_mail = @p3 and mail_attachment.content_id is null|@p0=False, @p1=1, @p2=5e0b.., @p3=382
2019-12-02 10:00:27,138|95|0.026|Connection.Dispose||
2019-12-02 10:00:27,138|95|0.3439|Connection.BeginTransaction||
2019-12-02 10:00:27,138|95|0.4371|Command.ExecuteNonQuery|insert into mail_chain_x_crm_entity(id_chain,id_mailbox,id_tenant,entity_id,entity_type) values (@p0,@p1,@p2,@p3,@p4)|@p0=984f044bb86b66aeb1ce729ff.bb98a82deb.20191202091144.0a327acc99.a08cc85a@mail180.atl121.mcsv.net, @p1=2, @p2=1, @p3=17, @p4=1
2019-12-02 10:00:27,138|95|0.9106|Command.ExecuteReader(Default)|select u.id, u.username, u.firstname, u.lastname, u.sex, u.bithdate, u.status, u.title, u.workfromdate, u.terminateddate, u.contacts, u.email, u.location, u.notes, u.removed, u.last_modified, u.tenant, u.activation_status, u.culture, u.phone, u.phone_activation, u.sid, u.sso_name_id, u.sso_session_id, u.create_on from core_user u where tenant = @p0 and id = @p1|@p0=1, @p1=5e0bc5f7-341f-49e9-b698-a77f682dd24c
2019-12-02 10:00:27,138|95|0.3954|Command.ExecuteScalar|select pwdhashsha512 from core_usersecurity where tenant = @p0 and userid = @p1|@p0=1, @p1=5e0b...
2019-12-02 10:00:27,144|95|0.0487|Connection.Dispose||
2019-12-02 10:00:27,144|95|0.0389|Connection.Dispose||
2019-12-02 10:00:27,144|95|0.0005|Connection.Dispose||
2019-12-02 10:00:27,144|95|0.0155|Connection.Dispose||

Is this a bug or is there any kind of missconfiguration? The CRM Modul is just working fine.
Best regards
Christoph
Attachments
oo1.png
oo1.png (45.68 KiB) Viewed 1792 times
oo2.png
oo2.png (58.36 KiB) Viewed 1792 times

Carl
Posts: 652
Joined: Thu Apr 12, 2018 10:00 am

Re: Bug? OnlyOffice Mail: connect an email to CRM throws an error

Post by Carl » Tue Dec 03, 2019 1:32 pm

Hello Christoph,

Please check if the logs web.log, web.api.log, web.api-system.log contain any error messages.

Also reproduce the issue with the browser console open and check if there are any errors in Network and Console tabs.

christophdb
Posts: 7
Joined: Wed Jan 17, 2018 8:55 pm

Re: Bug? OnlyOffice Mail: connect an email to CRM throws an error

Post by christophdb » Thu Dec 05, 2019 9:51 am

Hey Carl,

1) browser console:
the error in the chrome browser console is: (I replaced the domain with <DOMAIN> and it is ok, that onlyoffice uses port 444)

head-nQxa-URZKVp3Np88-2nT5A2.js?ver=10.0.4.1001:2
PUT https://office.<DOMAIN>.de:444/api/2.0/mail/conversations/crm/link.json?__=239646 500 (Server error)


If I try to open the api-link there is a not found page from onlyoffice "Sorry, the resource cannot be found."

2) logs
give me some seconds. I will check the logs you mentioned.

Best regards
Christoph

christophdb
Posts: 7
Joined: Wed Jan 17, 2018 8:55 pm

Re: Bug? OnlyOffice Mail: connect an email to CRM throws an error

Post by christophdb » Thu Dec 05, 2019 9:57 am

Hey Carl,

here are the logs

1) web.api.log
at System.Net.WebConnection.Connect (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x0019b] in <2703bbaa0a6e4686b6033c2dddb1a363>:0
--- End of inner exception stack trace ---
at System.Net.WebConnection.Connect (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x00217] in <2703bbaa0a6e4686b6033c2dddb1a363>:0
at System.Net.WebConnection.InitConnection (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x000cc] in <2703bbaa0a6e4686b6033c2dddb1a363>:0
at System.Net.WebOperation.Run () [0x0009a] in <2703bbaa0a6e4686b6033c2dddb1a363>:0
at System.Net.WebCompletionSource`1[T].WaitForCompletion () [0x00094] in <2703bbaa0a6e4686b6033c2dddb1a363>:0
at System.Net.HttpWebRequest.GetRequestStream () [0x00016] in <2703bbaa0a6e4686b6033c2dddb1a363>:0
at RestSharp.Http.WriteRequestBody (System.Net.HttpWebRequest webRequest) [0x0002b] in <7a49fa7fd4d24c9bb5deb1f5c33e29c9>:0
at RestSharp.Http.PostPutInternal (System.String method) [0x00017] in <7a49fa7fd4d24c9bb5deb1f5c33e29c9>:0
at RestSharp.Http.AsPost (System.String httpMethod) [0x00008] in <7a49fa7fd4d24c9bb5deb1f5c33e29c9>:0
at RestSharp.RestClient.DoExecuteAsPost (RestSharp.IHttp http, System.String method) [0x00001] in <7a49fa7fd4d24c9bb5deb1f5c33e29c9>:0
at RestSharp.RestClient.Execute (RestSharp.IRestRequest request, System.String httpMethod, System.Func`3[T1,T2,TResult] getResponse) [0x00026] in <7a49fa7fd4d24c9bb5deb1f5c33e29c9>:0
--- End of inner exception stack trace ---
at ASC.Mail.Utils.ApiHelper.Execute (RestSharp.RestRequest request) [0x00091] in <706486a74e4747038c44ad92fa877bda>:0
at ASC.Mail.Utils.ApiHelper.AddToCrmHistory (ASC.Mail.Data.Contracts.MailMessageData message, ASC.Mail.Data.Contracts.CrmContactData entity, System.Collections.Generic.IEnumerable`1[T] fileIds) [0x00135] in <706486a74e4747038c44ad92fa877bda>:0
at ASC.Mail.Core.Engine.CrmLinkEngine.AddRelationshipEvents (ASC.Mail.Data.Contracts.MailMessageData message, System.String httpContextScheme) [0x00192] in <706486a74e4747038c44ad92fa877bda>:0
at ASC.Mail.Core.Engine.CrmLinkEngine.LinkChainToCrm (System.Int32 messageId, System.Collections.Generic.List`1[T] contactIds, System.String httpContextScheme) [0x0022f] in <706486a74e4747038c44ad92fa877bda>:0
at ASC.Api.Mail.MailApi.LinkConversationToCrm (System.Int32 id_message, System.Collections.Generic.IEnumerable`1[T] crm_contact_ids) [0x0005c] in <05cc20bcdf3340ecac949d3f10e8776b>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <285579f54af44a2ca048dad6be20e190>:0

web.log)

no entries at the moment of the error

web.api-system.log)

there is no such file on the system.

Best regards
Christoph

fischer@itb-nord.de
Posts: 2
Joined: Thu Apr 08, 2021 7:42 pm

Re: Bug? OnlyOffice Mail: connect an email to CRM throws an error

Post by fischer@itb-nord.de » Thu Apr 08, 2021 7:43 pm

Dear Christoph,

did you ever find a solution for this? having the same problem here.

Best regards,
Simon

lukasz.trzcinski
Posts: 3
Joined: Sat Apr 17, 2021 10:26 pm

Re: Bug? OnlyOffice Mail: connect an email to CRM throws an error

Post by lukasz.trzcinski » Sat Apr 17, 2021 10:33 pm

Hi OO Developers.

I have the same issue. When trying to link Mail contact to CRM Contacts, following errors appear (see screenshots).
Lukasz
Attachments
error_web_api_log_GUI.png
error_web_api_log_GUI.png (5.53 KiB) Viewed 752 times
error_web_api_log.png
error_web_api_log.png (120.1 KiB) Viewed 752 times
error_web_log.png
error_web_log.png (219.37 KiB) Viewed 752 times

Carl
Posts: 652
Joined: Thu Apr 12, 2018 10:00 am

Re: Bug? OnlyOffice Mail: connect an email to CRM throws an error

Post by Carl » Tue Apr 20, 2021 11:33 am

Hello Lukasz,

Please specify the version of Community Server you are using. Also please specify the OS of the server and type of installation of Workspace (docker, deb/rpm, exe).

lukasz.trzcinski
Posts: 3
Joined: Sat Apr 17, 2021 10:26 pm

Re: Bug? OnlyOffice Mail: connect an email to CRM throws an error

Post by lukasz.trzcinski » Wed Apr 21, 2021 11:16 am

Hi Carl,
Community Server veersion is Version 11.1.0.1506. OS is Ubuntu Server 20.04.2, installed via deb packages (automatic script).

fischer@itb-nord.de
Posts: 2
Joined: Thu Apr 08, 2021 7:42 pm

Re: Bug? OnlyOffice Mail: connect an email to CRM throws an error

Post by fischer@itb-nord.de » Wed Apr 21, 2021 11:01 pm

I found at least a work around.

The problem seems to be (in my setup) that the nginx proxy in the onlyoffice-community-server docker container tries to rewrite target URLs (when trying to proxy the API backend) to "http://[IP-Address-of-the-docker-container-here] but then cannot reach the backend API. I presume this is caused either by the API only listening on 127.0.0.1 or by the docker security features. Anyways, by adopting the file /etc/ngingx/sites-enabled/onlyoffice in the following way i have been able to circumvent that problem. I guess there are cleaner ways to do this, but i have not gotten it to work in any other way (and have no more time to investigate ;-))

I changed line 51 in the above mentioned file from

Code: Select all

set $X_REWRITER_URL $the_scheme://$the_host;
to

Code: Select all

set $X_REWRITER_URL http://localhost;
I hope it helps someone - and would be happy to learn the right way to do this ;-)

Bests,
Simon

lukasz.trzcinski
Posts: 3
Joined: Sat Apr 17, 2021 10:26 pm

Re: Bug? OnlyOffice Mail: connect an email to CRM throws an error

Post by lukasz.trzcinski » Thu Apr 22, 2021 4:38 pm

HI Simon,

Thanks for reply. In my case, where OO is located behind the Nginx reverse proxy, commenting out this line helped and CRM link is now working. Thanks for offline support ;)

Łukasz

Post Reply