MarketPress invoice error

Hi I have a problem with my class-mp-pdf-invoice.php file. It's a fresh install of marketpress but not working
Gives a white screen at final stage of checkout.

Support access has been granted.

Error log revealed the following:

[13-May-2017 12:20:05 UTC] PHP Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'Requested HTML document contains no data.' in /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/frame_tree.cls.php:122
Stack trace:
#0 /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/dompdf.cls.php(676): Frame_Tree->build_tree()
#1 /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/dompdf.cls.php(846): DOMPDF->_process_html()
#2 /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/class-mp-pdf-invoice.php(129): DOMPDF->render()
#3 /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/class-mp-pdf-invoice-addon.php(122): MP_PDF_Invoice->generate_pdf_file('2cf2b39a3deb', 'invoice')
#4 [internal function]: MP_PDF_Invoice_Addon->mp_order_sendmail_attachme in /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/frame_tree.cls.php on line 122

    Dimitris

    Hey there Kieran,

    hope you're doing good today!

    Following up the chat session you had, I didn't notice if you performed a conflict test.
    https://premium.wpmudev.org/docs/getting-started/getting-support/
    Could you please try to deactivate all other plugins apart from WPMUDEV Dashboard plugin and MarketPress, switch to a default theme like TwentySeventeen, clear all caches, and give this another try?
    Here's a nice flow chart that could help you with that:
    https://premium.wpmudev.org/wp-content/uploads/2015/09/Support-Process-Support-Process.gif

    If this isn't doable by you, please consider creating a staging environment, meaning an exact copy of this website in another location in the same server, that could be used to test things safely.

    Let us know if that makes any difference!
    Warm regards,
    Dimitris

    Kieran

    Hi,

    I've tiredness deactivating all plugins but still receiving the error.

    Btw your flow chart needs refining. Because when I deactivated all plugins my Appointments plugin said I needed to upgrade. Rather strange I thought but did so and it upgraded me to Appointments lite! Which I then tried to deactivate and reinstall Appointments + but lost all my appointments!

    I think it would be best practice to not deactivated the wpmu Dev dashboard in future!

    Can someone please help it's getting urgent! the error log points to an OAuth certificate error but I'm not certain that's the real root of the issue.

    I've tried getting a new oAuth key twice and my appointments do sync to my calendar when confirmed in back end but still says error in log files.

    Thanks
    Kieran

    Adam Czajczyk

    Hello, Kieran!

    As for Appointments turning into "lite" version, I believe we discussed that already during our chat recently so I'll leave it for now.

    I appreciate your feedback on conflict test flowchart though, that sounds just about right so I'll raise that issue in our internal discussions. Thank you for pointing it out!

    As for PDF invoice. Could you please access your site using FTP or cPanel "File Manager" tool, go to

    /wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/

    folder and check permissions for "templates" folder and all the folders and files inside? Let me know about them, please.

    Best regards,
    Adam

    Kieran

    Hi Adam,

    Permissions is set to 755. However I have just moved to a new server where my permissions was not corrrect for the httaccess file so your thinking on permissions might be right but this one looks ok

    Could there be a firewall / permissions accesss issue for my OAuth certificate which could be causing all this? I have tried to renew that multiple times but keeping getting the expired error message.

    Kind Regards
    Kieran

    Dimitris

    Hey there Kieran,

    hope you're doing good today!

    I can see that we focused in the Appoitments+ issue with the GCalendar integration here, rather with the initially reported issue about MarketPress invoices.

    I can see the following messages considering the later:

    [13-May-2017 12:20:05 UTC] PHP Warning: include(/var/sites/t/xxxxxxxxxxxxxxxxxx.com/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/templates/default/invoice.php): failed to open stream: No such file or directory in /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/class-mp-pdf-invoice.php on line 291
    
    [13-May-2017 12:20:05 UTC] PHP Warning: include(): Failed opening '/var/sites/t/xxxxxxxxxxxxxxxxxx.com/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/templates/default/invoice.php' for inclusion (include_path='.:/opt/cpanel/ea-php56/root/usr/share/pear') in /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/class-mp-pdf-invoice.php on line 291
    
    [13-May-2017 12:20:05 UTC] PHP Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'Requested HTML document contains no data.' in /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/frame_tree.cls.php:122
    Stack trace:
    #0 /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/dompdf.cls.php(676): Frame_Tree->build_tree()
    #1 /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/dompdf.cls.php(846): DOMPDF->_process_html()
    #2 /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/class-mp-pdf-invoice.php(129): DOMPDF->render()
    #3 /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/class-mp-pdf-invoice-addon.php(122): MP_PDF_Invoice->generate_pdf_file('2cf2b39a3deb', 'invoice')
    #4 [internal function]: MP_PDF_Invoice_Addon->mp_order_sendmail_attachme in /homeweb/xxxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/frame_tree.cls.php on line 122

    Could you double check your whole WP installation, that all folders are set to 755 and files to 644?
    Ref: https://codex.wordpress.org/Changing_File_Permissions#Using_an_FTP_Client
    These should also be assigned with the proper user:group, which depends on the actual server setup (default Apache configuration uses "www-data:www-data" for example). For the later, you may have to contact your hosting provider to better advise you.

    You could also set a high number in max_execution_time as the zero value may get overridden in another server level. You could try: max_execution_time = 300
    Here's how: https://premium.wpmudev.org/blog/increase-memory-limit/

    Let us know how that goes!
    Warm regards,
    Dimitris

    Kieran

    Hi Dimitris

    I've increased the max execution time. All the folders are set to 755 and files are 644 inside my public_html folder. There are different setting for some of the other folders outside that.

    I'm on a new server though so suspect it could be linked to permission / usergroup permission.

    I still get the white screen with following error message. I've contacted my host to see if they can help

    [20-May-2017 11:36:04 UTC] PHP Notice:  unserialize(): Error at offset 5 of 8 bytes in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/common/class-mp-cart.php on line 387
    [20-May-2017 11:36:04 UTC] PHP Warning:  Invalid argument supplied for foreach() in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/common/class-mp-cart.php on line 388
    [20-May-2017 11:36:04 UTC] PHP Warning:  Invalid argument supplied for foreach() in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/common/class-mp-cart.php on line 436
    [20-May-2017 11:36:04 UTC] PHP Warning:  array_keys() expects parameter 1 to be array, boolean given in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/common/class-mp-cart.php on line 442
    [20-May-2017 11:36:04 UTC] PHP Warning:  Invalid argument supplied for foreach() in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/common/class-mp-cart.php on line 436
    [20-May-2017 11:36:04 UTC] PHP Warning:  array_keys() expects parameter 1 to be array, boolean given in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/common/class-mp-cart.php on line 442
    [20-May-2017 11:36:17 UTC] [Appointments+] [2017-05-20 11:36:17] INFO: Service Call {
        "service": "calendar",
        "resource": "calendarList",
        "method": "list",
        "arguments": []
    }
    
    [20-May-2017 11:36:17 UTC] [Appointments+] [2017-05-20 11:36:17] DEBUG: OAuth2 access token expired 
    
    [20-May-2017 11:36:17 UTC] [Appointments+] [2017-05-20 11:36:17] ERROR: The OAuth 2.0 access token has expired, and a refresh token is not available. Refresh tokens are not returned for responses that were auto-approved. 
    
    [20-May-2017 11:36:17 UTC] [Appointments+] [2017-05-20 11:36:17] INFO: Service Call {
        "service": "calendar",
        "resource": "calendarList",
        "method": "list",
        "arguments": []
    }
    
    [20-May-2017 11:36:17 UTC] [Appointments+] [2017-05-20 11:36:17] DEBUG: OAuth2 access token expired 
    
    [20-May-2017 11:36:17 UTC] [Appointments+] [2017-05-20 11:36:17] ERROR: The OAuth 2.0 access token has expired, and a refresh token is not available. Refresh tokens are not returned for responses that were auto-approved. 
    
    [20-May-2017 11:38:12 UTC] PHP Notice:  Undefined offset: 1 in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-admin/includes/dashboard.php on line 1227
    [20-May-2017 11:38:12 UTC] PHP Notice:  Undefined offset: 1 in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-admin/includes/dashboard.php on line 1227
    [20-May-2017 11:38:51 UTC] PHP Warning:  include(/var/sites/t/xxxxxxxxxxxxxxxce.com/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/templates/default/invoice.php): failed to open stream: No such file or directory in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/class-mp-pdf-invoice.php on line 291
    [20-May-2017 11:38:51 UTC] PHP Warning:  include(): Failed opening '/var/sites/t/xxxxxxxxxxxxxxxce.com/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/templates/default/invoice.php' for inclusion (include_path='.:/opt/cpanel/ea-php56/root/usr/share/pear') in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/class-mp-pdf-invoice.php on line 291
    [20-May-2017 11:38:51 UTC] PHP Fatal error:  Uncaught exception 'DOMPDF_Exception' with message 'Requested HTML document contains no data.' in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/frame_tree.cls.php:122
    Stack trace:
    #0 /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/dompdf.cls.php(676): Frame_Tree->build_tree()
    #1 /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/dompdf.cls.php(846): DOMPDF->_process_html()
    #2 /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/class-mp-pdf-invoice.php(129): DOMPDF->render()
    #3 /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/class-mp-pdf-invoice-addon.php(122): MP_PDF_Invoice->generate_pdf_file('0ab2302dc868', 'invoice')
    #4 [internal function]: MP_PDF_Invoice_Addon->mp_order_sendmail_attachme in /homeweb/xxxxxxxxxxxxxxx/public_html/wp-content/plugins/marketpress/includes/addons/mp-pdf-invoice/vendors/dompdf/include/frame_tree.cls.php on line 122

    Regards
    Kieran