添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account GuzzleHttp Exception ConnectException: cURL error 7: Failed to connect to www.nextcloud.com port 80: Operation timed out #11155 GuzzleHttp Exception ConnectException: cURL error 7: Failed to connect to www.nextcloud.com port 80: Operation timed out #11155 Drugoy opened this issue Sep 10, 2018 · 3 comments
  • Install nextcloud in a docker (php-fpm + nginx).
  • Go to admin page.
  • Look at the data/nextcloud.log
  • Expected behaviour

    There should be no errors.

    Actual behaviour

    There are errors instead.

    Server configuration

    Operating system : alpine

    Web server:

    Database: mariadb

    PHP version: 7.1

    Nextcloud version: 13

    Updated from an older Nextcloud/ownCloud or fresh install: updated from NC12.

    Where did you install Nextcloud from: official docker image.

    Signing status:

    Signing status
    No errors have been found.
    

    List of activated apps:

    App list
    Enabled:
      - activity: 2.6.1
      - admin_audit: 1.3.0
      - announcementcenter: 3.2.1
      - bruteforcesettings: 1.1.0
      - calendar: 1.6.1
      - camerarawpreviews: 0.5.6
      - caniupdate: 0.1.3
      - checksum: 0.4.0
      - comments: 1.3.0
      - contacts: 2.1.5
      - dav: 1.4.6
      - drop_account: 0.0.11
      - dropit: 0.1.1
      - federatedfilesharing: 1.3.1
      - files: 1.8.0
      - files_pdfviewer: 1.2.1
      - files_rightclick: 0.8.4
      - files_sharing: 1.5.0
      - files_texteditor: 2.5.1
      - files_trashbin: 1.3.0
      - files_versions: 1.6.0
      - files_videoplayer: 1.2.0
      - firstrunwizard: 2.2.1
      - gallery: 18.0.0
      - groupfolders: 1.3.3
      - logreader: 2.0.0
      - lookup_server_connector: 1.1.0
      - metadata: 0.7.0
      - nextcloud_announcements: 1.2.0
      - notes: 2.4.1
      - oauth2: 1.1.0
      - password_policy: 1.3.0
      - phonetrack: 0.2.8
      - provisioning_api: 1.3.0
      - quota_warning: 1.2.0
      - rainloop: 5.1.0
      - serverinfo: 1.3.0
      - spreed: 3.2.5
      - survey_client: 1.1.0
      - systemtags: 1.3.0
      - tasks: 0.9.7
      - theming: 1.4.5
      - twofactor_backupcodes: 1.2.3
      - workflowengine: 1.3.0
    Disabled:
      - admin_notifications
      - dashboard
      - dicomviewer
      - encryption
      - federation
      - files_accesscontrol
      - files_external
      - flowupload
      - mail
      - notifications
      - ocdownloader
      - ocsms
      - ojsxc
      - registration
      - sharebymail
      - updatenotification
      - user_external
      - user_ldap
    

    Nextcloud configuration:

    Config report "system": { "htaccess.RewriteBase": "\/", "memcache.local": "\\OC\\Memcache\\APCu", "memcache.distributed": "\\OC\\Memcache\\Memcached", "memcached_servers": [ "memcached-nextcloud", 11211 "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": [ "192.168.0.13", "nextcloud.mysite.com", "www.nextcloud.mysite.com" "datadirectory": "***REMOVED SENSITIVE VALUE***", "overwrite.cli.url": "http:\/\/192.168.0.13", "dbtype": "mysql", "version": "13.0.2.1", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "maintenance": false, "mail_smtpmode": "smtp", "mail_smtpauthtype": "PLAIN", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauth": 1, "mail_smtpsecure": "ssl", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "loglevel": 3, "theme": "", "updater.secret": "***REMOVED SENSITIVE VALUE***"

    Are you using external storage, if yes which one: local

    Are you using encryption: no

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

    Client configuration

    Browser: latest stable Chromium.

    Operating system: Windows, Ubuntu 18.04 LTS.

    Web server error log

    Web server error log
    nothing relevant
    

    Nextcloud log (data/nextcloud.log)

    Nextcloud log
    {...,"app":"internet_connection_check","method":"GET","url":"\/settings\/ajax\/checksetup","message":"Exception: {\"Exception\":\"GuzzleHttp\\\\Exception\\\\ConnectException\",\"Message\":\"cURL error 7: Failed to connect to www.nextcloud.com port 80: Operation timed out\"       ,\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/html\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/RequestFsm.php(103): GuzzleHttp\\\\Exception\\\\RequestException::wrapException(Object(GuzzleHttp\\\\Message\\\\Request), Object(GuzzleHttp\\\\Ring\\\\Exception\\\\ConnectException))\\n#1 \\\/var\\\/www\\\/html\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/RequestFsm.php(132): GuzzleHttp\\\\Reques       tFsm->__invoke(Object(GuzzleHttp\\\\Transaction))\\n#2 \\\/var\\\/www\\\/html\\\/3rdparty\\\/react\\\/promise\\\/src\\\/FulfilledPromise.php(25): GuzzleHttp\\\\RequestFsm->GuzzleHttp\\\\{closure}(*** sensitive parameters replaced ***)\\n#3 \\\/var\\\/www\\\/html\\\/3rdparty\\\/guzzlehttp\\\/ringphp\\\/src\\\/Future\\\/CompletedFutureValue.php(55): React\\\\Promise\\\\FulfilledPromise->then(O       bject(Closure), NULL, NULL)\\n#4 \\\/var\\\/www\\\/html\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/Message\\\/FutureResponse.php(43): GuzzleHttp\\\\Ring\\\\Future\\\\CompletedFutureValue->then(Object(Closure), NULL, NULL)\\n#5 \\\/var\\\/www\\\/html\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/RequestFsm.php(134): GuzzleHttp\\\\Message\\\\FutureResponse::proxy(Object(GuzzleHttp\\\\Ring\\       \\Future\\\\CompletedFutureArray), Object(Closure))\\n#6 \\\/var\\\/www\\\/html\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/Client.php(165): GuzzleHttp\\\\RequestFsm->__invoke(Object(GuzzleHttp\\\\Transaction))\\n#7 \\\/var\\\/www\\\/html\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/Client.php(125): GuzzleHttp\\\\Client->send(Object(GuzzleHttp\\\\Message\\\\Request))\\n#8 \\\/var\\\/www\\       \/html\\\/lib\\\/private\\\/Http\\\/Client\\\/Client.php(138): GuzzleHttp\\\\Client->get('http:\\\/\\\/www.next...', Array)\\n#9 \\\/var\\\/www\\\/html\\\/settings\\\/Controller\\\/CheckSetupController.php(129): OC\\\\Http\\\\Client\\\\Client->get('http:\\\/\\\/www.next...')\\n#10 \\\/var\\\/www\\\/html\\\/settings\\\/Controller\\\/CheckSetupController.php(112): OC\\\\Settings\\\\Controller\       \\\CheckSetupController->isSiteReachable('www.nextcloud.c...')\\n#11 \\\/var\\\/www\\\/html\\\/settings\\\/Controller\\\/CheckSetupController.php(426): OC\\\\Settings\\\\Controller\\\\CheckSetupController->isInternetConnectionWorking()\\n#12 [internal function]: OC\\\\Settings\\\\Controller\\\\CheckSetupController->check()\\n#13 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Htt       p\\\/Dispatcher.php(161): call_user_func_array(Array, Array)\\n#14 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(91): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OC\\\\Settings\\\\Controller\\\\CheckSetupController), 'check')\\n#15 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/App.php(115): OC\\\\AppFramework\\\\Http\\       \\Dispatcher->dispatch(Object(OC\\\\Settings\\\\Controller\\\\CheckSetupController), 'check')\\n#16 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main('OC\\\\\\\\Settings\\\\\\\\Con...', 'check', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#17 [internal function]: OC\\\\AppFramework       \\\\Routing\\\\RouteActionHandler->__invoke(Array)\\n#18 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Route\\\/Router.php(297): call_user_func(Object(OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler), Array)\\n#19 \\\/var\\\/www\\\/html\\\/lib\\\/base.php(999): OC\\\\Route\\\\Router->match('\\\/settings\\\/ajax\\\/...')\\n#20 \\\/var\\\/www\\\/html\\\/index.php(37): OC::handleRequest()\\n#       21 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/Exception\\\/RequestException.php\",\"Line\":49}"
              

    GitMate.io thinks possibly related issues are #10962 (GuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to www.nextcloud.com port 80: Connection timed out), #7072 (Get too many logs GuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to www.google.com port 80: Connection timed out), #9932 (Failed to connect to www.nextcloud.com), #3470 (cURL error 77: error setting certificate verify locations: CAfile: /var/www/data/files_external/rootcerts.crt CApath: /etc/ssl/certs ), and #2910 (rootcert.crt empty after update to latest stable11 commit ).

    MacOS docker-composer: I have similar problem with two services in laravel - I set them up using docker composer (on one nginx server with properly mapped directories), I put they local domains names my-first-service.local and my-second-service.local into etc/hosts - but they "dont see" each other when I try to send request by guzzle or cURL from one to another (however they see external services like https://www.google.com) - the solution was to add to docker-composer.yml file (for run nginx) section extra_hosts in php service with they domains :

    version: '3'
    services:
        # image: nginx:latest
        ports:
          - "80:80" # 8080:80
        build:
          context: "./"
          dockerfile: Dockerfile-nginx
        volumes:
          - /Volumes/work:/work
          - ./site.conf:/etc/nginx/conf.d/site.conf
          - ../../docker-data/nginx/log:/var/log/nginx
        links:
          - php
        expose: 
          - "80"
        networks:
          webserver_net:
            ipv4_address: ${WEBSERVER_IP}
        build:
          context: "./"
          dockerfile: Dockerfile-php
        volumes:
          - /Volumes/work:/work    
        extra_hosts:
          - "dockerhost:${DOCKER_HOST_IP}"
          - "my-first-service.local:${WEBSERVER_IP}"
          - "my-second-service.local:${WEBSERVER_IP}"      
        networks:
          - webserver_net
    networks:
      webserver_net:
        driver: bridge
        ipam:
            driver: default
            config:
              - subnet: "${WEBSERVER_SUBNET}"            
    

    and I also include .env file which is in same directory that docker-composer.yml:

    WEBSERVER_IP=172.16.239.20   
    WEBSERVER_GATEWAY=172.16.239.1    
    WEBSERVER_SUBNET=172.16.239.0/24
    DOCKER_HOST_IP=172.16.239.20