Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error when deploying to production #32

Open
ghost opened this issue Sep 20, 2016 · 11 comments
Open

Fatal error when deploying to production #32

ghost opened this issue Sep 20, 2016 · 11 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Sep 20, 2016

I'm not sure if this is an issue with Raccoon itself, or my manifest file. But when I deploy a site with Raccoon (loaded as an mu-plugin) to production, WordPress crashes and PHP logs the following error:

PHP Fatal error: Uncaught Error: Cannot use object of type Hiwelo\Raccoon\Manifest as array in /srv/users/serverpilot/apps/phmass-org-prod/web/app/mu-plugins/raccoon-plugin/lib/Raccoon.php:156 Stack trace: #0 /srv/users/serverpilot/apps/phmass-org-prod/web/app/mu-plugins/raccoon-plugin/lib/Raccoon.php(72): Hiwelo\Raccoon\Raccoon->loadEnvironmentStatus() #1 /srv/users/serverpilot/apps/phmass-org-prod/web/app/mu-plugins/raccoon-plugin/raccoon.php(38): Hiwelo\Raccoon\Raccoon->__construct() #2 /srv/users/serverpilot/apps/phmass-org-prod/web/wp/wp-includes/plugin.php(524): Roots\Bedrock\Autoloader::Hiwelo\Raccoon{closure}('') #3 /srv/users/serverpilot/apps/phmass-org-prod/web/wp/wp-settings.php(395): do_action('after_setup_the...') #4 /srv/users/serverpilot/apps/phmass-org-prod/web/wp-config.php(9): require_once('/srv/users/serv...') #5 /srv/users/serverpilot/apps/phmass-org-prod/web/wp/wp-load.php(44): require_once('/srv/users/serv...') #6 /srv/users/serverpilot/apps/phmass-org-prod/web/wp/wp-blog-header.php(13): require_once('/ in /srv/users/serverpilot/apps/phmass-org-prod/web/app/mu-plugins/raccoon-plugin/lib/Raccoon.php on line 156

@hiwelo
Copy link
Owner

hiwelo commented Sep 20, 2016

Hi, can I take a look of your manifest file?

@hiwelo hiwelo added the bug label Sep 20, 2016
@ghost
Copy link
Author

ghost commented Sep 20, 2016

Sure, here you go:

{
"namespace": "passive-house",
"post-types": {
"business": {
"labels": {
"name": "Businesses",
"singular_name": "Business",
"menu_name": "Businesses",
"name_admin_bar": "Business",
"add_new": "Add New",
"add_new_item": "Add New Business",
"new_item": "New Business",
"edit_item": "Edit Business",
"view_item": "View Business",
"all_items": "All Businesses",
"search_items": "Search Businesses",
"parent_item_colon": "Parent Business:",
"not_found": "No items found.",
"not_found_in_trash": "No items found in Trash."
},
"description": "Business.",
"public": "true",
"publicly_queryable": "true",
"query_var": "true",
"has_archive": "false",
"rewrite": {
"slug": "businesses"
},
"taxonomies": [
"business_cat"
],
"menu_icon": "dashicons-book-alt",
"supports": [
"title",
"editor",
"author",
"thumbnail",
"excerpt",
"revisions"
]
},
"project": {
"labels": {
"name": "Projects",
"singular_name": "Project",
"menu_name": "Projects",
"name_admin_bar": "Project",
"add_new": "Add New",
"add_new_item": "Add New Project",
"new_item": "New Project",
"edit_item": "Edit Project",
"view_item": "View Project",
"all_items": "All Projects",
"search_items": "Search Projects",
"parent_item_colon": "Parent Project:",
"not_found": "No items found.",
"not_found_in_trash": "No items found in Trash."
},
"description": "Projects.",
"public": "true",
"publicly_queryable": "true",
"query_var": "true",
"rewrite": {
"slug": "projects"
},
"menu_icon": "dashicons-clipboard",
"supports": [
"title",
"editor",
"author",
"thumbnail",
"excerpt",
"revisions"
]
}
},
"theme-features": {
"comments": false,
"js-detection": true,
"cleanup": true,
"svg-upload": true
}
}

@hiwelo
Copy link
Owner

hiwelo commented Sep 20, 2016

I will perform some tests to understand why this valid JSON manifest is read as an array rather than an object.

@ghost
Copy link
Author

ghost commented Sep 20, 2016

Thanks!

I'm not sure if it helps, but the fix so far has been to comment out line 156 of lib/Raccoon.php.

@hiwelo
Copy link
Owner

hiwelo commented Sep 20, 2016

Thank you for this information, it helps.
I will try to verify this fix and commit something it in the next minutes 😸

@hiwelo
Copy link
Owner

hiwelo commented Sep 20, 2016

Interesting, I just installed a new clear WP (with bedrock) and tried to load your manifest.json file without any WP crash.
Can I have more informations about your configuration in order to reproduce this issue?

@hiwelo
Copy link
Owner

hiwelo commented Sep 20, 2016

Yes, I found something.
There is currently an issue when passing the environment in production. It will be something in the ProductionFeatures class.
I will disable this class until the next release, time to resolve the concern.

Thank you very much.

@hiwelo hiwelo closed this as completed in 7a5513d Sep 20, 2016
@hiwelo hiwelo added this to the v1.3.0 milestone Sep 20, 2016
@hiwelo hiwelo self-assigned this Sep 20, 2016
@hiwelo hiwelo reopened this Sep 20, 2016
@ghost
Copy link
Author

ghost commented Sep 20, 2016

Using Laravel Valet on macOS, PHP 7.0.8, latest Bedrock and WP. This happens on both my local environment and a Digital Ocean production environment.

@ghost
Copy link
Author

ghost commented Sep 20, 2016

Thank you!

@hiwelo
Copy link
Owner

hiwelo commented Sep 20, 2016

I've just published a new version (v.1.2.9) that temporarily fix this issue.
I will try to find a more stable solution for the v1.3 I will release by the end of this month.

@ghost
Copy link
Author

ghost commented Sep 20, 2016

Thank you so much! I appreciate how quick and responsive you are to feedback. :)

@hiwelo hiwelo modified the milestones: v1.4.0, v1.3.0 Jan 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant