I do not know the exact mechanism how those files are uploaded but c:Category:Pages_with_script_errors often has files without license but with lua errors newly uploaded by UploadWizard from wikipedias presumable using some campaign interface.
Today's example files:
- File:Javier_Rapper_In_Tehran_02.jpg
- File:RASK Jewelry no CO2 IKON GREEN on white.png
- File:جلد راه روسیه 1.jpg
Those uploads usually have very similar wikitext, including:
- {{self|subst:Custom license marker added by UW}} - this statement causes lua errors
- {{Uploaded from Danish Wikipedia}}, {{Uploaded from Persian Wikipedia}}, etc.
- [[Category:Uploaded via Campaign:dk]], [[Category:Uploaded via Campaign:fa]], etc.
At the minimum do not upload files with wikitext which causes lua errors, and ideally do not upload files without a valid license template.