Unabled to install through composer anymore.
Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead

willdurand/geocoder deprecated egeloen/ivory-http-adapter

This is the corresponding work to keep up with changes.

SEE
#512 Implement Httplug
https://github.com/geocoder-php/Geocoder/pull/512
https://github.com/geocoder-php/Geocoder/commit/9ea2bcbf70cee0d469b67b95...

I tried to install Geocoder module (I didn't install Composer Manager, but I did install Service Container) on D8.1.7
after Composer update, then I tried to save a content. The error below is thrown:

Error: Class 'Ivory\HttpAdapter\CurlHttpAdapter' not found in Drupal\Component\DependencyInjection\Container->createService() (line 264 of /srv/www/joinsure.insready.com/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

skyredwang created an issue. See original summary.

chriscalip’s picture

Error sighting confirmed!

For anyone encountering this error do this :

composer require egeloen/http-adapter
chriscalip’s picture

Right so the problem is that geocoder module requires egeloen/http-adapter library,
the simple solution is :

composer require egeloen/http-adapter

But we also need to include on the docs and hook_requirements routine.
Here's the patch to include on README.txt and requirements routine.

I believe this fix is a maintainer judgement call because the composer best practices has not fully agreed upon by our community. Should we make use of composer_manager ? Should we offload this work to contrib maintainers doing the hook_requirements labor ? etc..
I am just trying to move this issue forward. As it is this fix draws inspiration by the d8 address module composer practices:
- adding readme.txt library information in the powered by section
- adding hook_requirements routine .

patched attached.

chriscalip’s picture

Well more complication on this issue; according to required library documentation

egeloen/http-adapter
README

Before starting, be aware this package is deprecated in favor of php-http. That means bugfixes would be accepted but new features will not (except maybe for already opened PRs).

per link :
https://github.com/egeloen/ivory-http-adapter

I believe the work on deprecation and replacement is another issue.

chriscalip’s picture

Status: Active » Needs review
chriscalip’s picture

adhere to namespace conventions.

Pol’s picture

Why not updating the composer.json inside the module instead ?

Pol’s picture

And I'm wondering if this is really necessary because Geocoder PHP requires it in its own composer.json.

See: https://github.com/geocoder-php/Geocoder/blob/master/composer.json

Pol’s picture

Status: Needs review » Closed (won't fix)

I've updated the README.

I'll release a new alpha by the end of the day.

This issue is meaningless now.

chriscalip’s picture

Status: Closed (won't fix) » Active

As of today, October 04, 2016 -- This is still active even with the latest commit
http://cgit.drupalcode.org/geocoder/tree/?id=161521b

See
http://cgit.drupalcode.org/geocoder/tree/geocoder.services.yml?id=161521b
class: Ivory\HttpAdapter\CurlHttpAdapter still in play.

services:

  geocoder:
    class: Drupal\geocoder\Geocoder
    arguments: ['@plugin.manager.geocoder.provider']

  geocoder.http_adapter:
    class: Ivory\HttpAdapter\CurlHttpAdapter

  plugin.manager.geocoder.provider:
    class: Drupal\geocoder\ProviderPluginManager
    parent: default_plugin_manager

  plugin.manager.geocoder.dumper:
    class: Drupal\geocoder\DumperPluginManager
    parent: default_plugin_manager

  cache.geocoder:
    class: Drupal\Core\Cache\CacheBackendInterface
    tags:
      - { name: cache.bin }
    factory: cache_factory:get
    arguments: [geocoder]
chriscalip’s picture

Patched attached.
Replaces all instances of using deprecated Ivory\HttpAdapter\CurlHttpAdapter to Http\Client\HttpClient

chriscalip’s picture

Title: Error: Class 'Ivory\HttpAdapter\CurlHttpAdapter' not found » willdurand/geocoder deprecated egeloen/ivory-http-adapter
Issue summary: View changes
chriscalip’s picture

Issue summary: View changes
chriscalip’s picture

Issue summary: View changes
chriscalip’s picture

Status: Active » Needs review
chriscalip’s picture

Title: willdurand/geocoder deprecated egeloen/ivory-http-adapter » Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead
Issue summary: View changes
chriscalip’s picture

At the heart of this problem is that

composer require "drupal/geocoder"

Only adds module to DRUPAL_ROOT/modules/geocoder and will not let us add module
in another location e.g. DRUPAL_ROOT/modules/contrib/geocoder

I am stuck in trying to manually install vendor libs manually through individually installing libraries.. but this workaround is currently blocked by egeloen/http-adapter abandonment.

chriscalip’s picture

Status: Needs review » Active
chriscalip’s picture

Found solution. anyone getting this problem :

On drupal root do this.

composer require "willdurand/geocoder 3.3"
chriscalip’s picture

Status: Active » Closed (won't fix)
Neograph734’s picture

Status: Closed (won't fix) » Active

Why has this been closed? With a clean install of this module, the issue still exists.

Since https://github.com/geocoder-php/Geocoder/pull/512 has been merged and version 4 has been released: https://github.com/geocoder-php/Geocoder/releases I think this module is good to move on.

The only thing left to do is that this module's composer.json needs to be updated to use geocoder 4.0.0:

    "require": {
        "willdurand/geocoder": "^4.0"
    },

There is however one catch... Geocoder 4 requires php: ^7.0. By using it into this module, this module would lose compatibility with php 5.x versions.

Active support for php 5.6 stopped 6 months ago (security updates will keep coming for one year), so it might be good to switch to PHP 7, but that is up to the maintainers.

michaelfavia’s picture

@Neograph734: Please see our discussion of the PHP7 requirement here: #2825360: Support for v4.0 of willdurand/geocoder library (deprecated egeloen/http-adapter)

While I'm in favor of a 4.0 branch were hesitant to require it for very little gain because of the trouble it will cause some who cant control their environment easily.

chriscalip’s picture

This issue is considered closed as of 8.x-2.x
https://cgit.drupalcode.org/geocoder/tree/composer.json?h=8.x-2.x

The solution consensus for this thread is to make use of `"willdurand/geocoder": "^3.3"` which is already a requirement in 8.x-2.x

This module depends on `"willdurand/geocoder": "^3.3"` which is on php 5.4

itamair’s picture

Might this been closed then? I guess yes ... isn't it?
The actual 8.x-2.0-beta2 version is requiring "willdurand/geocoder": "^3.3" and php 5.4 and install cleanly ...

Pol’s picture

Status: Active » Closed (works as designed)
BEGRAFX’s picture

composer require egeloen/http-adapter
Using version ^1.0 for egeloen/http-adapter
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - willdurand/geocoder v3.3.2 requires egeloen/http-adapter ~0.8 -> satisfiable by egeloen/http-adapter[0.8.0] but these conflict with your requirements or minimum-stability.
    - willdurand/geocoder v3.3.2 requires egeloen/http-adapter ~0.8 -> satisfiable by egeloen/http-adapter[0.8.0] but these conflict with your requirements or minimum-stability.
    - willdurand/geocoder v3.3.2 requires egeloen/http-adapter ~0.8 -> satisfiable by egeloen/http-adapter[0.8.0] but these conflict with your requirements or minimum-stability.
    - Installation request for willdurand/geocoder (locked at v3.3.2) -> satisfiable by willdurand/geocoder[v3.3.2].


Installation failed, reverting ./composer.json to its original content.

So then I added the line

"willdurand/geocoder": "^4.0"

to my composer.json file, and I get...

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/parade 2.0.0-beta2 requires drupal/geocoder_geofield * -> satisfiable by drupal/geocoder_geofield[2.0.0-beta3, 2.0.0-beta2, 2.0.0-beta1, 2.0.0-alpha8, 2.0.0-alpha7, 2.0.0-alpha6, 2.0.0-alpha5, 2.0.0-alpha4, 2.0.0-alpha3, dev-2.x, 2.x-dev].
    - drupal/parade 2.0.0-beta2 requires drupal/geocoder_geofield * -> satisfiable by drupal/geocoder_geofield[2.0.0-beta3, 2.0.0-beta2, 2.0.0-beta1, 2.0.0-alpha8, 2.0.0-alpha7, 2.0.0-alpha6, 2.0.0-alpha5, 2.0.0-alpha4, 2.0.0-alpha3, dev-2.x, 2.x-dev].
    - drupal/parade 2.0.0-beta1 requires drupal/geocoder_geofield * -> satisfiable by drupal/geocoder_geofield[2.0.0-beta3, 2.0.0-beta2, 2.0.0-beta1, 2.0.0-alpha8, 2.0.0-alpha7, 2.0.0-alpha6, 2.0.0-alpha5, 2.0.0-alpha4, 2.0.0-alpha3, dev-2.x, 2.x-dev].
    - drupal/geocoder_geofield dev-2.x requires drupal/geocoder dev-2.x -> satisfiable by drupal/geocoder[dev-2.x].
    - drupal/geocoder_geofield 2.0.0-beta3 requires drupal/geocoder 2.0.0-beta3 -> satisfiable by drupal/geocoder[2.0.0-beta3].
    - drupal/geocoder_geofield 2.0.0-beta3 requires drupal/geocoder 2.0.0-beta3 -> satisfiable by drupal/geocoder[2.0.0-beta3].
    - drupal/geocoder_geofield 2.0.0-alpha3 requires drupal/geocoder 2.0.0-alpha3 -> satisfiable by drupal/geocoder[2.0.0-alpha3].
    - drupal/geocoder_geofield 2.0.0-alpha4 requires drupal/geocoder 2.0.0-alpha4 -> satisfiable by drupal/geocoder[2.0.0-alpha4].
    - drupal/geocoder_geofield 2.0.0-alpha5 requires drupal/geocoder 2.0.0-alpha5 -> satisfiable by drupal/geocoder[2.0.0-alpha5].
    - drupal/geocoder_geofield 2.0.0-alpha6 requires drupal/geocoder 2.0.0-alpha6 -> satisfiable by drupal/geocoder[2.0.0-alpha6].
    - drupal/geocoder_geofield 2.0.0-alpha7 requires drupal/geocoder 2.0.0-alpha7 -> satisfiable by drupal/geocoder[2.0.0-alpha7].
    - drupal/geocoder_geofield 2.0.0-alpha8 requires drupal/geocoder 2.0.0-alpha8 -> satisfiable by drupal/geocoder[2.0.0-alpha8].
    - drupal/geocoder_geofield 2.0.0-beta1 requires drupal/geocoder 2.0.0-beta1 -> satisfiable by drupal/geocoder[2.0.0-beta1].
    - drupal/geocoder_geofield 2.0.0-beta2 requires drupal/geocoder 2.0.0-beta2 -> satisfiable by drupal/geocoder[2.0.0-beta2].
    - drupal/geocoder_geofield 2.x-dev requires drupal/geocoder == 2.9999999.9999999.9999999-dev -> satisfiable by drupal/geocoder[2.x-dev].
    - drupal/geocoder dev-2.x requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - drupal/geocoder 2.0.0-beta3 requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - drupal/geocoder 2.0.0-alpha3 requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - drupal/geocoder 2.0.0-alpha4 requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - drupal/geocoder 2.0.0-alpha5 requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - drupal/geocoder 2.0.0-alpha6 requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - drupal/geocoder 2.0.0-alpha7 requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - drupal/geocoder 2.0.0-alpha8 requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - drupal/geocoder 2.0.0-beta1 requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - drupal/geocoder 2.0.0-beta2 requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - drupal/geocoder 2.0.0-beta3 requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - drupal/geocoder 2.x-dev requires willdurand/geocoder ^3.3 -> satisfiable by willdurand/geocoder[v3.3.0, v3.3.1, v3.3.2] but these conflict with your requirements or minimum-stability.
    - Installation request for drupal/parade ^2.0@beta -> satisfiable by drupal/parade[2.0.0-beta2, 2.0.0-beta1].

Suggestions?

itamair’s picture

@BEGRAFX again ... the actual geocoder release is based on willdurand/geocoder3, that holds that egeloen/http-adapter: ~0.8 dependency.
Support for willdurand/geocoder4 is in the roadmap but still not close to come ...
But, as this issue title states, Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead ...
Why would you still keep requiring package egeloen/http-adapter besides geocoder dependency?

BEGRAFX’s picture

@itamair I'm not choosing to use it. It's somehow being "chosen" by Composer or something in the process. To the contrary, I got the error/warning that launched this whole thread, and I'm trying to address/resolve the issue.

itamair’s picture

there is nothing left to be solved here. This is closed as "works as defined" as we already investigated all this.
You would just need to run the following:

$ composer require "drupal/geocoder"

and that's it: composer will download geocoder module with its dependencies (in correct versions).
(no need to run composer require egeloen/http-adapter)

BEGRAFX’s picture

Thank you. I'll do that. I don't have anything regarding egeloen/http-adapter in my composer.json file, yet I seem to get the warning about it on various installs/updates, so I was attempting to resolve the issue. A Google search lead me to this thread. Even having added the line for geocoder that you mention, i still get

Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead.

As I say, there is no mention at all of this adapter in my composer.json. I'm not pointing fingers at geocoder or anything else, I'm simply trying to resolve the issue. Is there something I should add/modify to force use of php-http/httplug instead?

chriscalip’s picture

IGNORE THIS WARNING
Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead.

Think about the context.

This module requires library `"willdurand/geocoder": "^3.3"` which in turn requires egeloen/http-adapter .
Sure `egeloen/http-adapter` is abandoned but for the duration of this module 2.x its still going to use `"willdurand/geocoder": "^3.3"` and subsequently `egeloen/http-adapter .`

References:
https://cgit.drupalcode.org/geocoder/tree/composer.json?h=8.x-2.x
https://github.com/geocoder-php/Geocoder/blob/3.x/composer.json

BEGRAFX’s picture

I've gone so far as to install the php-http/httplug

composer require php-http/httplug-bundle php-http/curl-client guzzlehttp/psr7

and it installed fine... and then, ironically gave the same warning.

composer require php-http/httplug-bundle php-http/curl-client guzzlehttp/psr7
Using version ^1.10 for php-http/httplug-bundle
Using version ^1.7 for php-http/curl-client
Using version ^1.4 for guzzlehttp/psr7
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 15 installs, 0 updates, 0 removals
  - Installing symfony/options-resolver (v4.1.0): Downloading (100%)         
  - Installing php-http/message-factory (v1.0.2): Downloading (100%)         
  - Installing clue/stream-filter (v1.4.0): Downloading (100%)         
  - Installing php-http/message (1.6.0): Downloading (100%)         
  - Installing php-http/promise (v1.0.0): Downloading (100%)         
  - Installing php-http/httplug (v1.1.0): Downloading (100%)         
  - Installing php-http/client-common (1.7.0): Downloading (100%)         
  - Installing symfony/stopwatch (v4.1.0): Downloading (100%)         
  - Installing php-http/stopwatch-plugin (1.1.0): Downloading (100%)         
  - Installing php-http/logger-plugin (v1.0.0): Downloading (100%)         
  - Installing php-http/discovery (1.4.0): Downloading (100%)         
  - Installing psr/cache (1.0.1): Downloading (100%)         
  - Installing php-http/cache-plugin (v1.5.0): Downloading (100%)         
  - Installing php-http/curl-client (v1.7.1): Downloading (100%)         
  - Installing php-http/httplug-bundle (1.10.0): Downloading (100%)         
php-http/message suggests installing slim/slim (Used with Slim Framework PSR-7 implementation)
php-http/discovery suggests installing puli/composer-plugin (Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details.)
php-http/httplug-bundle suggests installing php-http/mock-client (Add this to your require-dev section to mock HTTP responses easily)
Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead.
Writing lock file
Generating autoload files

I guess, as you suggest, I'll just ignore it.

sealionking’s picture

the same issue for many times run composer update, but ignore it make no harm.