documentserver_community icon indicating copy to clipboard operation
documentserver_community copied to clipboard

Error when trying to connect (cURL error 7)

Open rubo77 opened this issue 4 years ago • 14 comments

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. update to nextcloud 19.0.0
  2. install ONLYOFFICE and Community Document Server
  3. update to NC 19.0.1
  4. go into settings->ONLYOFFICE
  5. press SAVE

Expected behaviour

ONLYOFFICE should continue working after the update.

Actual behaviour

ONLYOFFICE document server worked fine since NC18, also fine under 19.0.1 until I pressed the SAVE button recently agian in settings.

Now I get this error:

Error when trying to connect (cURL error 7: Failed to connect to next.myserver.de port 443: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html))✖

Server configuration

Operating system: Debian 10 with docker

Web server: apache

Database: mariadb

PHP version: 7.4

Nextcloud version: 19.0.1

Updated from an older Nextcloud/ownCloud or fresh install: NC 16 over 19.0.0

Where did you install Nextcloud from: docker

Signing status:

Signing status
No errors have been found.

List of activated apps:

App list
Enabled: - accessibility: 1.5.0 - activity: 2.12.0 - admin_audit: 1.9.0 - announcementcenter: 3.8.1 - apporder: 0.10.0 - bookmarks: 3.3.3 - bruteforcesettings: 1.6.0 - calendar: 2.0.3 - carnet: 0.22.2 - circles: 0.19.4 - cloud_federation_api: 1.2.0 - comments: 1.9.0 - contacts: 3.3.0 - contactsinteraction: 1.0.0 - dav: 1.15.0 - deck: 1.0.5 - documentserver_community: 0.1.7 - federatedfilesharing: 1.9.0 - federation: 1.9.0 - files: 1.14.0 - files_external: 1.10.0 - files_fulltextsearch_tesseract: 1.4.2 - files_mindmap: 0.0.22 - files_pdfviewer: 1.8.0 - files_retention: 1.8.2 - files_rightclick: 0.16.0 - files_sharing: 1.11.0 - files_trashbin: 1.9.0 - files_versions: 1.12.0 - files_videoplayer: 1.8.0 - firstrunwizard: 2.8.0 - fulltextsearch: 1.4.2 - groupfolders: 6.0.6 - keeweb: 0.6.2 - logreader: 2.4.0 - lookup_server_connector: 1.7.0 - mail: 1.4.1 - maps: 0.1.6 - mindmaps: 0.1.0 - news: 14.1.11 - nextcloud_announcements: 1.8.0 - notes: 3.6.1 - notifications: 2.7.0 - oauth2: 1.7.0 - onlyoffice: 4.3.0 - password_policy: 1.9.1 - photos: 1.1.0 - polls: 1.4.3 - privacy: 1.3.0 - provisioning_api: 1.9.0 - quota_warning: 1.8.0 - serverinfo: 1.9.0 - settings: 1.1.0 - sharebymail: 1.9.0 - social: 0.3.1 - socialsharing_email: 2.1.0 - spgverein: 0.6.0 - spreed: 9.0.3 - support: 1.2.1 - survey_client: 1.7.0 - systemtags: 1.9.0 - tasks: 0.13.3 - text: 3.0.1 - theming: 1.10.0 - twofactor_backupcodes: 1.8.0 - updatenotification: 1.9.0 - viewer: 1.3.0 - workflowengine: 2.1.0 Disabled: - encryption - recommendations - user_ldap

Nextcloud configuration:

Config report
{ system: { htaccess.RewriteBase: \/, memcache.local: \\OC\\Memcache\\APCu, apps_paths: [ { path: \/var\/www\/html\/apps, url: \/apps, writable: false }, { path: \/var\/www\/html\/custom_apps, url: \/custom_apps, writable: true } ], instanceid: ***REMOVED SENSITIVE VALUE***, passwordsalt: ***REMOVED SENSITIVE VALUE***, secret: ***REMOVED SENSITIVE VALUE***, trusted_domains: [ next.eclabs.de, xn--bhringer-n4a.org ], datadirectory: ***REMOVED SENSITIVE VALUE***, overwriteprotocol: https, overwrite.cli.url: https:\/\/next.eclabs.de, dbtype: mysql, version: 19.0.1.1, dbname: ***REMOVED SENSITIVE VALUE***, dbhost: ***REMOVED SENSITIVE VALUE***, dbport: , dbtableprefix: oc_, dbuser: ***REMOVED SENSITIVE VALUE***, dbpassword: ***REMOVED SENSITIVE VALUE***, installed: true, mail_from_address: ***REMOVED SENSITIVE VALUE***, mail_smtpmode: smtp, mail_smtpauthtype: PLAIN, mail_domain: ***REMOVED SENSITIVE VALUE***, mail_smtphost: ***REMOVED SENSITIVE VALUE***, mail_smtpport: 587, mail_smtpsecure: tls, mail_smtpauth: 1, mail_smtpname: ***REMOVED SENSITIVE VALUE***, mail_smtppassword: ***REMOVED SENSITIVE VALUE***, updater.release.channel: stable, mail_template_class: \\OC\\Mail\\EMailNoLogoTemplate, preview_libreoffice_path: \/usr\/bin\/libreoffice, maintenance: false, theme: , loglevel: 0, debug: false, app_install_overwrite: [ calendar, spreed, mindmaps, files_retention, socialsharing_email, files_mindmap, admin_notifications, social, spgverein, mindmap_app, keeweb, files_fulltextsearch_tesseract, fulltextsearch ], ldapIgnoreNamingRules: false, ldapProviderFactory: OCA\\User_LDAP\\LDAPProviderFactory, has_rebuilt_cache: true, trashbin_retention_obligation: auto, 3 } }


**Are you using external storage, if yes which one: no

Are you using encryption: no

**Are you using an external user-backend, if yes which one:**no

Client configuration

Browser: FF

Operating system: Ubuntu 20.04

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

rubo77 avatar Aug 25 '20 19:08 rubo77

The problem still exists after the update to 19.0.2

I also discussed it in the nextcloud help forum

rubo77 avatar Aug 31 '20 04:08 rubo77

This is the app settings before I click on the submit button:

# docker exec next-your-nextcloudorg_db_1 mysql nextcloud -p$MYSQL_ROOT_PASSWORD -e "select * from oc_appconfig where appid='onlyoffice'"        
appid   configkey       configvalue
onlyoffice      DocumentServerUrl       https://next-your-nextcloud.org/apps/documentserver_community/
onlyoffice      defFormats      {"docx":true,"pptx":true,"xlsx":true,"odp":true,"ods":true,"odt":true,"doc":true,"ppt":true,"xls":true}                                                                   
onlyoffice      editFormats     {"csv":true,"docx":true,"pptx":true,"txt":true,"xlsx":true,"odp":true,"ods":true,"odt":true,"rtf":true}                                                                   
onlyoffice      enabled yes
onlyoffice      installed_version       4.3.0
onlyoffice      sameTab true
onlyoffice      types   filesystem

an after breaking it, the settings are like this:

appid   configkey       configvalue
onlyoffice      DocumentServerInternalUrl
onlyoffice      DocumentServerUrl       https://next-your-nextcloud.org/apps/documentserver_community/
onlyoffice      StorageUrl
onlyoffice      defFormats      {"docx":true,"pptx":true,"xlsx":true,"odp":true,"ods":true,"odt":true,"doc":true,"ppt":true,"xls":true}                                                                   
onlyoffice      demo    {"available":true,"enabled":false,"start":{"date":"2020-08-31 11:41:50.692445","timezone_type":3,"timezone":"UTC"}}                                                               
onlyoffice      editFormats     {"csv":true,"docx":true,"pptx":true,"txt":true,"xlsx":true,"odp":true,"ods":true,"odt":true,"rtf":true}                                                                   
onlyoffice      enabled yes
onlyoffice      installed_version       4.3.0
onlyoffice      jwt_secret
onlyoffice      sameTab true
onlyoffice      settings_error  cURL error 7: Failed to connect to next-your-nextcloud.org port 443: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)                               
onlyoffice      types   filesystem

rubo77 avatar Aug 31 '20 11:08 rubo77

Workaround:

delete the setting 'settings_error' with:

docker exec next-your-nextcloudorg_db_1 mysql nextcloud -p$MYSQL_ROOT_PASSWORD -e "delete from oc_appconfig where appid='onlyoffice' AND configkey='settings_error'"

rubo77 avatar Aug 31 '20 17:08 rubo77

I just updated to ONLYOFFICE 6.0.0 and the problem still exists (and the workaround still works to fix it)

rubo77 avatar Sep 17 '20 20:09 rubo77

Workaround:

delete the setting 'settings_error' with:

docker exec next-your-nextcloudorg_db_1 mysql nextcloud -p$MYSQL_ROOT_PASSWORD -e "delete from oc_appconfig where appid='onlyoffice' AND configkey='settings_error'"

Do you know how am I supposed to apply this workaround from TrueNas?

RobertRoberts2020 avatar Nov 11 '20 14:11 RobertRoberts2020

I'm getting the same error with Nextcloud 20.0.7, OnlyOffice Nextcloud app 6.3.0 and OnlyOffice Document server 6.2 running in docker with a Nginx reverse proxy in front of it.

AlexanderProd avatar Apr 05 '21 13:04 AlexanderProd

Workaround:

delete the setting 'settings_error' with:

docker exec next-your-nextcloudorg_db_1 mysql nextcloud -p$MYSQL_ROOT_PASSWORD -e "delete from oc_appconfig where appid='onlyoffice' AND configkey='settings_error'"

Do you know how am I supposed to apply this workaround from TrueNas?

I have the same issue on TrueNas. Have you found a way to address this issue?

linjunhe avatar Apr 21 '21 19:04 linjunhe

Can't you just call this there?

mysql nextcloud -p$MYSQL_ROOT_PASSWORD -e "delete from oc_appconfig where appid='onlyoffice' AND configkey='settings_error'"

rubo77 avatar Apr 24 '21 20:04 rubo77

This does not seem to be a workarround. @rubo77 have you studied the code? this entry seems to get created when the connection fails. Literally this so called "workarround" does not address the issue itself. Just clearing a log entry from the database. Correct me if i am wrong. Just wanted the people not to waste their time in the wrong direction. At least this did not work on 'nextcloud' ubuntu 20.04 host to 'docker with onlyoffice document-server container' connection. Kind regards.

ionics avatar Jan 01 '22 17:01 ionics

Just clearing a log entry from the database. Correct me if i am wrong.

It's not a log entry, it is a config entry!

And it fixed the issue for me, so maybe there is something different in your case

rubo77 avatar Jan 01 '22 17:01 rubo77

@rubo77 in our case it was the docker container hosting onlyoffice document-server uses http while our old onlyoffice server used https @ the config for "ONLYOFFICE Docs address for internal requests from the server". Your so called "config" entry gets created when the connection fails. A config entry even its created under configkey with the value:

onlyoffice | settings_error | cURL error 7: Failed to connect to docs.example.com port 443: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://docs.example.com/healthcheck at least to me would be of no real meaning.

Switching to a proper config (in our case using http instead of https) fixed the issue.

ionics avatar Jan 01 '22 18:01 ionics

this settings_error configkey is never created if no connection errors appear. So for future readers fix your connection settings and you are good to go. Running nc v23.0.0 with ONLYOFFICE (connector) v7.2.1 connected to docker onlyoffice document-server built by this docker-compose.yml

version: '2'
services:
  onlyoffice-documentserver:
    build:
      context: .
    container_name: onlyoffice-documentserver
    depends_on:
      - onlyoffice-postgresql
      - onlyoffice-rabbitmq
    environment:
      - DB_TYPE=postgres
      - DB_HOST=onlyoffice-postgresql
      - DB_PORT=5432
      - DB_NAME=onlyoffice
      - DB_USER=onlyoffice
      - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
      # Uncomment strings below to enable the JSON Web Token validation.
      - JWT_ENABLED=true
      - JWT_SECRET=yourSecretKey
      - JWT_HEADER=Authorization
      - JWT_IN_BODY=true
    ports:
      - '80:80'
      - '443:443'
    stdin_open: true
    restart: always
    stop_grace_period: 60s
    volumes:
       - /var/www/onlyoffice/Data
       - /var/log/onlyoffice
       - /var/lib/onlyoffice/documentserver/App_Data/cache/files
       - /var/www/onlyoffice/documentserver-example/public/files
       - /usr/share/fonts
    extra_hosts:
       - next.example.com:192.168.0.176
  onlyoffice-rabbitmq:
    container_name: onlyoffice-rabbitmq
    image: rabbitmq
    restart: always
    expose:
      - '5672'

  onlyoffice-postgresql:
    container_name: onlyoffice-postgresql
    image: postgres:9.5
    environment:
      - POSTGRES_DB=onlyoffice
      - POSTGRES_USER=onlyoffice
      - POSTGRES_HOST_AUTH_METHOD=trust
    restart: always
    expose:
      - '5432'
    volumes:
      - postgresql_data:/var/lib/postgresql

volumes:
  postgresql_data:

one thing left... in the container set rejectUnauthorized=true to false and restart with supervisorctl! services.CoAuthoring.requestDefaults.rejectUnauthorized=false in /etc/onlyoffice/documentserver/defaults.json file and restart documentserver serviceis with supervisorctl restart all.

For those of you who would like to use https instead of http which is advisable you have to change the nginx config in the container from using port 80 to 443 + add proper ssl certs or selfe signed / snake-oil once.

Good luck!

ionics avatar Jan 01 '22 18:01 ionics

@ionics : why do you use extra containers for onlyoffice?

I use only an app container and a db container, and onlyoffice works fine with it I installed two apps: "ONLYOFFICE" and "Community Document Server"

On my host, I have an extra proxy-VM which routes all traffic and manages the certificates, so in the docker image everything is just http, and the proxy-VM serves it as https. maybe thats why I get this error again and again? (and my Workaround still works in NC23)

rubo77 avatar Jan 09 '22 07:01 rubo77

Change the /etc/hosts file in the nextcloud container and add 192.168.*.* onlyoffice.*.com (your domain name). Also add 192.168.*.* nextcloud.*.com to the hosts file of the onlyoffice container.

lovepiece avatar Nov 27 '23 12:11 lovepiece