Invalid h5p.json file HELP
Submitted by nickzog on Mon, 11/19/2018 - 01:24
Forums:
We have created some content on h5p.org as we wanted to keep it open. However we would like to transfer these to our Moodle site. rather than recreateing each resource, I downloaded the H5P file and tried to uploaded it to Moodle via the H5P upload option, but get the error message. The oldest file I tried was created 22 October, so it it more than 2 weeks, so don't think that is the issue. Any other suggestions or will I have to remake each resource?
thanks
Nick
Validating h5p package failed.
H5P file:
BV52
Mon, 11/19/2018 - 03:26
Permalink
Hi nickzog,Please update H5P
Hi nickzog,
Please update H5P in your Moodle. This should allow you to upload the contents downloaded from H5P.org.
-BV52
sagar456
Fri, 10/21/2022 - 08:08
Permalink
Validating h5p package failed.
My h5p plugin inside moodle is up to date with latest version but this error still persist.Any help will be appreciated.My moodle version is 3.10.8+.
sagar456
Fri, 10/21/2022 - 08:29
Permalink
Validating h5p package failed.
My moodle version is Moodle 3.10.8+ (Build: 20211116) and h5p version is 1.22.4 and i am still getting the error while uploading the file.Any help will be appreciated and the h5p version ss is attached.
BV52
Fri, 10/21/2022 - 18:37
Permalink
Hi sagar456,Where did you
Hi sagar456,
Where did you download this content from? I am suspecting that either the file is corrupted or the platform where this was downloaded have custom libraries.
-BV
otacke
Fri, 10/21/2022 - 19:20
Permalink
Hi all!The problem is that
Hi all!
The problem is that the h5p.json file inside the content contains an attribute "source" set to the value "normal". That attribute exists, but it should be a URL, not a plain string like "normal". It violates the H5P specification, and therefore H5P core rejects to upload it.
That attribute is fueled by the metadata dialog, by the source attribute, obviously. The H5P editor would normally add the protocol ("http://") at the beginning of the text if you just typed "normal", so it would be interesting how that string got there.
So BV's question was a very good one: How and where was that file created?
Cheers,
Oliver
anjalorenz
Thu, 12/15/2022 - 09:52
Permalink
Maybe helpful
Moin,
we had a similar problem yesterday, so maybe our experience might be helpful for other users:
Our H5P plugin was up-to-date, but the validation of the H5P package failed anyway, because invalid data was provided in the h5p.json file. In our case, the fields "author comments" and "log" were specified both once. Both are fields in the metadata of the H5P file. We then deleted these fields [1] and then opened and saved it again with Lumi (I don't know if this last step is really needed). Then it worked. I assume that the fields might be filled with a special character (e.g. a dash) or something similar that caused problems.
Maybe it's worth checking whether there are problems in the encryption that can be solved on the software side.
Best regards
Anja
[1] How to delete fields in the h5p.json file:
otacke
Thu, 12/15/2022 - 18:42
Permalink
Hi Anja!There was a bug
Hi Anja!
There was a bug related to those fields (could not cope with line breaks). Is has been fixed a while ago, see https://github.com/h5p/h5p-php-library/pull/109, but the change didn't make it into the moodle plugin until just 3 days ago (1.23.0). Earlier versions (1.22.4-) would have such issues, yes. Could you please deny or confirm that you were using 1.23.0 when you encountered that problem?
Cheers,
Ollie
anjalorenz
Mon, 12/19/2022 - 08:19
Permalink
/o\
Meh, no, our Plugin is older than 1.23.0. Thus maybe Lumi just had fixed the version conflict (what might also be a helpful information).
Best regards
Anja
otacke
Mon, 12/19/2022 - 16:02
Permalink
You had fixed the problem (or
You had fixed the problem (or worked around it) yourself by deleting the fields.