2

i'm getting a cURL error which i am unable to find any solutions to after searching in this forum and on the internet. Will be eternally grateful for any advice.

My CiviCRM is powered by CiviCRM 5.49.4. on Wordpress 6.1.3

The cURL error 3 comes up when:

  1. Accessing the CiviCRM plugin landing page at [host]/wp-admin/admin.php?page=CiviCRM, the error disappears on refresh and the landing page widgets loads normally
  2. When accessing the Extensions page at [host]/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fextensions&reset=1 , and the error persists.

I wonder if the extension directory is the issue:

Extensions Directory found at [host]/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2Fpath reads

[cms.root]/wp-content/uploads/civicrm/ext

and the directory only contains a cache folder.

While i see the extension resources appears to be stored at

[cms.root]/wp-content/plugins/civicrm/civicrm/ext/

But i am unable to draw the causal relationship between the error and the empty /ext/ directory... Please enlighten me!

Error stack trace:

I share the stack trace below with replaced [cms.root]

    $Fatal Error Details = array:3 [
  "message" => "cURL error 3: URL rejected: No host part in the URL (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"
  "code" => null
  "exception" => GuzzleHttp\Exception\RequestException {#19613
    -request: GuzzleHttp\Psr7\Request {#19607
      -method: "GET"
      -requestTarget: null
      -uri: GuzzleHttp\Psr7\Uri {#19603
        -scheme: ""
        -userInfo: ""
        -host: ""
        -port: null
        -path: "/single"
        -query: ""
        -fragment: ""
      }
      -headers: array:1 [
        "User-Agent" => array:1 [
          0 => "GuzzleHttp/6.5.5 curl/8.2.1 PHP/7.4.33"
        ]
      ]
      -headerNames: array:1 [
        "user-agent" => "User-Agent"
      ]
      -protocol: "1.1"
      -stream: GuzzleHttp\Psr7\Stream {#19606
        -stream: stream resource {@490
          wrapper_type: "PHP"
          stream_type: "TEMP"
          mode: "w+b"
          unread_bytes: 0
          seekable: true
          uri: "php://temp"
          options: []
        }
        -size: 0
        -seekable: true
        -readable: true
        -writable: true
        -uri: "php://temp"
        -customMetadata: []
      }
    }
    -response: null
    -handlerContext: array:41 [
      "errno" => 3
      "error" => "URL rejected: No host part in the URL"
      "appconnect_time" => 0.0
      "url" => "/single"
      "content_type" => null
      "http_code" => 0
      "header_size" => 0
      "request_size" => 0
      "filetime" => -1
      "ssl_verify_result" => 0
      "redirect_count" => 0
      "total_time" => 0.0
      "namelookup_time" => 0.0
      "connect_time" => 0.0
      "pretransfer_time" => 0.0
      "size_upload" => 0.0
      "size_download" => 0.0
      "speed_download" => 0.0
      "speed_upload" => 0.0
      "download_content_length" => -1.0
      "upload_content_length" => -1.0
      "starttransfer_time" => 0.0
      "redirect_time" => 0.0
      "redirect_url" => ""
      "primary_ip" => ""
      "certinfo" => []
      "primary_port" => 0
      "local_ip" => ""
      "local_port" => 0
      "http_version" => 0
      "protocol" => 0
      "ssl_verifyresult" => 0
      "scheme" => ""
      "appconnect_time_us" => 0
      "connect_time_us" => 0
      "namelookup_time_us" => 0
      "pretransfer_time_us" => 0
      "redirect_time_us" => 0
      "starttransfer_time_us" => 0
      "total_time_us" => 0
      "curl_version" => "8.2.1"
    ]
    #message: "cURL error 3: URL rejected: No host part in the URL (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"
    #code: 0
    #file: "[cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php"
    #line: 201
    trace: {
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:155 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:105 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:43 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:28 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:51 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php:37 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Middleware.php:29 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php:70 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Middleware.php:59 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/HandlerStack.php:71 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Client.php:351 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Client.php:162 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Client.php:182 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php:253 {
        › $client = $this->getGuzzleClient();
        › $response = $client->request('GET', $url, ['sink' => $filename, 'timeout' => \Civi::settings()->get('http_timeout')]);
        › restore_error_handler();
        arguments: {
          $method: "GET"
          $uri: "/single"
          $options: array:3 [ …3]
        }
      }
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php:196 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php:151 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component/Env.php:588 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component.php:76 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php:236 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php:202 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php:93 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Page.php:248 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Event/Page/EventInfo.php:338 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:319 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm.php:1199 { …}
      [cms.root]/wp-content/plugins/civicrm/includes/civicrm.basepage.php:380 { …}
      [cms.root]/wp-includes/class-wp-hook.php:308 { …}
      [cms.root]/wp-includes/class-wp-hook.php:332 { …}
      [cms.root]/wp-includes/plugin.php:565 { …}
      [cms.root]/wp-includes/class-wp.php:797 { …}
      [cms.root]/wp-includes/functions.php:1332 { …}
      [cms.root]/wp-blog-header.php:16 { …}
      [cms.root]/index.php:17 { …}
    }
  }
]


Aug 06 17:03:25  [debug] $backTrace = #0 [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(433): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(GuzzleHttp\Exception\RequestException))
#2 [cms.root]/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:3))
#3 [cms.root]/wp-content/plugins/civicrm/includes/civicrm.basepage.php(380): CiviCRM_For_WordPress->invoke()
#4 [cms.root]/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#5 [cms.root]/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters("", (Array:1))
#6 [cms.root]/wp-includes/plugin.php(565): WP_Hook->do_action((Array:1))
#7 [cms.root]/wp-includes/class-wp.php(797): do_action_ref_array("wp", (Array:1))
#8 [cms.root]/wp-includes/functions.php(1332): WP->main("")
#9 [cms.root]/wp-blog-header.php(16): wp()
#10 [cms.root]/index.php(17): require("[cms.root]/wp-blog-header.php")
#11 {main}
1
  • 1
    Those two extensions directories serve different purposes. You should place your extensions in [cms.root]/wp-content/uploads/civicrm/ext. [cms.root]/wp-content/plugins/civicrm/civicrm/ext/ is for extensions that ship with CiviCRM itself. If you install extensions here, they're likely to be lost during upgrade. In other words - I don't think the empty directory is your issue! Aug 16, 2023 at 2:59

2 Answers 2

2

This is a very unusual error - but since you appear to be technical (this is a very well-written question!) I can recommend the following:

  • Go to Support menu » Developer » API Explorer.
  • Set Entity to Setting (see screenshot).
  • Set Action to Get.
  • Set the box under Select to ext_repo_url.
  • Press Execute.
  • Look at the value in the Results box. It should be https://civicrm.org/extdir/ver={ver}|cms={uf}

If it's not, it was changed in one of three places:

  • <civiroot>/settings/Extension.settings.php (ext_repo_url stanza, default value). This is unlikely, since it would go away on upgrade.
  • In the database. In that case, set the Action to Set, the box under Values to ext_repo_url, and paste the URL above into the input box that appears. Press Execute, then check that it worked with the "Get" instructions above.
  • If it still hasn't changed, the only place that has higher precedence is in civicrm.settings.php. Comment out any lines that have ext_repo_url in them, there's no good reason that this should be overridden in civicrm.settings.php unless you're a cloud provider of a fleet of CiviCRM instances.

enter image description here

2
  • 1
    THANK YOU JON! The ext_repo_url value was null in the database and thanks to your very clear instructions i set it correctly. quickly goes to upgrade the version
    – humanistsg
    Aug 16, 2023 at 14:19
  • Glad to hear it! Though it being null shouldn't have been an issue, since the default in the Extension.settings.php file should've taken effect. But whatever the case, I'm glad I was able to solve your problem. Aug 16, 2023 at 15:36
1

You're running a very old version of CiviCRM and the code that's giving you the error has changed since that version. Can you upgrade?

1
  • Thanks for the comment Lars! Yea... i am afraid of snowballing errors so i refrained from upgrading. I'll definitely go and upgrade after checking the places mentioned by Jon G!
    – humanistsg
    Aug 16, 2023 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.