Geocoder has a dependecy on php-http/guzzle6-adapter which depends on guzzlehttp/guzzle:^6.0. But Drupal 9.4 allows now Guzzle 7 (see https://www.drupal.org/project/drupal/issues/3225966). Trying to update Guzzle from 6 to 7 I'm stuck because of this dependency. But I'm not sure it's still used by Geocoder.

Issue fork geocoder-3283651

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Title: Remove php-http/guzzle6-adapter dependecy » Remove php-http/guzzle6-adapter dependency
Status: Active » Needs review
claudiu.cristea’s picture

No idea how to trigger testing

itamair’s picture

Thanks @claudiu.cristea for pointing this out ...
Actually the php-http/guzzle6-adapter is being used by the geocoder.http_adapter, used for Geocoder operations behind Proxy (see Readme.md file) and basically in that case for adding arguments in the ProviderUsingHandlerWithAdapterBase here: https://git.drupalcode.org/project/geocoder/-/blob/8.x-3.x/src/ProviderU...

Changing the requirement into:

"guzzlehttp/guzzle": "^6.5.2 || ^7.4.1",

itamair’s picture

Title: Remove php-http/guzzle6-adapter dependency » Changing php-http/guzzle6-adapter dependency into guzzlehttp/guzzle

  • itamair committed 6fb3aa4 on 8.x-3.x
    Issue #3283651 by claudiu.cristea, itamair: Changing php-http/guzzle6-...
itamair’s picture

Status: Needs review » Fixed
itamair’s picture

Status: Fixed » Needs work
itamair’s picture

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

This cannot be accomplished at the moment, as every geocoder-php providers now depends by an HTTP Adapter able to implement Psr\Http\Client\ClientInterface ... and at the moment php-http/guzzle6-adapter is the only one (until Drupal 9.3)

weseze’s picture

Category: Task » Bug report
Status: Closed (won't fix) » Active

I would like to reopen this, since the version constraint for "guzzlehttp/guzzle" on the 6.x branch is a blocker for all (our) future updates: PHP8.1, D9.4 (soft blocker since it still allows guzzle 6), Drupal 10 (will require PHP8.1 and thus guzzle will need to be 7.x)

Simply locking guzzle to the 6.x branch, which is becoming outdated fast, is not a long term fix for this issue...

Perhaps we could consider a new version that requires Drupal core 9.4 and guzzle 7.x? That version could contain the necessary fixes for the HTTP adapter.

I do also believe this is actual bug, since composer requiring drupal/geocoder after an initial composer install will error out with version constraint issues.
Guzzle 7.x will be locked down through composer on the initial "composer install".
If you then run "composer require drupal/geocoder" it will give errors because composer will not downgrade by default.
This can be worked around by running "composer require drupal/geocoder --with-dependencies" which will downgrade.

But anyone starting fresh from Drupal 9.4 won't be able to composer require this module...

super_romeo’s picture

Error: Class "Http\Adapter\Guzzle6\Client" not found в Drupal\Component\DependencyInjection\Container->createService() (строка 262 из /DATA/home-sites/lom/web/core/lib/Drupal/Component/DependencyInjection/Container.php)

To fix it replace Guzzle6 to Guzzle7:

  geocoder.http_adapter:
    class: Http\Adapter\Guzzle6\Client
    arguments: ['@http_client']
itamair’s picture

Title: Changing php-http/guzzle6-adapter dependency into guzzlehttp/guzzle » Drupal 10 compatibility: changing php-http/guzzle6-adapter dependency into php-http/guzzle7-adapter
itamair’s picture

Status: Active » Needs work

of course the provided solution in 3283651-guzzle6-adapter is not a good one at the moment as it breaks all the Geocoding functionalities ... as reported by @super_romeo

itamair’s picture

Version: 8.x-3.x-dev » 8.x-4.0
Status: Needs work » Needs review

I have deployed a new (for testing / experimental) geocoder 8.x-4.0 release that could be required with the following command:

$ composer require 'drupal/geocoder:^4.0'

and that relies on the following updated dependency:

"php-http/guzzle7-adapter": "^1.1.0",

I was able to make it correctly required into my Drupal 9.4 project accomplishing the following conditions:

- removed drupal/console (that requires drupal/console-core that requires guzzlehttp/guzzle ~6.1)
- removed drupal/core-recommended (that still requires guzzlehttp/guzzle ~6.1)

I have marked this 8.x-4.0 release with the following:

core_version_requirement: ^9 || ^10

but important to mention that this (very probably) cannot still work with Drupal 10 (that requires PHP >= 8.1)
and some of its php geocoders, that still require only php ^7.0, such the followings:

  • geocoder-php/graphhopper-provider
  • geocoder-php/mapbox-provider
  • geocoder-php/photon-provider

Please Test and Review this 8.x-4.0 Geocoder release and let me know if everything works fine and your follow-ups and further suggestions:
should we make this a parallel supported version, when, and why ...

super_romeo’s picture

Hello @itamair!
Yesterday I could install only Guzzle 7 (because of composer conflicts).
But now I made composer update and all downgraded to Guzzle 6.
So problem disappeared.
I think something was changed in another packages.

itamair’s picture

Not really sure I get what you mean/meant @super_romeo ... but I am glad if you solved your issues on this.

weseze’s picture

I'm still having a lot of issues trying to get this properly installed on D9.4...
I'm not familiar with the inner workings of this module and it seems a bit much to get into right now. But I can provide e detailed list of the steps I did. Hopefully this can give some insights to get this resolved.

First of, the 4.x branch isn't working at all...

Consider this composer.json file:

{
  "repositories": [
    {
      "type": "composer",
      "url": "https://packages.drupal.org/8"
    }
  ],
  "require": {
    "drupal/core": "~9.4.0",
    "drupal/core-composer-scaffold": "~9.4.0",
    "drupal/core-vendor-hardening": "~9.4.0"
  },
  "config": {
    "allow-plugins": true
  }
}

Run composer install on it, everything is working fine.
Now I want to add drupal/geocoder, so I run composer require drupal/geocoder and I get error:

Using version ^4.0 for drupal/geocoder
./composer.json has been updated
Running composer update drupal/geocoder
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires drupal/geocoder ^4.0 -> satisfiable by drupal/geocoder[4.0.0].
- drupal/geocoder 4.0.0 requires php-http/guzzle7-adapter ^1.1.0 -> found php-http/guzzle7-adapter[dev-master, 1.x-dev (alias of dev-master)] but it does not match your minimum-stability.

You can also try re-running composer require with an explicit version constraint, e.g. "composer require drupal/geocoder:*" to figure out if any version is installable, or "composer require drupal/geocoder:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

If I try the 3.x branch it works. (composer require drupal/geocoder:^3.0)
However if I then require the Google Maps geocoder (as per the readme instructions): composer require geocoder-php/google-maps-provider
It fails again...:

Using version ^4.6 for geocoder-php/google-maps-provider
./composer.json has been updated
Running composer update geocoder-php/google-maps-provider
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- geocoder-php/common-http[4.0.0, ..., 4.4.0] require php-http/client-implementation ^1.0 -> could not be found in any version, but the following packages provide it:
- symfony/http-client Provides powerful methods to fetch HTTP resources synchronously or asynchronously
- php-http/guzzle6-adapter Guzzle 6 HTTP Adapter
- symfony/symfony The Symfony PHP framework
- php-http/curl-client PSR-18 and HTTPlug Async client with cURL
- php-http/guzzle7-adapter Guzzle 7 HTTP Adapter
- kriswallsmith/buzz Lightweight HTTP client
- php-http/mock-client Mock HTTP client
- php-http/socket-client Socket client for PHP-HTTP
- php-http/guzzle5-adapter Guzzle 5 HTTP Adapter
- voku/httpful A Readable, Chainable, REST friendly, PHP HTTP Client
- php-http/react-adapter React HTTP Adapter
- jorge-matricali/http-client A wrapper of libcurl that implements PSR-7 HTTP message interface.
- juststeveking/http-slim A slim psr compliant http client to provide better interoperability.
- php-http/buzz-adapter Buzz HTTP Adapter
- code-tool/curl-client cURL client
- code-tool/socket-client Socket client for PHP-HTTP
- php-http/cakephp-adapter Cake adapter for PHP-HTTP
- windwalker/http Windwalker Http package
- windwalker/framework The next generation PHP framework.
- swisnl/php-http-fixture-client Fixture client for PHP-HTTP
... and 35 more.
Consider requiring one of these to satisfy the php-http/client-implementation requirement.
- geocoder-php/google-maps-provider 4.6.0 requires geocoder-php/common-http ^4.0 -> satisfiable by geocoder-php/common-http[4.0.0, ..., 4.4.0].
- Root composer.json requires geocoder-php/google-maps-provider ^4.6 -> satisfiable by geocoder-php/google-maps-provider[4.6.0].

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see for more details.
- It's a private package and you forgot to add a custom repository to find it

Read for further common problems.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require geocoder-php/google-maps-provider:*" to figure out if any version is installable, or "composer require geocoder-php/google-maps-provider:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

I tried running "composer require geocoder-php/google-maps-provider --with-dependencies" to allow for downgrades, but that didn't help.
I was finally able to fix it by running "rm composer.lock && composer require geocoder-php/google-maps-provider --with-dependencies"

Not sure what the exact issue is here, but it seems to be a dependency-hell issue... somewhere in the googlemaps provider.
I also assume that there is no fix to be made here as long as the "geocoder-php/google-maps-provider" does not support guzzle7 and once D9.4 has required version 7, which it does do, there seems to be no easy way to revert other then deleting the composer.lock file.

weseze’s picture

So I was finally able to solve this issue by not using:

composer require geocoder-php/google-maps-provider

But using:

composer require geocoder-php/google-maps-provider guzzlehttp/guzzle:^6.0 php-http/guzzle6-adapter:^2.0 --with-dependencies

But this will lock my entire setup to guzzle6, which will give issues eventually when updating to a version of Drupal which will require guzzle7...

itamair’s picture

@weseze ... of course the composer require 'drupal/geocoder:^3.0' will work and should work as it is the actual supported version for Drupal 8.x and 9.x (used by thousands of websites)
... as long as you don't have conflicts or un-compatibilities in your composer requirements.

For the
composer require 'drupal/geocoder:^4.0'
it is much more complicate, because still many dependencies are using only the guzzlehttp/guzzle version 6.x
so to make it correctly included in your project you have to remove all those incompatibilities and it will work, as I have been able to make it working on my Drupal 9.4 ... (mentioned that in my case I had to completely remove drupal/console and drupal/core-recommended
But may be your case is even more complicated ... I don't know. I assume you already removed all your geocoder-php dependencies (some of them cannot work with guzzlehttp/guzzle version 7.x still, and for sure).

The 'drupal/geocoder:^4.0' won't be easily adoptable until other dependencies won't update their owns and upgrade to guzzlehttp/guzzle version7.x

I am confident that it will be done by the arrival of Drupal 10 ... and we cannot do differently.

schoenef’s picture

I could manage in a drupal 9.4 project like this:

  1. Changing drupal/core-recommended to drupal/core
  2. composer update
  3. Solving some trouble with drupal/core-composer-scaffold and drupal/core-project-message - I also raised theire verison number to 9.4 and had to remove drupal/geocoder in the process
  4. composer require 'drupal/geocoder:^4.0'

I tested and it works fine for my usecase (reverse geocoding from address to geo corrdinates)

It appears to be a strange inbetween time from guzzle 6 to 7... fingers crossed and thx a lot for the work!

claudiu.cristea’s picture

Status: Needs review » Reviewed & tested by the community

@itamair, I've required ^4.0 and it's doing the job. Thank you!

However, I see no 4.x (or 8.x-4.x) branch and it would be nice if this new release could appear more prominently on the project's page.

claudiu.cristea’s picture

Also, it looks like 8.x-3.x branch has diverged. We definitely, need a 4.x branch

claudiu.cristea’s picture

Status: Reviewed & tested by the community » Needs work

Found another issue:

"php-http/guzzle7-adapter": "^1.1.0",

There's no version to satisfy this constraint in https://github.com/php-http/guzzle7-adapter/tags. As an effect, on my project , it installs the master branch. I think it should be changed to:

"php-http/guzzle7-adapter": "^1.0",
itamair’s picture

Category: Bug report » Feature request
Status: Needs work » Needs review

Thanks @claudiu.cristea ... I guess you are right.
I didn't publish yet a 4.x branch release due the extended dependencies of other packages (and some php geocoders providers themselves) by the php-http/guzzle6-adapter ...

Anyway I just deployed a new 8.x-4.2 release with "php-http/guzzle7-adapter": "^1.0 dependency and with specific Readme.md documentatin page, and also added Geocoder 4.x branch mention and description in the Geocoder Drupal.org page itself (and with reference to this issue thread).

claudiu.cristea’s picture

Status: Needs review » Needs work

@itamair, unfortunately, somehow, in the 4.3.0 release this has been reverted https://git.drupalcode.org/project/geocoder/-/blob/8.x-4.3/composer.json... Looks to me as if 4.3.0 hasn't been tagged from the 8.x-4.x branch. Could you, please, align them?

itamair’s picture

@claudiu.cristea not sure I get that.
Now once I run the following:

composer require 'drupal/geocoder:^4.3'

I get the geocoder 4.3 release exactly with this: https://git.drupalcode.org/project/geocoder/-/blob/8.x-4.x/composer.json...

What am I missing?

claudiu.cristea’s picture

Could you check the installed version? composer info drupal/geocoder? Is it 4.3.0? Because I had ^4.0 as constraint and I got this https://git.drupalcode.org/project/geocoder/-/blob/8.x-4.3/composer.json (which is the 4.3.0 stable version according to GitLab repo)

EDIT: Look at the URL that you've posted in the last comment. It's the branch (8.x-4.x), not the stable (8.x-4.3)

itamair’s picture

Ok I got it. Sorry my bad, as taking care of many Geofield stack modules updates these days.
New 8.x-4.4 release deployed with everything realigned ...

Thanks, great catch.

w01f’s picture

I'm getting the following error still when trying to update geocoder to a more recent release (I just tried 4.4). Am I missing an additional step or something in my config causing this?

baseos | ~/myproject$ composer require 'drupal/geocoder:^4.4'
./composer.json has been updated
Running composer update drupal/geocoder
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - php-http/guzzle7-adapter[dev-master, 1.0.0] require guzzlehttp/guzzle ^7.0 -> found guzzlehttp/guzzle[dev-master, 7.0.0-beta.1, ..., 7.5.x-dev (alias of dev-master)] but the package is fixed to 6.5.8 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/geocoder 4.4.0 requires php-http/guzzle7-adapter ^1.0 -> satisfiable by php-http/guzzle7-adapter[1.0.0, 1.x-dev (alias of dev-master)].
    - php-http/guzzle7-adapter 1.x-dev is an alias of php-http/guzzle7-adapter dev-master and thus requires it to be installed too.
    - Root composer.json requires drupal/geocoder ^4.4 -> satisfiable by drupal/geocoder[4.4.0].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
dan_metille’s picture

I'm getting same kind of error as above:

  Problem 1
    - php-http/guzzle7-adapter 1.0.0 requires guzzlehttp/guzzle ^7.0 -> found guzzlehttp/guzzle[7.0.0, ..., 7.5.0] but the package is fixed to 6.5.8 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/geocoder 4.4.0 requires php-http/guzzle7-adapter ^1.0 -> satisfiable by php-http/guzzle7-adapter[1.0.0].
    - Root composer.json requires drupal/geocoder ^4.4 -> satisfiable by drupal/geocoder[4.4.0].
adaragao’s picture

I'm having the same problem as the two previous comments, maybe this can help:

composer why guzzlehttp/guzzle

drupal/console-core      1.9.7  requires  guzzlehttp/guzzle (~6.1)              
drupal/core              9.4.7  requires  guzzlehttp/guzzle (^6.5.8 || ^7.4.5)  
drupal/core-recommended  9.4.7  requires  guzzlehttp/guzzle (~6.5.8)  
claudiu.cristea’s picture

@adaragao See https://www.drupal.org/project/drupal/issues/3225966

I think your issue is that drupal/core-recommended still requires Guzzle 6. You should replace drupal/core-recommended with drupal/core

Also drupal/console-core needs a version that allows guzzle 7 too: https://github.com/hechoendrupal/drupal-console-core/issues/387

claudiu.cristea’s picture

Status: Needs work » Reviewed & tested by the community

I think this is done and should be closed

karimbou’s picture

So you're saying we need to use drupal/console-core instead of drupal/console ?
Using D9.4.8 PHP8.1 here's the result for me :

composer why guzzlehttp/guzzle :

drupal/console-core       1.9.8   requires guzzlehttp/guzzle (^6.5.8|^7.4.5)    
drupal/core               9.4.8   requires guzzlehttp/guzzle (^6.5.8 || ^7.4.5) 
drush/drush               11.2.1  requires guzzlehttp/guzzle (^6.5 || ^7.0)     
enlightn/security-checker v1.10.0 requires guzzlehttp/guzzle (^6.3|^7.0)        
fabpot/goutte             v3.3.1  requires guzzlehttp/guzzle (^6.0)             
php-http/guzzle6-adapter  v2.0.2  requires guzzlehttp/guzzle (^6.0)   
w01f’s picture

Sorry, probably a newb question - but what is the difference between core-recommended and core? I think I remember switching the other way a few years ago when I had to composerify all of my sites? Is "core" the official version now that will be best to use when upgrading to D10? Is there any documentation comparing these two? Thanks in advance!

nick hope’s picture

I'm also prevented from installing the Geocoder 4.X branch because I have drupal/core-recommended: "^9.4" in my composer.json file, which requires guzzle ~6.5.8 (my site was based on the drupal-project template which specifies drupal/core-recommended).

@W01F You can see the drupal/core-recommended README file for an explanation, and there is also a discussion on Drupal Answers. Personally I think I prefer to stay with drupal/core-recommended rather than drupal/core, so I will stay with Geocoder 3.X for now and revisit this when I upgrade to D10.

claudiu.cristea’s picture

@W01F

drupal/core-recommended is just a wrapper around drupal/core which limits the constraints of core dependencies to those that were tested in Drupal CI. It doesn't allow a dependency to update to a higher version than the one already tested in the Drupal.org testing pipeline.

drupal/core-recommended limits Guzzle to 6. But D10 & PHP 8.1 need Guzzle 7. If you want to update, you'll need to switch from drupal/core-recommended to drupal/core to unleash Guzzle 7

loopy1492’s picture

Definitely cannot upgrade this package to 4.x on a site using drupal/core-recommended 9.x and removing core-recommended causes a cascade of dependency issues which are just a nightmare to resolve.

I probably won't upgrade to 4.x until we go to Drupal 10 itself.

willids’s picture

Same problem. on Drupal core 9.5.3

Problem 1
- php-http/guzzle7-adapter 1.0.0 requires guzzlehttp/guzzle ^7.0 -> found guzzlehttp/guzzle[7.0.0, ..., 7.5.0] but the package is fixed to 6.5.8 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- drupal/geocoder 4.4.0 requires php-http/guzzle7-adapter ^1.0 -> satisfiable by php-http/guzzle7-adapter[1.0.0].
- Root composer.json requires drupal/geocoder ^4.4 -> satisfiable by drupal/geocoder[4.4.0].

Once installed unable to update the structure of items as it stops updating this running correctly- composer require geocoder-php/google-maps-provider

piotr pakulski’s picture

Same problem with drupal/core-recommended looks like waiting for D10 is the only option if I do not want to strip out recommended?

  • itamair committed 699c1401 on 8.x-3.x
    "php-http/guzzle7-adapter" dependency fixed into "^1.0" (Issue #3283651...

  • itamair committed 9f390c96 on 8.x-3.x
    Issue #3283651 by claudiu.cristea, itamair: Drupal 10 compatibility:...
willids’s picture

Getting this error, not able to edit any content types because of this.

Drupal 9.5.8
PHP 8.1
Geocoder 8.x-49

================
[27-Apr-2023 10:26:05 Europe/London] Error: Class "Http\Adapter\Guzzle7\Client" not found in /home/DOMAINNAME/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 #0 /home/DOMAINNAME/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'geocoder.http_a...')
#1 /home/DOMAINNAME/public_html/modules/geocoder/src/ConfigurableProviderUsingHandlerWithAdapterBase.php(88): Drupal\Component\DependencyInjection\Container->get('geocoder.http_a...')
#2 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\geocoder\ConfigurableProviderUsingHandlerWithAdapterBase::create(Object(Drupal\Core\DependencyInjection\Container), Array, 'googlemaps', Array)
#3 /home/DOMAINNAME/public_html/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('googlemaps', Array)
#4 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(62): Drupal\Component\Plugin\PluginManagerBase->createInstance('googlemaps', Array)
#5 /home/DOMAINNAME/public_html/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->initializePlugin('googlemaps')
#6 /home/afvbcouk/public_html/modules/geocoder/src/Plugin/GeocoderProviderPluginCollection.php(22): Drupal\Component\Plugin\LazyPluginCollection->get('googlemaps')
#7 /home/afvbcouk/public_html/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(83): Drupal\geocoder\Plugin\GeocoderProviderPluginCollection->get('googlemaps')
#8 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(99): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->setConfiguration(Array)
#9 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(55): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->addInstanceId('googlemaps', Array)
#10 /home/DOMAINNAME/public_html/modules/geocoder/src/Entity/GeocoderProvider.php(103): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->__construct(Object(Drupal\geocoder\ProviderPluginManager), 'googlemaps', Array)
#11 /home/DOMAINNAME/public_html/modules/geocoder/src/Entity/GeocoderProvider.php(119): Drupal\geocoder\Entity\GeocoderProvider->getPluginCollection()
#12 /home/afvbcouk/public_html/modules/geocoder/src/Entity/GeocoderProvider.php(144): Drupal\geocoder\Entity\GeocoderProvider->getPlugin()
#13 /home/DOMAINNAME/public_html/modules/geocoder/src/ProviderPluginManager.php(236): Drupal\geocoder\Entity\GeocoderProvider->isConfigurable()
#14 [internal function]: Drupal\geocoder\ProviderPluginManager->Drupal\geocoder\{closure}(Array, 0)
#15 /home/DOMAINNAME/public_html/modules/geocoder/src/ProviderPluginManager.php(238): array_map(Object(Closure), Array, Array)
#16 /home/DOMAINNAME/public_html/modules/geocoder/modules/geocoder_field/src/Plugin/Geocoder/Field/DefaultField.php(320): Drupal\geocoder\ProviderPluginManager->providersPluginsTableList(Array)
#17 /home/afvbcouk/public_html/modules/geocoder/modules/geocoder_field/geocoder_field.module(91): Drupal\geocoder_field\Plugin\Geocoder\Field\DefaultField->getSettingsForm(Object(Drupal\field\Entity\FieldConfig), Array, Object(Drupal\Core\Form\FormState))
#18 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(562): geocoder_field_form_field_config_edit_form_alter(Array, Object(Drupal\Core\Form\FormState), 'field_config_ed...')
#19 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(838): Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object(Drupal\Core\Form\FormState), 'field_config_ed...')
#20 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(282): Drupal\Core\Form\FormBuilder->prepareForm('field_config_ed...', Array, Object(Drupal\Core\Form\FormState))
#21 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\field_ui\Form\FieldConfigEditForm), Object(Drupal\Core\Form\FormState))
#22 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#23 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#24 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#25 /home/afvbcouk/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#26 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#27 /home/DOMAINNAME/public_html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#28 /home/afvbcouk/public_html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#29 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /home/DOMAINNAME/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /home/DOMAINNAME/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /home/DOMAINNAME/public_html/modules/advban/src/AdvbanMiddleware.php(57): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /home/DOMAINNAME/public_html/core/modules/ban/src/BanMiddleware.php(50): Drupal\advban\AdvbanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /home/DOMAINNAME/public_html/modules/remove_http_headers/src/StackMiddleware/RemoveHttpHeadersMiddleware.php(49): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 /home/DOMAINNAME/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#39 /home/DOMAINNAME/public_html/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#40 /home/DOMAINNAME/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#41 {main}

==============

the_g_bomb’s picture

Confirmed this is still a problem for the recommended module version

Running:
composer require drupal/geocoder
results in:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- php-http/guzzle7-adapter[1.0.0, ..., 1.x-dev] require guzzlehttp/guzzle ^7.0 -> found guzzlehttp/guzzle[7.0.0-beta.1, ..., 7.5.x-dev] but these were not loaded, likely because it conflicts with another require.
- drupal/geocoder[4.9.0, ..., 4.x-dev] require php-http/guzzle7-adapter ^1.0 -> satisfiable by php-http/guzzle7-adapter[1.0.0, 1.x-dev].
- Root composer.json requires drupal/geocoder ^4.9 -> satisfiable by drupal/geocoder[4.9.0, 4.x-dev].

Running:
composer require drupal/geocoder:4.x-dev@dev
results in:
Completed installation

transmitter’s picture

I seem to be unable to install the dev version successfully.

composer.phar require  'drupal/geocoder:4.x-dev@dev'
./composer.json has been updated
Running composer update drupal/geocoder
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - php-http/guzzle7-adapter 1.0.0 requires guzzlehttp/guzzle ^7.0 -> found guzzlehttp/guzzle[7.0.0, ..., 7.5.1] but the package is fixed to 6.5.8 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/geocoder 4.x-dev is an alias of drupal/geocoder dev-4.x and thus requires it to be installed too.
    - drupal/geocoder dev-4.x requires php-http/guzzle7-adapter ^1.0 -> satisfiable by php-http/guzzle7-adapter[1.0.0].
    - Root composer.json requires drupal/geocoder 4.x-dev@dev -> satisfiable by drupal/geocoder[4.x-dev (alias of dev-4.x)].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Same as in the geocoder:^4.9 branch.

Is there an alternative to first upgrade to 10 and then switch Geocoder back on - even though I can't uninstall it, since fields are using it?

I've removed the core-recommended entry from composer.json.
But still:

composer.phar why guzzlehttp/guzzle
drupal/core               9.5.9   requires guzzlehttp/guzzle (^6.5.8 || ^7.4.5) 
drush/drush               11.5.1  requires guzzlehttp/guzzle (^6.5 || ^7.0)     
enlightn/security-checker v1.10.0 requires guzzlehttp/guzzle (^6.3|^7.0)        
php-http/guzzle6-adapter  v2.0.2  requires guzzlehttp/guzzle (^6.0) 

What to do about the php-http/guzzle6-adapter v2.0.2 requires guzzlehttp/guzzle (^6.0) ?

itamair’s picture

Hey here ... good news here, on my side

I am on al fresh Drupal 10, with

drupal/core-recommended

and I cannot reproduce any specific issues/impediments with the following commands that require Geocoder 8.x-4.x branch now:

composer require drupal/geocoder:^4.9
composer require drupal/geocoder:4.x-dev@dev
composer require drupal/geocoder:4.x-dev

also I am able to successfully require the following geocoder providers:

geocoder-php/arcgis-online-provider
geocoder-php/google-maps-provider

Specifically my configuration is the following:

Drupal version: 10.0.4
PHP: 8.1
Composer version 2.5.4
etc.

It looks to me that Geocoder 8.x-4.x branch can be installed nicely on Drupal 10 now, without major core and accessory libraries incompatibilities.
Do you experience the same successful workflow (also with drupal/core-recommended required) ?

Can we set it as Recommended branch too?

dadderley’s picture

I have a Drupal 9.5.9 site running in php8.1.13.
When I try to update Geocoder.

me@mebox ost9 % composer require 'drupal/geocoder:^4.9'
./composer.json has been updated
Running composer update drupal/geocoder
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - php-http/guzzle7-adapter 1.0.0 requires guzzlehttp/guzzle ^7.0 -> found guzzlehttp/guzzle[7.0.0, ..., 7.5.1] but the package is fixed to 6.5.8 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/geocoder 4.9.0 requires php-http/guzzle7-adapter ^1.0 -> satisfiable by php-http/guzzle7-adapter[1.0.0].
    - Root composer.json requires drupal/geocoder ^4.9 -> satisfiable by drupal/geocoder[4.9.0].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
me@mebox ost9 %

I want to upgrade to Drupal 10 and this is a blocker.

Looks like installing geocoder:4.9 on a Drupal 10 site works, but how do I do the upgrade?

grahamshepherd’s picture

I followed the example of csv_serialization:

"When preparing for an upgrade to Drupal 10 we recommend that you widen your Composer version constraints to allow either 2.x or 3.x: composer require drupal/csv_serialization:^2.0 || ^3.0. This will allow the module to be automatically upgraded when you upgrade Drupal core."

In the case of geocoder I edited composer.json to:

"require": {
  ...
  "drupal/geocoder": "^3.20 || ^4.0",
  ...
}

Upgrade status continued to report that geocoder was incompatible.
Nevertheless, I ran:

composer require 'drupal/core-recommended:^10' 'drupal/core-composer-scaffold:^10' 'drupal/core-project-message:^10' --update-with-dependencies --no-update

Followed by:

composer update

Database updates proceeded correctly.

Drupal updated to 10.0.9 and geocoder updated to 8.x-4.9.

Success.

I suggest adding a paragraph to the project page:

"When preparing for an upgrade to Drupal 10 we recommend that you widen your composer version constraints to allow either 3.x or 4.x. Edit composer.json to require drupal/geocoder: "^3.0 || ^4.0". This will allow the module to be automatically upgraded when you upgrade Drupal core."

dadderley’s picture

Thank you Graham Shepherd

This simple manual modification of composer.json allowed me to upgrade from 9.5.9 to 10.0.9 and geocoder to be updated from 8.x-3.34 to 10.x-4.9

itamair’s picture

Thanks @GrahamShepherd ...
Your #50 comment looks a great contribution to this thread.
Noted it for soon implementation in the module presentation page and documentation.

transmitter’s picture

Thanks @GrahamShepherd,
worked here as well now.

grahamshepherd’s picture

Thanks for the feedback.

It would seem appropriate that upgrade_status should recognize the broadening of composer.json version requirements where appropriate. There are probably several modules in the geocoder and csv_serialization category where a new version is required for Drupal 10 which is not compatible with Drupal 9.

I wll put in a suggestion to that effect against that module.

  • itamair committed d0a926c0 on 8.x-4.x
    Readme.md documentation upgrade on how to properly upgrade to Drupal 10...

  • itamair committed fede55e6 on 8.x-4.x
    Drupal.org Project page documentation upgrade on how to properly upgrade...

  • itamair committed 91f4cf3d on 8.x-3.x
    Drupal.org Project page documentation upgrade on how to properly upgrade...
itamair’s picture

@GrahamShepherd ... your suggested documentation on how to (more) seamlessly upgrade to Drupal 10 and Geocoder 4.x have been added in the Drupal.org Geocoder main page documentation (so as also on the Geocoder 4.x-dev branch Readme.md file)

grahamshepherd’s picture

Thanks @itamair. I notice that on the project page the link to the issue goes nowhere, ie it need an href="".

"This will allow the module to be automatically upgraded when you upgrade Drupal core.
(For more info refer to this Issue Comment.)"

It's petty, I'm sorry, but for completeness.

I have added this issue to the upgrade status module: https://www.drupal.org/project/upgrade_status/issues/3363765

itamair’s picture

thanks for the catch @GrahamShepherd ... fixed that link.

hockey2112’s picture

composer require drupal/geocoder:^3.20 || ^4.0

That worked for me as well. Thanks!

willids’s picture

Tried
composer require drupal/geocoder:^3.20 - not worked

Tried
composer require drupal/geocoder:^4.0 - worked

Cheers

alina.basarabeanu’s picture

Upgrading from 3 to 4 versions is impossible because of the php-http/guzzle6-adapter requirement.
Can this fix be merged as soon as possible? we really need to move to Drupal 10 and this is the only module blocking us.

itamair’s picture

@Alina Basarabeanu before upgrading from geocoder 3.x to 4.x branch you indeed need to remove php-http/guzzle6-adapter dependency and (before of it) any other module/library/component you do have that is depending from it ...

Once done, you will be able to "composer require 'drupal/geocoder:^4.9'", and require php-http/guzzle7-adapter along with it ...

alina.basarabeanu’s picture

Merging the pull request for this issue makes the process much easier and faster.

itamair’s picture

Well ... the MR attached to this was just an initial workaround removing the php-http/guzzle6-adapter dependency.
But it doesn't look a solid and wise solution, because it assumes the php-http/guzzle6-adapter or php-http/guzzle7-adapter should be in parallel required (or already present) somehow.
They are a dependency requirement for this module (3.x or 4.x branches), and this won't work if not already present and not automatically required as dependency.
So we still need to explicitly add as dependency of this module ... (or am I missing something?)

erwangel’s picture

Typing composer require drupal/geocoder:^3.20 || ^4.0 as per #61 simply installs the geocoder 3 (3.34.0 in my case on Drupal 9.5). Of course geocoder 3 seems to work with Drupal 9.5. But we still need a solution for installing geocoder 4 on Drupal 9 and 10.

itamair’s picture

Hey hey! Now the following:

composer require 'drupal/geocoder'

will require drupal/geocoder:4.x branch by default, as the 4.x is marked as Recommended branch,
and so in Drupal 9.4+ and Drupal 10

Of course you should get rid from your code base (and composer requirements) of any constrain that prevents it (even your PHP version, that should be 8+).

SO DEFINITELY WE HAVE A CLEAR WAY TO INSTALL Gecoder module (4.x) for Drupal 9.4+ and Drupal 10

This Geofield Live Demo site is indeed a Drupal 10 correctly working with Geocoder 4.x branch (last release).

If you are blocked on this, it depends on your composer code base & requirements / constraints (and may be your lack of capabilities in solving them), and not caused by Geocoder 4.x limitations / incompatibilities ...

Otherwise please arise and document a clear Blocker dependency on this.

joseph.olstad’s picture

robcarr’s picture

The blocker if you are trying to prep a site for D9 > D10 upgrade is guzzlehttp/guzzle. Run `composer why guzzlehttp/guzzle` and you can see that drupal/core-recommended (9.5.11) requires guzzlehttp/guzzle (~6.5.8) (whereas drupal/core is more flexible as it requires guzzlehttp/guzzle (^6.5.8 || ^7.4.5)).

Only solution is at #3283651-50: Drupal 10 compatibility: changing php-http/guzzle6-adapter dependency into php-http/guzzle7-adapter (#50) to modify your composer.json file

netgeek123’s picture

Ran;

composer why guzzlehttp/guzzle
donutdan4114/shopify            2020.01.2 requires guzzlehttp/guzzle (~6.0)             
drupal/core                     9.5.11    requires guzzlehttp/guzzle (^6.5.8 || ^7.4.5) 
drupal/core-recommended         9.5.11    requires guzzlehttp/guzzle (~6.5.8)           
drush/drush                     11.6.0    requires guzzlehttp/guzzle (^6.5 || ^7.0)     
enlightn/security-checker       v1.11.0   requires guzzlehttp/guzzle (^6.3|^7.0)        
php-http/guzzle6-adapter        v2.0.2    requires guzzlehttp/guzzle (^6.0)             
sainsburys/guzzle-oauth2-plugin v3.0.7    requires guzzlehttp/guzzle (^6.0|^7.0)

Simply changing the composer.json php-http/guzzle6-adapter v2.0.2 requires guzzlehttp/guzzle (^6.0) to requires guzzlehttp/guzzle (^6.5.8 || ^7.4.5) should work?

And change the core recommended?

rolodmonkey’s picture

Status: Reviewed & tested by the community » Needs work

Since it has been more than a year since this was marked RTBC, and people are still actively debating the correct solution, I am bumping this back down to "Needs work".

itamair’s picture

Status: Needs work » Reviewed & tested by the community

Thanks @RoloDMonkey but this doesn't need any work on the Geocoder side, as there is no real issue in adopting Geocoder 8.x-4.x branch (k of adoptions already) and also no real in moving from 8.x-3.x into 8.x-4.x,
but only a correct approach and understanding how each existing composer based project should remove any dependency from php-http/guzzle6-adapter and simply move on ...

Previous comments (#50) simply prove that a smart and feasible upgrade is possible and its advice/suggestion was even added in the project page.

Users simply need to go through this thread to find their way ...
RTBC is the proper state, to keep this still in the Open issues.

  • itamair committed d0a926c0 on 8.x-3.x
    Readme.md documentation upgrade on how to properly upgrade to Drupal 10...

  • itamair committed fede55e6 on 8.x-3.x
    Drupal.org Project page documentation upgrade on how to properly upgrade...
alexgreyhead’s picture

For anybody who's just arrived at the bottom of this thread and are trying to work out why Geocoder is stopping them preparing their D9 install for D10, please see comment #50 on this page - a few comments upwards :-)

/A