Hi everyone
this is my first bug report =). I've installed Video 6.x-4.1-rc2 module and after creating about 40 video nodes and selected each thumbs, without reason thumbs has been deleted. Now i need to re-edit every node and re-select everything. Does anyone knows if it's a bug or a misconfiguration of my server? Permissions are 777 everywhere in directory /files/ and I didn't see anything in log (no users deleted accidentally).

I read a similar bug in older versions but I don't know if it has been fixed.

Thanks in advice

Comments

Passer’s picture

*confirmed*

Here the Thumbs are deleted too.

Ill tae a look for the problem this day and Ill post my suggestions here

hypertext200’s picture

Status: Needs review » Postponed (maintainer needs more info)

What are the steps you follow? did u follow the documentation?

Passer’s picture

Version: 6.x-4.1-rc1 » 6.x-4.1-rc2
Status: Postponed (maintainer needs more info) » Needs review

The Module works fine, but if a new Video-Node is created, the video-thumbs folder is deleted automatically.

Than every node has to be opened in Edit-Mode to recreate the Folder+Thumbnails.

hypertext200’s picture

Are you using FFMPEG for transcoding? what is the trancoder your using?

JoshW’s picture

im getting this too. I have custom thumbnails enabled and i put an image in when i create the node but if i go back in and change some text in the description the thumbnail magically disappears.

erikvip’s picture

I have this issue as well with Manual upload images. All transcoding is disabled.

hypertext200’s picture

Status: Needs review » Fixed

Fixed in dev

JoshW’s picture

i have the same setup as erikvip and i tried the new dev and i am still getting lost images.

erikvip’s picture

I tested this with the latest 6.x-4.x-dev (2010-09-19) and the issue remains.

Here's a half-assed workaround:
Commenting lines 121 & 126 in module/video/types/uploadfield/uploadfield_widget.inc will prevent the thumbnails being removed.
These two lines:
video_widget_element_settings($element);
video_widget_process($element, $form_state);

NOTE: Be careful with this, I managed to clear the 'files' table when having only one of those lines commented. So make a backup first.

This also disables making any changes to the Video CCK in the node edit screen - it only preserves the video and thumbnails ( So you can make changes to other parts of the node )

This does not fix the issue, it only prevents changes being made to the videos.

hypertext200’s picture

Version: 6.x-4.1-rc2 » 6.x-4.1-rc6

Fixed is latest.

JoshW’s picture

just installed the new dev for 6 on sept 29 2010 and images still disappear.

hypertext200’s picture

Status: Fixed » Active

What are the depndent modules you have?. I have no idea on how to fix this now, I changed the way I used it and hope that will work seems it didn't. send me the site that you used to create videos then I can debug and see how its working and where is the issue. we will delete thumbanils only when hook_file_delete is called, if your not deleting files at any time or updating new files, then thumbs should exits. Give me some more info.

zisser’s picture

Same here..
What kind of info would help you?
Dependent modules: content and filefield

hypertext200’s picture

I'm really confusing about this issue, did that happen with cron run? or after upload a video?. What is the workflow you followed to upload videos?

zisser’s picture

I have uploaded an flv video (I do not use conversion) and uploaded the thumbnail image.
Later, I edited the node content (the image was in place) and saved.
After that the image was gone from the views I set (for example a slideshow I use) so when edit again the node I can see there is no image.

Thanks,
Udi

hypertext200’s picture

I thought it was after auto-thumbnail creation. I will work on it.

zisser’s picture

sorry deleted the text... some of my issues are related to imagecache presets and content type display fields..

finex’s picture

subscribe

jospBln’s picture

I use video without conversion and with an uploaded thumb.

Whenever I edit the node, the video module forgets the thumb and I have to upload it again.

JoshW’s picture

same

peximo’s picture

Status: Active » Needs review
StatusFileSize
new1.24 KB

The problem seems to be that when saving the node form without changing the video thumb, the related submitted value is empty and the original value is not preserved. The attached patch seems to fix the issue by restoring the saved value in this case.

JoshW’s picture

Just tried the patch and its working! Thank you so much!

primobruno’s picture

Definitely it works !!! With that litle patch, it no longer losses the thumbnails when i edit the post.
Other problems remain:

Everytime i create a post, this message shows:

The selected file could not be copied, because no file by that name exists. Please check that you supplied the correct filename.

I thought it was about the thumbnails because no automatic thumbnails are created (like they use to).
So i use a default thumbnail in case other methods fail but even that was not working till now.
Thanks for posting the patch !!!

3dloco’s picture

Status: Needs review » Reviewed & tested by the community

Thanks a lot Peximo for submitting the patch! I can confirm that #21 is working for me on 6.x-4.1-rc6.

ericpai’s picture

The patch worked for me too!
The problem is the old thumbnail is not being deleted. Is there another patch for that?
Also, the thumbnails remain in the files table after the video has been deleted.

thanks

virtuali1151’s picture

Any update on this one....??? as I too.. out of the blue have had all of the thumbnails just deleted.. the whole video_thumbs directory is missing all of the sudden... very strange??

hypertext200’s picture

@virtuali1151 is there any log messages on your watchdog? I need some more info digging in to this, don't this patch work for you? #21

virtuali1151’s picture

Version: 6.x-4.1-rc6 » 6.x-4.x-dev

Yes.. there is.. but its just an obvious filefield error cause the images are no longer there... what strange is that if I go back in and delete the vid.. and re-upload it the video_thumbs directory comes back with a new sequential order and the thumbs are ok...

Message FileField was trying to display the file sites/default/files/video_thumbs/620/video-thumb-for-620-3.jpg, but it does not exist.

I have also just got another error on the actual videos itself... for some reason all of the sudden all videos now link to this strange directory sites/default/files/sites/default/files which is nothing I have defined... I think there is obviously two issues here... I am not sure if this one has to do with Swftools or..?? But the same thing as above.. I can delete the video and reupload it.. and it works fine.. the all of the sudden they all go to that wierd directory out of the blue...?? Not sure if you point me in the right direction.

Error:
Location http://www.site.com/sites/default/files/sites/default/files
Referrer http://www.site.com/sites/all/libraries/flowplayer3/flowplayer.commercia...
Message sites/default/files/sites/default/files
Severity warning
Hostname xx

For now I have just reuploaded the videos and hopefully thats the end of it... but if/when it goes pearshaped again I will post the watchdog so we can narrow down the problem.

Tks.

virtuali1151’s picture

And one last error that seems to keep happening is it is looking for the original video to display for some reason??

FileField was trying to display the file sites/default/files/videos/original/surfboard.flv, but it does not exist.

Cheers.

virtuali1151’s picture

Well.. Its done it yet again.. and for any of you other guys that seem to be getting the error sites/default/files/sites/default/files it looks to be an error with Swftools and Flowplayer.. we are still debuggin..I will post the issue ticket here for you guys to check later..

Cheers.

hypertext200’s picture

In video.module file

/**
 * Implementation of hook_file_delete().
 */
function video_file_delete($file) {
  // @TODO : check for enable trancoder
  // delete the transcoder job
  module_load_include('inc', 'video', '/includes/transcoder');
  $transcoder = new video_transcoder;
  $transcoder->delete_job($file);

  //now lets delete our video thumbnails and folder.
  $video_thumb_path = variable_get('video_thumb_path', 'video_thumbs');
  $thumb_folder = file_default_scheme() . ':/' . $video_thumb_path . '/' . $file->fid;
  // Recursively delete our folder and files
  rmdirr($thumb_folder);
  // Let other modules to know about the file delete
  video_module_invoke('delete', $file);
}

Here is the where we delete files and thumbs when video file id deleted. Please consider about this and hope this tip will helpful.

parasox’s picture

This has been happening to me too it seems, and tonight it happened big.. I temporarily fixed the problem by symlinking my imagecache directory that had the files to /files/video_thumbs and when I went to try and update a video, my directory got nuked and all my thumbs are gone from both imagecache and their normal place.

Woops. I'm using rc6.

I see the above patch should work on rc6, I'll try that now.

Heshan, I'd be happy to let you login to my site if you like. Just ask and I'll send a message through your contact form.

hypertext200’s picture

Try #21, it should work. Yep contact me to provide any log info if there are any

parasox’s picture

Ok great thanks. Not sure if it's the same issue, but right now I can't generate thumbnails either. It seems it's skipping the /var/www/ in /var/www/sites/default etc and so it can't find 'sites/default/files/video_thumbs/'

So right now I have no thumbs and can't make new ones.. :P Sending you the login details Heshan, maybe there's some clues there in the dblog.

Error generating thumbnail for video: generated file sites/default/files/video_thumbs/7429/video-thumb-for-7429-5.jpg does not exist.
Command Executed:
-i 'sites/default/files/original/original-video.mp4' -an -y -f mjpeg -ss 180 -vframes 1 sites/default/files/video_thumbs/7429/video-thumb-for-7429-5.jpg
Command Output:
FFmpeg version SVN-r25766, Copyright (c) 2000-2010 the FFmpeg developers built on Nov 18 2010 22:24:36 with gcc 4.4.1 configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvpx --enable-libtheora --enable-libmp3lame libavutil 50.33. 0 / 50.33. 0 libavcore 0.13. 0 / 0.13. 0 libavcodec 52.96. 0 / 52.96. 0 libavformat 52.84. 0 / 52.84. 0 libavdevice 52. 2. 2 / 52. 2. 2 libavfilter 1.62. 0 / 1.62. 0 libswscale 0.12. 0 / 0.12. 0 libpostproc 51. 2. 0 / 51. 2. 0 Seems stream 1 codec frame rate differs from container frame rate: 5994.00 (5994/1) -> 29.97 (2997/100) Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sites/default/files/original/original-video.mp4': Metadata: major_brand : isom minor_version : 1 compatible_brands: isom Duration: 00:03:01.28, start: 0.000000, bitrate: 12267 kb/s Stream #0.0(eng): Audio: aac, 44100 Hz, stereo, s16, 273 kb/s Stream #0.1(eng): Video: h264, yuv420p, 1920x1080, 11991 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 5994 tbc sites/default/files/video_thumbs/7429/video-thumb-for-7429-5.jpg: No such file or directory

virtuali1151’s picture

I used the patch in #21 and reuploaded the thumbs and mine works again.. I will let you know if it errors again... Shouldnt #21 be commited patch..??

hypertext200’s picture

Status: Reviewed & tested by the community » Fixed

Added to the dev version.

hypertext200’s picture

Status: Fixed » Needs review
StatusFileSize
new1.21 KB

Found the issue and patched it.

virtuali1151’s picture

Is the patch #37 commited in the most recent dev version..??

hypertext200’s picture

its available in the BETA2 and dev

hypertext200’s picture

Status: Needs review » Closed (fixed)
Krotty’s picture

Version: 6.x-4.x-dev » 6.x-4.2-beta2
Status: Closed (fixed) » Active

6.x-4.2-beta2 nothing has changed...
It looks like all video-thumbs disappear after new video node creation.

tacituseu’s picture

Version: 6.x-4.2-beta2 » 6.x-4.x-dev
Status: Active » Needs review
StatusFileSize
new1.62 KB

Same problem with 6.x-4.2-beta2 (and dev), editing a node with video field resets settings, and previewing removes thumbnail. Steps to reproduce:
1. In field configuration set 'Thumbnail Generation' to 'manual_upload' => 'Manually upload a thumbnail'
2. Select 'Video Thumbnail' formatter as a Display (just to check easilly)
3. Create a node, attach video and thumbnail, set 'Dimensions for Video Player' to a value other than default, save (without previewing first) -> thumb will show on node, devel will show choosen dimensions in field's data['player_dimensions']
4. Now edit node, notice widget preview doesn't show thumbnail (it shows default one if it is set in field configuration) also 'Dimensions for Video Player' is not preserved (is on default now), click preview, then save -> thumb is deleted and 'Dimensions for Video Player' reset, if you hit save without doing preview first you will loose only 'Dimensions for Video Player' because of a patch from #21 that restores it later in video_widget_process().

The source of the problem is inside uploadfield_widget_value():

    $item = array_merge($element['#default_value'], $edit); 

and

  // Merge file and item data so it is available to all widgets.
  $item = array_merge($item, $file); 

array_merge() is not recursive and $item['data'] is overwritten by $file['data'] (or $edit['data']) and video_thumb_file, video_thumb, dimensions, player_dimensions are lost if not changed on this edit.

Patch attached, also removed some redundant code.

hypertext200’s picture

I will add this to the dev and we can test, as far as I can see this patch is good to go, thanks @tacituseu

virtuali1151’s picture

Here we go again! This latest Dev Version is once again deleting the entire video_thumbs directory causing the videos not to play.... Can we pls find out why this is happening yet again.

Cheers.

parasox’s picture

I've lost my entire thumbnails directory at least 3 times now. Some advice.

Easiest way I've found to get them back is to hold down CTRL and left click each video (I do about 10 at a time using my /videos/ pager). Then click the first tab, move your mouse to the Edit link, click. Then hit CTRL+TAB, and click again without moving your mouse.. Keep doing that until you've clicked edit on all your tabs.

Now your server will be going apeshit running as many FFMpeg commands as it can whipping up thumbs.

Once you see all your tabs have finished loading (easy to see in Chrome because the icon stops spinning) again I go to the first tab, CTRL+TAB, END key, repeat for all tabs. Then you can CTRL+TAB and Click "Save" on all nodes without moving your mouse.

That's the fastest and easiest way I've found. Perhaps resaving all the nodes with Views Bulk Operations would work, but I haven't tried it, and I doubt it since it takes so long for thumbs to be created for each node. Maybe though.

hypertext200’s picture

Status: Needs review » Needs work

@virtuali1151, @parasox, Thanks for support on debugging module. Can you guys please provide me below information.
1. In video field, what is the thumbnails generation option you have selected? Auto creating, Fallback with manual or other?
2. How that happened? when creating a new video? or editing existing video? or on cron run
3. What are the recent watchdog commands you can see when you see such incident?

virtuali1151’s picture

Hi All,

I have reverted back to the Dec 11 Dev version and that seems to work correctly. I am not sure what actually triggers the video_thumbs folder to get deleted. In the watchdog all that comes up is that is that filefield cannot display the video thumb image, thus flowplayer throws the sites/default/files/sites/default/files error.

Not sure if that helps.

Cheers.

tacituseu’s picture

StatusFileSize
new662 bytes

This happens when video_file_delete() gets called without properly initialized object, eg. someone does something equivalent to field_file_delete(NULL);. It will degrade to rmdirr(file_directory_path() . '/' . $video_thumb_path . '/'); and delete all files in /video_thumbs. Attached patch will prevent it, also adding some logging ('hook_file_delete called with empty $file object' in watchdog with name of the file to which stack has been dumped) to catch a culprit.

parasox’s picture

Wow thanks Tacituseu, hope this kills the problem! Is this patch based on the latest dev or?

And welcome to Drupal, nice contribution for your first 2 weeks here. :) Thanks!

hypertext200’s picture

Added to the dev. Please post the debug information

virtuali1151’s picture

I will try out and see what comes of it as well... Tks all! :)

tacituseu’s picture

Just a note to the patch above, on a production site (with only files dir writable by the web server) it should be something like:
$dump_file = file_create_path('video-debug-'.time().'.log');
otherwise it will try to create it in Drupal's root dir.

hypertext200’s picture

Status: Needs work » Needs review
virtuali1151’s picture

No Prob tacituseu.. I have put it up today and will advise of any errors etc. Tks again.

Cheers.

tacituseu’s picture

Just noticed that user triggered it a while ago, see #1125368: hook_file_delete() called without valid $file object for details.

justingeeslin’s picture

Version: 6.x-4.x-dev » 6.x-4.2
Status: Needs review » Fixed

I updated my Video module to 4.2 and FieldField to the latest version. And my video_thumbs stopped being deleted. Excellent!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dman’s picture

Status: Closed (fixed) » Needs work

Sorry for the bump, but this thread is the most relevant.
As in # 52 - the video-debug log file in 6.x-4.x today still tries to dump debug information by writing to the root dir.
This cannot be right.

I also found that this error (hook_file_delete called with empty $file object) is being thrown for ANY file deletion (eg a normal image field), so I would have expected the video file handler to take care and only get involved if the file being deleted was one of its own, even despite the larger #1125368: hook_file_delete() called without valid $file object issue that triggers it. Why is video claiming management of files that are not its own?

On the plus side, the debug backtrace it left in that dump file enabled be to trace this issue to its source! (but by the gods, why serialized? That was eye-strain!)

Jorrit’s picture

The issues you raise are valid, but it is better to open a new issue instead of reopening an issue that has been closed for half a year. You should then point to this issue and mention why the issue was not fixed.

dman’s picture

Status: Needs work » Postponed

Fair call.
At the time I found this today we were in the middle of a realtime go-live upgrade release with a dozen threads in the air, with PM + client breathing down my neck.
Was not on a -dev checkout so wasn't able to roll a clean patch, and just needed to answer why there were extra files in the root of the live site that we hadn't expected to see from the dev site.
Needed to make a quick note so we could come back to it later, and the history on this thread is the most relevant to track. I'll see if a small patch can be done in a new issue..

tacituseu’s picture

The code wasn't intended to leave dev branch.

  if (empty($file->fid)) {
    return;
  } 

would do.

On the plus side, the debug backtrace it left in that dump file enabled be to trace this issue to its source! (but by the gods, why serialized? That was eye-strain!)

So you could do krumo(unserialize(file_get_contents('video-debug-x'))) without straining anything ;)

dman’s picture

So I'm looking at our codebase (6.x.4.4), and it's probably not worth trying to roll a testable patch for you due to how far behind we are.
If it's just dev-only debug code, I'll let you clean it up in the current branch in whatever way fits.

@tacituseu :-B
Yeah, so it is not entirely impossible to bootstrap php from the commandline, remember the correct flags and include a library, and formulate a line of code that would decrypt the obfuscated dump file. I could also ROT13 it twice while I'm at it.
I still don't quite see the advantage of doing that over, y'know, being able to open it with a text editor or running cat strange_log_file.txt.
Is there like some deliberate useful advantage on encoding it? to save 15% disk space or something?

The really scary thing was I was actually able to scan that encoded wall of serialization and read what it was telling me in the raw! It made me feel like a freak to be able to do that :-}

tacituseu’s picture

@dman
You can download it to your dev machine, or is FTP a strain too ? ;)
The only reason was krumo-friendliness.

Jorrit’s picture

I'll remove the file reference asap. I should have done this earlier after taking over the code base.

Jorrit’s picture

Status: Postponed » Fixed

The debug info has been removed in 6.x-4.x.

Status: Fixed » Closed (fixed)
Issue tags: -video thumbnails

Automatically closed -- issue fixed for 2 weeks with no activity.