Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After installation of the module (via Drupal Console if that matters), I get the following error
Fatal error: Interface 'CommerceGuys\Addressing\Model\AddressFormatInterface' not found in /modules/contrib/address/src/Entity/AddressFormatInterface.php on line 21
Comments
Comment #2
bojanz CreditAttribution: bojanz at Centarro commentedDid you use Composer Manager to download the libraries?
Looks like the addressing library isn't getting found by the autoloader. However, hook_requirements() usually stops module installation in that case.
Comment #3
pjcarly CreditAttribution: pjcarly commentedNo i did not use composer, installed via drupal console
Comment #4
bojanz CreditAttribution: bojanz at Centarro commentedSomehow Drupal Console allowed you to enable the module even though you didn't install the required libraries.
That's a bug somewhere on their side. Check the module README for install instructions.
Comment #5
hendrik.fuss CreditAttribution: hendrik.fuss commentedI just tried to install address without fetching dependencies via composer beforehand, and it failed, as should be. However, after I run
composer drupal-update
, I have the same issue, and I'm getting the exact same PHP error.The required interface, AddressFormatInterface, is defined in vendor/commerceguys/addressing/src/Model/AddressFormatInterface.php, but apparently Drupal doesn't find it there.
Not sure why. Any ideas how to fix this?
Comment #6
bojanz CreditAttribution: bojanz at Centarro commentedSee #2632916: module doesnt find libraries. Looks like the solution is to run "composer dump-autoload". I'll add that to the README.
(I've yet to figure out what makes MAMP different to require this. Please post your setup to that issue as well).
Comment #8
hendrik.fuss CreditAttribution: hendrik.fuss commentedcomposer dump-autoload
fixed the problem for me, thanks bojanz!Comment #9
selwynpolit CreditAttribution: selwynpolit commentedI had this error occur when I tried upgrading Drupal from version 8.0.1 to 8.0.6 on a test site that had this module installed. I tried the composer dump-autoload but was still seeing the error so I did the following and it got better.
Comment #10
jduff CreditAttribution: jduff commentedI got this error after upgrading from Drupal 8.1.2 to 8.1.3 and selwynpolit's approach on comment #9 resolved the issue.
Comment #11
Yoran Scholiers CreditAttribution: Yoran Scholiers commentedLike #10 I got the error after upgrading to 8.1.3 from 8.1.2.
Comment #9 fixed it.
Comment #12
Andrej Galuf CreditAttribution: Andrej Galuf commentedSomething else to be careful about:
If you use drush up to update the core, it's likely that composer.json and composer.lock will be replaced. This means the requires are lost and the address cannot find the dependencies. The solution is to "redownload" the Address module (composer require drupal/address ~8.1)
Comment #13
bojanz CreditAttribution: bojanz at Centarro commentedYep. You should not be using drush up to update core. "composer update drupal/core --with-dependencies" is the one to use.
Comment #14
RKopacz CreditAttribution: RKopacz as a volunteer commentedJust a note to @bojanz on #13, I tried using this to update a site from 8.1.6 to 8.1.7 and it didn't work. Not sure why, did not receive and error message.
Comment #15
bojanz CreditAttribution: bojanz at Centarro commented@RKopacz
You received some output. Just because it's not in red doesn't mean it's not relevant :)
You probably used the tarball to install, where the drupal/core line in composer.json needs to be moved from "replace" to "require" before running the command.
Comment #16
StevenWill CreditAttribution: StevenWill commentedI just had to run the commands from comment #9 when updating to 8.0.7. Will this always have to be done? Is there a way around having to run this every time to update Drupal core? It can take some time to initialize and has overhead to manage.
Comment #17
RKopacz CreditAttribution: RKopacz as a volunteer commented@bojanz OK thanks I'll try that. I believe I did the site install with drush, so that might be it. I'll try that next time. Seems like everything is migrating to composer :)
Comment #18
just_like_good_vibesi was upgrading too and i tried all of the solutions... none of them work ! i'm very surprised.
indeed i did the upgrade through drush.
i will retry the update with a composer... what a mess !
Comment #19
msypes CreditAttribution: msypes commentedI don't know why this issue has been marked as fixed.
I just tried updating my Drupal core from 8.1.3 to 8.19 with Address8.x-1.0-beta3 in place and still get this same fatal error. No amount of composer updates of drupal/core, drupal/address, with or without dependencies, composer dump-autoloads, requires nor any other variant I've neglected has helped.
I don't know whether this is a core issue or an address issue any more, so I've put my two cents in under both issue queues.
Comment #20
bojanz CreditAttribution: bojanz at Centarro commentedUpdating core outside of Composer (composer update drupal/core --with-dependencies) will always break your site.
There's nothing for me to do there.
Core telling you to replace the vendor/ folder when performing manual updates is a bug, that line needs to be removed from all docs.
I think that "composer update drupal/address --with-dependencies" should redownload the removed vendor libraries. If not, you can always do "composer remove drupal/address" then redownload again "composer require drupal/address"
Comment #21
msypes CreditAttribution: msypes commentedFTR, I tried a core update without replacing the vendor folder as well, and still had these issues. I'll add the
composer remove drupal/address
then redownload you mentioned to my panoply.If it's any help, in the end, a restart of apache cleared everything up.
Comment #22
jnicola CreditAttribution: jnicola commentedJust ran into this issue with a project.
Drush up entirely blows away everything from commerce guys in vendor.
composer update drupal/core --with-dependencies returns this error and does not update Drupal at all: Package "drupal/core" listed for update is not installed. Ignoring.
composer dump-autoload changed nothing when run after any of the commands tried above.
Comment #23
bojanz CreditAttribution: bojanz at Centarro commented@jnicola
See #15
Comment #24
jnicola CreditAttribution: jnicola commentedThat I believe is what you detailed to do (move drupal/core to "require". It is unfortunately not working for me. Error is as follows:
Comment #25
bojanz CreditAttribution: bojanz at Centarro commentedThe instructions were for allowing core updates.
Try running "composer update drupal/address --with-dependencies" for healing your breakage.
Comment #26
jnicola CreditAttribution: jnicola commentedResults of composer update drupal/address --with-dependencies
Comment #27
bojanz CreditAttribution: bojanz at Centarro commentedCheck that you actually have a single vendor folder in your site root, and that it contains the commerceguys/ folder.
The last time someone reported this error they somehow ended up with two vendor folders on Platform.sh, so the wrong one was used.
I'm on IRC at #drupal-commerce if you need more help.
Comment #28
jnicola CreditAttribution: jnicola commentedI only have one vendor folder, there is a commerce guys folder in there that contains addressing.
Comment #29
bojanz CreditAttribution: bojanz at Centarro commentedIt's actually weird that "composer update drupal/address --with-dependencies" gives you nothing, considering that neither Address RC1 nor RC2 use the "CommerceGuys\Addressing\Model\AddressFormatInterface" class, beta4 was the last one that did.
Check that you don't have multiple address modules (one in modules/address the second in modules/contrib/address).
Comment #30
qproThis works for me:
1) /var/www/drupal/modules/composer_manager/scripts$ php init.php
Composer Manager has been successfully initialized.
Diferent path than that indicated in #9
2) /var/www/drupal$ composer update drupal/address --with-dependencies
Package "drupal/address" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
3) /var/www/drupal$ composer config repositories.drupal composer https://packages.drupal.org/8
var/www/drupal$ composer require "drupal/address"
Using version ^1.0@RC for drupal/address
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing commerceguys/enum (v1.0)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/addressing (v1.0.0-beta1)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/zone (dev-master 36fe2e8)
Cloning 36fe2e8f5a8091bf18417d6d409e363677122a99
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/intl (v0.7.3)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing drupal/address (1.0.0-rc3)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
commerceguys/addressing suggests installing symfony/intl (to use it as the source of country data)
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
4) /var/www/drupal$ composer drupal-update
> Drupal\composer_manager\Composer\Command::update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing google/apiclient (1.1.5)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing phayes/geophp (dev-master 6855624)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing leaflet/leaflet (v0.7.7)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing phpoffice/phpspreadsheet (0.0)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing league/csv (7.2.0)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing drupal/layout_plugin (8.1.0-alpha23)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing igorw/get-in (v1.0.3)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing egeloen/http-adapter (0.8.0)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing willdurand/geocoder (v3.3.0)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
egeloen/http-adapter suggests installing ext-http (Allows you to use the PECL adapter)
egeloen/http-adapter suggests installing guzzle/guzzle (Allows you to use the Guzzle 3 adapter)
egeloen/http-adapter suggests installing kriswallsmith/buzz (Allows you to use the Buzz adapter)
egeloen/http-adapter suggests installing nategood/httpful (Allows you to use the httpful adapter)
egeloen/http-adapter suggests installing zendframework/zendframework1 (Allows you to use the Zend 1 adapter)
egeloen/http-adapter suggests installing zendframework/zend-http (Allows you to use the Zend 2 adapter)
egeloen/http-adapter suggests installing symfony/stopwatch (Allows you to use the stopwatch http adapter and event subscriber)
willdurand/geocoder suggests installing ext-geoip (Enabling the geoip extension allows you to use the MaxMindProvider.)
willdurand/geocoder suggests installing geoip/geoip (If you are going to use the MaxMindBinaryProvider (conflict with geoip extension).)
willdurand/geocoder suggests installing geoip2/geoip2 (If you are going to use the GeoIP2DatabaseProvider.)
willdurand/geocoder suggests installing symfony/stopwatch (If you want to use the TimedGeocoder)
Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead.
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
Comment #31
bojanz CreditAttribution: bojanz at Centarro commentedClosing old issue.
Comment #33
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer and commentedThis has not been fixed... after updating to 8.5.1 I get the error
PHP Fatal error: Interface 'CommerceGuys\Addressing\AddressInterface' not found in /Users/brody/Documents/sites/beer/modules/contrib/address/src/AddressInterface.php on line 11
Comment #34
Huelfe CreditAttribution: Huelfe commentedI have this issue too as #33 described.
Comment #35
MurzGot same issue on Drupal 8.5.1 when installing Commerce module with dependencies.
Comment #36
barrypoore CreditAttribution: barrypoore commentedI'm having this same issue, I have updated with composer on my local mamp version and it appears fine, once I push to Acquia I get that same error:
Fatal error: Interface 'CommerceGuys\Addressing\AddressInterface' not found in /xxx/xxx/html/xxxxxxxxx/docroot/modules/contrib/address/src/AddressInterface.php on line 11 .....
I imported my local database with the working version into Acquia but still get the same error.
I have run composer update drupal/core --with-dependencies and it appears to have run although I can't see any library it may have downloaded and installed and git doesn't show any additional library.
Is there any way to manually check if the library is in place? Or the fact that it runs fine in local means the library is in place?
Comment #37
jahanaraS CreditAttribution: jahanaraS commentedcomposer require "drupal/address ~1.0" worked for me
Comment #38
Christophe Bourgois CreditAttribution: Christophe Bourgois as a volunteer commentedcomposer require "drupal/address ~1.0" worked for me also
Comment #39
etron770 CreditAttribution: etron770 commentedcomposer require "drupal/address ~1.0" worked for me also
Comment #40
Tart0Using Docker environments, I have to remove dependency from
/modules/address/composer.json
and add it to/composer.json
.Then,
composer update --ignore-platform-reqs
(I'm using docker, so the main system does not fullfy requirements) and it's works like a charm.Hope it's help
Comment #41
JimWho CreditAttribution: JimWho as a volunteer commentedDrupal noob here who doesn't understand half of what everyone else wrote. My scenario came when I updated the email address on a comment form using the Gaviad Edmix template. I clicked save and the whole site crashed and became unresponsive. The commerceguys lib version I had updated to was 1.4.2 after installing the core. I simply copied back the 1.4.0 files that were deleted with the upgrade and the server came back to life. If I did commerce on this site, I'm sure I'd be asking for problems later with the mismatch, but I don't, so I'm going to leave it be.