Drupal 8 Can't install or upload any content types

I recently updated to the latest H5P version for drupal 8 and am having issues installing or uploading any content types through the module. This is the error I receive after I click the Install button or try to upload:

500 Service unavailable (with message) (500)

Unable to interpret response.

Please check your error log.

When I check the logs these are the two errors I see:

- Error 1

Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your private:// directory which contains the following lines:

# Deny all requests from Apache 2.4+. <IfModule mod_authz_core.c> Require all denied </IfModule> # Deny all requests from Apache 2.0-2.2. <IfModule !mod_authz_core.c> Deny from all </IfModule> # Turn off all options we don't need. Options -Indexes -ExecCGI -Includes -MultiViews # Set the catch-all handler to prevent scripts from being executed. SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 <Files *> # Override the handler again if we're run later in the evaluation list. SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 </Files> # If we know how to do it safely, disable the PHP engine entirely. <IfModule mod_php5.c> php_flag engine off 

</IfModule>

- Error 2

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'metadata_settings' in 'field list': INSERT INTO {h5p_libraries} (machine_name, title, major_version, minor_version, patch_version, runnable, fullscreen, embed_types, preloaded_js, preloaded_css, drop_library_css, semantics, has_icon, metadata_settings, add_to) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14); Array ( [:db_insert_placeholder_0] => Drop [:db_insert_placeholder_1] => Drop [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 2 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => js/drop.min.js [:db_insert_placeholder_9] => css/drop-theme-arrows-bounce.min.css [:db_insert_placeholder_10] => [:db_insert_placeholder_11] => [:db_insert_placeholder_12] => 0 [:db_insert_placeholder_13] => [:db_insert_placeholder_14] => ) in Drupal\h5p\H5PDrupal\H5PDrupal->saveLibraryData() (line 671 of /var/www/ewportal/docroot/modules/contrib/h5p/src/H5PDrupal/H5PDrupal.php).

icc's picture

Are you sure you've run update.php? The field should be added through the h5p_update_8002()

You were right - I forgot to update the db first. I'm now able to "install" content types. However, I'm now running into a different error. It seems I can use all content types except the Interactive Video. The screen stay at "loading, please wait" and doesn't change. Getting the following errors in the console:

 

Error 1:

Refused to apply style from 'https://partners.local/sites/default/files/h5p/libraries/Drop-1.0/css/dr...' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

 

Error 2:

GET https://partners.local/sites/default/files/h5p/libraries/Drop-1.0/js/dro... net::ERR_ABORTED 404 (Not Found)

(anonymous) @ h5peditor.js?pivhnd:115

ns.libraryRequested @ h5peditor.js?pivhnd:81

success @ h5peditor.js?pivhnd:180

c @ jquery.js?pivhnd:2

fireWith @ jquery.js?pivhnd:2

k @ jquery.js?pivhnd:4

r @ jquery.js?pivhnd:4

XMLHttpRequest.send (async)

send @ jquery.js?pivhnd:4

ajax @ jquery.js?pivhnd:4

ns.loadLibrary @ h5peditor.js?pivhnd:169

ns.LibrarySelector.loadSemantics @ h5peditor-library-selector.js?pivhnd:309

librarySelectHandler @ h5peditor-library-selector.js?pivhnd:56

ns.SelectorHub.getSelectedLibrary @ h5peditor-selector-hub.js?pivhnd:163

loadLibrary @ h5peditor-library-selector.js?pivhnd:68

call @ h5p-event-dispatcher.js?pivhnd:209

EventDispatcher.trigger @ h5p-event-dispatcher.js?pivhnd:240

dialogConfirmed @ h5p-confirmation-dialog.js?pivhnd:37

 

Error 3:

h5peditor.js?pivhnd:111 Error while loading scripts: Event {isTrusted: true, type: "error", target: script, currentTarget: script, eventPhase: 2, …}

icc's picture

You need to make sure your web server is configured to send the correct "mime type" for files, more specifically .js and .css. Which web server are you using? 

Alternatively, I believe you can turn this check off by setting "X-Content-Type-Options nosniff". But you should know what you're doing.