1

I was running 2.1.8 (or if it was 2.1.9) and decided to upgrade. After some errors (documented at gitHub), I was able to run php bin/magento setup:upgrade. It tells me to run bin/magento setup:di:compile, which I did.

It throws the following error:

Fatal error:  Class MagePal\GmailSmtpApp\Model\Transport contains 1 
abstract method and must therefore be declared abstract or implement 
the remaining methods (Magento\Framework\Mail\TransportInterface::getMessage) 
in /opt/bitnami/apps/magento/htdocs/app/code/MagePal/GmailSmtpApp/Model/Transport.php 
on line 11

I tried clearing the different var-directories (when in my magento-root), with

rm -rf ./var/di/* ./var/view_preprocessed/* ./var/generation/* 
./var/composer_home/* ./var/cache/* ./var/page_cache/*

I've reset the permissions of the owner according to the manual at bitnami (this is the image I run, on a Google cloud instance).

I also looked into the transport.php-file. This didn't implement the getMessage()-function. So I used composer to get the latest (composer require magepal/magento2-gmailsmtpapp), I copied the complete folder into the app/code/-directory instead, as it was where I originally had it. Then, I removed it with composer (composer remove magepal/magento2-gmailsmtpapp). I again clean the different var-directories. I then run the magento setup:upgrade-command and magento setup:di:compile-command again. It throws the same error. For reference, the transport.php-file looks like this. This is one solution to the issue, I just messed up the copying (see below answer).

Sometimes, there is also a note about Segmentation fault. However, it seems to disappear after I've runned the setup:di:compile a couple of times, I also read about setting "ulimit -s 65536", it doesn't help.

The only thing I've been able to do, to get it up and running again is to rollback backups into a clean 2.1.9-installation.

Any advice would be very appreciated. Thanks.

0

2 Answers 2

4

I fixed the issue.

The root cause was that the app/code/MagePal/GmailSmtpApp-module wasn't updated when I used the web upgrade. My Magento-installation still contained old files. The error message is clear, one function / method missing (in the implementation of the abstract class). To fix this, I went ahead and thought I was replacing the old module with the new one (I used composer, composer require magepal/magento2-gmailsmtpapp, moved those files, and then used composer to remove it again, composer remove magepal/magento2-gmailsmtpapp).

What went wrong?

  • I copied the content of /GmailSmtpApp/* to /MagePal/. Instead, I should have copied the content of newmodulelocation/MagePal/* to /MagePal/
  • The old files were loaded and error still valid.

How to discover or debug a similar issue?

  • Search for some unique content of the first file. If found, investigate those files.
  • With linux-system, you search with the following command: sudo grep -r "Mail Transport"

Now, I only have other errors. I assume those are unrelated. If not, I'll come back.

2
  • Base off your error msg path (..../apps/magento/htdocs/app/code/MagePal) the module was manually installed, therefore installing and removing it using composer would not fix your issue. The best way to fix this issue so that it does not happen again is to delete app/code/MagePal/* and reinstall all extensions using composer so that it will automatically update the latest version during Magento upgrade. Commented Nov 18, 2017 at 15:59
  • Nice. Going to try it.
    – Jarnail S
    Commented Nov 23, 2017 at 12:54
3

put following function inside your app/code/MagePal/GmailSmtpApp/Model/Transport.php

/**
 * @inheritdoc
 */
public function getMessage()
{
    return $this->_message;
}

This is working solution for me.

I hope it will help you too :)

3
  • This is a workaround, not a proper solution :)
    – Niels
    Commented Oct 16, 2017 at 14:59
  • I tried to make it clearer in the question, that I realized that it was missing, and upgraded the module. However, in the answer above, you can see that I managed to copy it, but did so to the wrong destination. Commented Oct 16, 2017 at 17:08
  • You have to implement abstract method inside your class. Thanks. I will update answer if i will find anything else in answer. Commented Oct 17, 2017 at 7:30

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.