Page MenuHomePhabricator

Special:NewFiles displays error messages
Closed, ResolvedPublicBUG REPORT

Description

Currently, when I go to https://lingualibre.org/wiki/Special:NewFiles, I see several lines such as

Notice: Undefined offset: 0 in /home/www/lingualibre.org/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php on line 1009

Notice: Undefined offset: 1 in /home/www/lingualibre.org/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php on line 1009

Warning: Cannot modify header information - headers already sent by (output started at /home/www/lingualibre.org/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php:1009) in /home/www/lingualibre.org/includes/WebResponse.php on line 46

Instead I should see the latest items that have been created.

Event Timeline

Wiki using 1.31 and the TimedMediaHandler extension seems also the corresponding 1.31 release

Code is:

	/**
	 * Check if the given transcode key is appropriate for the file.
	 *
	 * @param File $file File object
	 * @param string $transcodeKey transcode key
	 * @return bool
	 */
	public static function isTranscodeEnabled( File $file, $transcodeKey ) {
		$audio = $file->getHandler()->isAudio( $file );
		if ( $audio ) {
			$keys = self::enabledAudioTranscodes();
		} else {
			$keys = self::enabledVideoTranscodes();
		}

		if ( in_array( $transcodeKey, $keys ) ) {
			$settings = self::$derivativeSettings[$transcodeKey];  <!-- error line
			if ( $audio ) {
				$sourceCodecs = $file->getHandler()->getStreamTypes( $file );
				$sourceCodec = $sourceCodecs ? strtolower( $sourceCodecs[0] ) : '';
				return ( $sourceCodec !== $settings['audioCodec'] );
			} elseif ( self::isTargetLargerThanFile( $file, $settings['maxSize'] ) ) {
				// Are we the smallest enabled transcode for this type?
				// Then go ahead and make a wee little transcode for compat.
				return self::isSmallestTranscodeForCodec( $transcodeKey );
			} else {
				return true;
			}
		} else {
			// Transcode key is invalid or has been disabled.
			return false;
		}
	}

the $transcodeKey should be something like 160p.webm. Have you set own $wgEnabledTranscodeSet or $wgEnabledAudioTranscodeSet? It seems the in_array check allows some bools to get through. The last changes for the 1.31 release was to change both config from list to map (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TimedMediaHandler/+/451042), maybe something wrong in your LocalSettings.php

This is also shown on each image page - for example https://lingualibre.org/wiki/File:D8vhrq.wav

I am not sure, but you should not running a production wiki with errors showing like this. The errors should only the the logs

I don’t know if it is linked, but the files before 2020 are unexistent: on the web, when you try to read such one you are redirected to the main page, and the files are not on the server (according to a sample). When displaying all new files, there are 2x28 error messages and 43 missing files (no evident correlation :-/) and 11 existing files. On the server, there are 11 existing files. MediaWiki says in statistics there are 54 [local] files.

I’m not sure the status of missing files: should we search in a backup (if existing), or is “intentional” because of transfer to Commons or whatever?

I know many files hosted locally (mainly screenshots for have not been migrated during the deployment of the V2 version (see T264332). I think these files are lost definitely but not sure. So I do not know whether it is linked but if there is some mess in the file database, it would be nice to clean all.

VIGNERON claimed this task.
VIGNERON added a subscriber: VIGNERON.

The problem came from old corrupted file (File page was still there but not the files themselves).
Once these file were deleted, the error message disappeared.
Maybe there is still some lost files somewhere but I think we can close this task.