Drupal 7 libraries not setting up

I use Pantheon to host my Drupal 7.56 site and I've tried using h5p to create a presentation, but when I tried adding a content and press install for CoursePresentation, I got an error Course Presentation could not be installed. Contact your administrator and 2 errors in console Failed to load resource: the server responded with a status of 503 () in H5P.CoursePresentation and Installation error SyntaxError: Unexpected token < in JSON at position 7 in h5p-hub-client.js?oyt6ov:8. After that if I refresh the page - I will be able to actually use CoursePresentation template and add some content, but once I press save button I get PDOException PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3833-21-editor' for key 'PRIMARY': INSERT INTO {h5p_nodes_libraries} (content_id, library_id, dependency_type, drop_css, weight). This also prevents me from uploading h5p files into editor, but when I've tested on local environment - everything worked just fine. Could you give me any clue what can go wrong?

Content types: 

PHP/nginx limits are 100MB each, so that can't be the case. I've also noticed some of a smaller content types like column has installed just fine and not causing any issues at all, but I really really need CoursePresentation.

It turns the issue is not within the libraries. As the DB structure and files are identical in fact (comparing working local env and remote server). So in fact there are 2 remaining issues: 

  1. Duplicate entry for key 'PRIMARY': INSERT INTO {h5p_nodes_libraries} (I've also found this reported in h5p Jira)
  2. Every time you create/update content - the page is loading some time and then you get 503 crash. After like 2-3 minutes, the page is displaying just fine.
fnoks's picture

The "Duplicate entry..." error message - is that something you see in the server-log or on the browser? If you haven't looked in the webserver's error log, please do, and let us know if there are any other messages there!