When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Steve Glover -
Number of replies: 27

I run my site www.dolanguages.com on siteground and had to change from moodle 2.8 as they are no longer supporting php to run it.   I have another site alevelfrench.com and set up moodle 3.11 on there to run with the adaptable theme and thought  I had ironed out all the problems.  The courses saved from moodle 2.8 restored fine, mainly, sometimes only after removing users.   

I have replicated what I have on alevelfrench.com on dolanguages.com after deleting the site with great trepidation.  Everything going fine until I start to restored courses and they are all returning the error error/setting_invalid_ui_label  

The php versions were different so I've matched those, to no effect.   Does anyone have any idea what could be causing this problem?   I could ask siteground to swap domain names etc but would prefer to sort the issue if at all possible.   I would be most grateful for any help. 

Average of ratings: -
In reply to Steve Glover

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Ken Task -
Picture of Particularly helpful Moodlers

A very old tracker issue
https://tracker.moodle.org/browse/MDL-23559
suggest your error related to language and characters in labels.

dolanguages.com isn't using https://  get a FireFox warning so think I"ll not view since you are having issues.

In dolanguages site, what languages have you installed?  en is default, me thinks, but others?

The courses you are attempting to restore ... what language are they using?

When you restore one of those are you stepping through each screen in the restore process?   Try that ... when it comes to the page showing the contents of the course to be restored, un-check any/all label resources.

Can you turn on debugging and share back what else moodle might tell you?

'SoS', Ken

In reply to Ken Task

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Steve Glover -

Hi Ken

Thanks for the response.  I'm trying another way of sorting things out now but I had already uploaded and restored the same courses on a trial siteground site successfully.   I'll see what happens with the new solution being done by the siteground people and then come back to your suggestions if needs be smile


In reply to Steve Glover

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Ken Task -
Picture of Particularly helpful Moodlers

Original sites on OLD SiteGround hosting.   NEW demo probably on NEW SiteGround hosting.   So demo of moodle?  Did they allow you to see or do many things in the admin area of that demo site? ... like check environment, etc.

Was the demo site installed by SG folks NOT using Softacoulous or other infamous '1 click installers'?

Hosting providers usually do NOT go into the depths of application trouble shooting/fixing issues.

Heck, you might have to point them to Moodle docs on how to turn on debugging.

Oh, well ... to each their own. ;)

'SoS', Ken


In reply to Ken Task

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Harry Bleckert -
We are using Moodle 3.10.7
Since Upgrade to 3.10 I occasionally get reports regarding this error message from teachers trying to import from another course:

error/setting_invalid_ui_label

So far, the problem was always a theme headline containing no text but only one or more space characters.

I consider this a bug as Moodle should disallow spaces only as headline if this is considered an error!
Average of ratings: Useful (1)
In reply to Harry Bleckert

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Hugo Nex -
Hi! I'm having the same problem, for me this mess is new. The problem is also that I am a neophyte in moodle, I am starting to use it. I have Moodle 3.11.3+.
Could you please tell me how and where to modify what you mention, to be able to solve it? I am using the Moove theme.

Regards.
In reply to Hugo Nex

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Steve Glover -
I finally transferred the moodle which importing the courses properly into the domain where the moodle 3.11.2 wasn't importing properly and this solved it for me although I realise it doen't solve the original issue.
In reply to Hugo Nex

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Harry Bleckert -
Please read my reply from October 12:

So far, the problem was always a theme headline containing no text but only one or more space characters.
Average of ratings: Useful (1)
In reply to Harry Bleckert

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Matt Gray -

Interesting. I have done this on occasion to hide the "General" title. Why does it only happen on 3.11, and is there a way to edit backup files to remove this so they can be restored?

In reply to Harry Bleckert

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Matt Gray -
Having the same issue - our moodle server died, so we set up a new moodle and restored the course backups, and about half of them refused to restore with this error. After initially panicking that the backups were bad, we tried restoring them it to another VLE we have running version 3.9, and they were fine. Ultimately, deleted moodle and reinstalled 3.9, so we could restore the backups. It seems to be an issue with 3.11.
In reply to Steve Glover

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hi,

Just to indicated the related tracker issue MDL-72685.

HTH,
Séverin
In reply to Séverin Terrier

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Dennis Fulton -
Running 3.11.4 and having the "error/setting_invalid_ui_label" when trying to restore or copy a course. I am a little confused reading through the discussion on this error. Is there a fix?
In reply to Dennis Fulton

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Ken Task -
Picture of Particularly helpful Moodlers

@Dennis ...

Might be confusing cause there is more than a single issue with the error - so depends on factors.

In my case ... courses in Spanish (actually ALL Language courses) ... section labels were set to Custom but there was no text in Section Title entered.    Thought that using Custom required something to be entered but it did not.   Teachers were using blank Custom Section Titles for a 'better viewing experience' ... or so I was told.   Or language characters (could see them in DB records - machine language characters - and not the special characters for that language ...  that caused the issues.   All needed language packs installed ... fr, spanish, etc.   Soooo ?????

So suggest checking the course .. in particular settings for Section headings.

'SoS', Ken

In reply to Ken Task

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Dennis Fulton -
Thanks Ken for the response. The strange thing is I have been backing up and copying the course a number of times. I think I even copied the course over after upgrading to 3.11.4. Then yesterday I went to copy the course shell to a new cohort and it gave me the error. There have been no changes to the course shell. The courses are all in English, and there are no blank topic titles, or strange characters in the topic titles.

Any other ideas?

Dennis
In reply to Dennis Fulton

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Ken Task -
Picture of Particularly helpful Moodlers

@Dennis ....

Like I said ... with me it was as described and that was a 3.9.highest.    Soooo ... turn on debugging to full and let's see if your moodle reports anything more.

The table is mdl_course_section.

When you backup or restore are you stepping through each screen?

'SoS', Ken

In reply to Ken Task

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Dennis Fulton -
When I select backup it is not giving me the option of stepping through each screen. I goes immediately to the error message.
In reply to Dennis Fulton

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Ken Task -
Picture of Particularly helpful Moodlers

Tracker says it's a regression ...

Have got a 3.11.4+ (Build: 20211223) and am trying to replicate the issue and can't!

So ... am assuming it's specific to this course.

You mentioned you thought you had restored a backup (an .mbz file).   Can you see your way to share that backup .mbz file with me?  Via Email ... if not too large!

See PM in this system for info. my address.

'SoS', Ken



In reply to Ken Task

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Dennis Fulton -
Ken, very elementary question. I have turned debug on... but where are the debug messages found? I looked in /var/log/httpd/maol-online-error.log, but nothing turning up there.
In reply to Dennis Fulton

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Ken Task -
Picture of Particularly helpful Moodlers

Debug normally shows on the screen ... but copying a course is a background process so it might not show ... dunno for sure ... not having the issue.

Did you look in moodledata/temp/backup/ for a folder and what's in that folder?  The copy process makes use of backup, then restores.   Anything left in there?

How about when you run cron .... adhoc_task ... any 'hung' adoc_task related?

Last offer ... check your PM on this system!

'SoS', Ken

In reply to Séverin Terrier

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
This problem is now handled in MDL-72762.

Hope it will be fixed in 3.11.5.
In reply to Séverin Terrier

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Dennis Fulton -
Any ideas of what to do before 3.11.5? I have courses I need to copy for the new semester.
In reply to Dennis Fulton

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Ken Task -
Picture of Particularly helpful Moodlers

@Dennis ... before the 3.11.5 release .. please see:

https://docs.moodle.org/dev/Releases#Moodle_3.11

General release calendar - where is says:

Minor (Point) (eg. 3.x.y)     2 monthly     Second Monday of July, September, November, March and May.

Third Monday of January.


Assuming your academic calendar begins new courses after the new year - 1st week of Jan? am gonna guess the fix might not come before you need it.

Thus, that leaves only 2 options .. neither recommended ..

1. Make a .mbz backup and doctor the un-compressed backup then re-compress and restore.   That's if one can ID what to fix.

2. Alter related DB tables directly ... again, only if one can ID the problem.

The PM I sent you on this system kinda offers that (at least to investigate - no fee -  ... only with my 3.11.4+ sandbox server.

'SoS', Ken

In reply to Ken Task

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Dennis Fulton -
Thanks to Ken's help here are the steps we used to allow the file backup and restore:
- Changed the option for each course to select a theme
- Changed the theme from Klass to Boost (this helped to identify the blank label)
- In the initial heading label, changed it from custom to General
- Backup was then successful and was able to copy the course to the new cohort.

Thanks Ken!!
In reply to Dennis Fulton

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Ken Task -
Picture of Particularly helpful Moodlers

@Dennis .... Welcome!

Ahhhhh the 'mysteries of Moodle' .... hmmmm ...
https://docs.moodle.org/311/en/Errors_FAQ
One item not present is setting theme to one that comes with version.
Even in https://docs.moodle.org/311/en/Category:Error
setting_invalid_ui_label doesn't appear.

Now the questions are how does a label get entered as 'blank' or go blank and why did Klass not show it?

Like I said ... the 'mysteries of Moodle'!

All is well that ends well!  Merry Merry and Happy New Year in 2022 (we all could use one!)!

'SoS', Ken

In reply to Dennis Fulton

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Ken Task -
Picture of Particularly helpful Moodlers

A follow up ... since you, Dennis, don't suffer from 'clas' (command line avoidance syndrome') ... what you are doing can be done more quickly via command line!

restoring a template backup course might be faster/to do with command line
script in code/admin/cli/ called restore_backup.php.

Help on that script:

Restore backup into provided category.

Options:
-f, --file=STRING           Path to the backup file.
-c, --categoryid=INT        ID of the category to restore too.
-s, --showdebugging         Show developer level debugging information
-h, --help                  Print out this help.

Example:
$sudo -u www-data /usr/bin/php admin/cli/restore_backup.php --file=/path/to/backup/file.mbz --categoryid=1

Your category could be a new one called 'staging'.
The path to backup file could be ./nameofbackup.mbz

From command line, after the first one finishes, up arrow, enter and the second is
restored.  up arrow, enter and the third is restored.   How simple is that? smile

Faster?  Web service not involved so am gonna guess ... some!

You would still have. to go into each for minor changes but the move to cohort etc
probably best done via GUI anyway.

My 2 cents.

'SoS', Ken

In reply to Ken Task

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Ray Hinton -

I know that I have modified backup files in the past (changing names of anonymized users so that they do not conflict with existing anonymized users), so I've definitely done it "correctly" at one point.

However, every time that I try to modify a backup file that contains a section name with a space (change it to  ), I get an error when I try to restore it: "Unknown backup format: The selected file is not a valid Moodle backup file and can't be restored."

Do you need to do anything besides changing the "name" value in the corresponding section.xml file? I am very careful to mimic the backup structure (re-named ZIP file, with another ZIP file inside which has the file extension removed, with contents directly inside that file), so I am hoping that is not the issue!


In reply to Ray Hinton

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Paul Lindgreen -
Picture of Particularly helpful Moodlers
I too tried to unzip a backup, fix the label issue for the one blank section and then re-compress my course but receive the same error 'Unknown backup format: The selected file is not a valid Moodle backup file and can't be restored.'. Php error listed below. Ive used winrar and 7zip.

Tried dozens of times, pretty sure Im missing something very simple related to the zip containing the another zip without a file extension.

Explicit instruction on how to re-compress a course backup would be appreciated.

php error follows:

[07-Jul-2022 xxxxxxxx] PHP Notice: Not a zip archive.: xxxxxxxxxxxxx/temp/backup//4de30919da3868eeb44a47bd3f437613
  • line 133 of \lib\filestorage\zip_archive.php: call to debugging()
  • line 281 of \lib\filestorage\zip_packer.php: call to zip_archive->open()
  • line 106 of \lib\filestorage\mbz_packer.php: call to zip_packer->extract_to_pathname()
  • line 325 of \backup\util\ui\restore_ui_stage.class.php: call to mbz_packer->extract_to_pathname()
  • line 297 of \backup\util\ui\restore_ui_stage.class.php: call to restore_ui_stage_confirm->extract_file_to_dir()
  • line 116 of \backup\restore.php: call to restore_ui_stage_confirm->process()
in E:\Moodle\lib\weblib.php on line 3257
In reply to Paul Lindgreen

Re: When I try to restore courses in moodle 3.11 error/setting_invalid_ui_label is returned

by Ken Task -
Picture of Particularly helpful Moodlers

The unzipped files of course backup are in a directory.   Correct?

The .mbz file you create has to be done from inside that directory.

Moodle expects to find a moodle_backup.xml at the root of the extracted .mbz file.  That's the road map for restoring the course contents.  If it can't find that moodle_backup.xml file then you get exactly the error you are seeing.

'SoS'. Ken