Upload Reports as Failed, but it actually worked

aiosarem - January 15, 2009 - 06:57
Project:Video Upload
Version:6.x-1.2
Component:Code
Category:bug report
Priority:critical
Assigned:jhedstrom
Status:active
Description

This has been happening fairly consistently:
I upload a file, submit the node, and then run the cron manually. Then I go check watchdog and see that an HTTP exception has been thrown (error while attempting to upload a video). However, I go check YouTube and I see that the file has been uploaded fine and is now being processed. Unfortunately, now I have a problem. Drupal is going to try to upload the file again next time the cron runs and YouTube will say its a duplicate video causing the two nodes to become orphaned and the video being linked to nothing.

#1

Saoirse1916 - January 16, 2009 - 19:31

I'm having the same problem so I'm keeping an eye on this one too.
EDIT: my specific error message is Video Upload: error Error reading file - sites/default/files/myfile.WMV. File is not readable. while attempting to upload a video.

EDIT (again): Actually, I figured out that error...somehow my video didn't upload to my site properly. But now I'm getting the generic "Video Upload: error while attempting to upload a video."

#2

j0rd - January 27, 2009 - 16:50

I might be having the same problem.

To start off, I had an "Unlimited" video_upload field and I added two videos. I do not believe this to be the source of the problem, but I mention it ahead of time, so the screenshots make sense.

I attempted an upload, but my net connection was down (i'm testing locally on my laptops webserver), files were uploaded to site, but not youtube. Then I ran the cron and once everything was said and done, the video had been uploaded twice.

My issue is that, youtube tells me the original files which are linked into the node are dupes, and the ones video_upload did on the second pass are valid on youtube, but orphaned on video_upload. This leaves me with a node with videos that youtube considers dupes, but my orphaned videos are valid.

See attached screenshots.

AttachmentSize
video-duplicates.jpg 130.67 KB
video-node-41.jpg 120.82 KB

#3

jhedstrom - February 9, 2009 - 19:26
Assigned to:Anonymous» jhedstrom

I've confirmed this is happening, but at the moment it seems to be fairly random. I'll post back once I know what the fix is.

#4

jhedstrom - February 9, 2009 - 21:17
Status:active» needs review

I think I've found the issue. Try this patch out to see if it fixes the issue for you (I haven't yet written an update script, so it won't fix existing video) when creating new videos. If this works, I'll apply it to dev and write an update script so that existing videos are fixed (although the duplicates will need to be manually removed from youtube).

#5

jhedstrom - February 9, 2009 - 21:18

And, of course, the actual patch...

AttachmentSize
video_upload.status-fix.patch 1.01 KB

#6

rares - February 22, 2009 - 02:31

I have applied the patch to my installation and then some kind of formatting error appeared (probably due to JS?). On my node creation form, all the checkboxes (for instance, for Published, Promoted to front page would not appear anymore). When I reversed the changes, things got back to normal. I use 6.9 and the latest cck and filefield.
EDIT: This is because of a bug in Google Chrome, so never mind the issue with the missing checkboxes. Checkboxes aside, I get duplicate uploads despite the patch.

#7

rares - February 21, 2009 - 23:14

Perhaps I should add that I am also having the problem where the uploads from my site appear on youtube but are not effectively associated with the youtube uploads. Hence multiple orphaned uploads. I have also not succeeded at deleting the orphaned youtube videos through my website's interface: I confirm the deletion, but the admin form comes back with the same items (and they are also still on youtube). There is nothing in the event log about this.

#8

rares - February 22, 2009 - 05:33

After many hours spent experimenting with many different configurations and upload files and sizes, I have found that the following configuration prevents the duplicates and orphans from appearing:
- just ONE upload allowed per field (not unlimited)
- Zend Framework version 1.7.1 (not 1.5.1 as mentioned in INSTALL.txt)
- Default keywords with absolutely no space in that field (not even near the commas)
- Synchronization for keywords disabled: "Don't synchronize"
Applying the patch does above does not seem to make a difference.

I hope this is useful to others. sorry I can't pinpoint exactly what's causing the cron job to fail at receiving the ID from youtube, but I would put my money on the first and the third.

#9

jhedstrom - February 25, 2009 - 00:06
Status:needs review» fixed

@rares
#358534: Strip HTML (from TinyMCE or FCKEditor) out of data transmitted to YouTube should fix the issue with keywords, even though it's specifically for a different issue, there's a tweak such that spaces between keywords are stripped out.

This patch isn't needed for all issues, but it seems to fix the more elusive upload failure.

Committed to 6.x dev.

#10

leban - February 25, 2009 - 14:38

I'm also getting this error but only on certain videos. Others seem to get thru no problem - one special thing I did notice. On the list on Manage video Upload page the id of the vid does not change to Youtube id, but is the node title. And the status of the video is beign processed even though it has passed thru Youtube. Drupal also sends the video again in next cron run, and they are rejected as duplicates.
Should I try the patch on video_upload-6.x-1.1 ?

#11

jhedstrom - February 25, 2009 - 17:11

@leban Please try the latest version of this module, as the patch here, and several others, are included.

#12

leban - February 26, 2009 - 09:35

Yes. I noticed that the patch was already in 1.1. I also update to the new version of filefield, but still get the same issue.

EDIT: My test movie was a MOV. I converted it into MP4 and now Drupal gets the correct reply. It seemed to work with other MOV-files, so maybe something fishy in the reply from Youtube. Is there a way to get better logs from the API?

#13

jhedstrom - February 26, 2009 - 22:22

I've just update the module to version 1.2. The new version utilizes the relatively new YouTube API v2.0, which seems to fix a lot of these obscure oddities. Please try the latest version and let me know if you continue to have issues.

#14

hugosg - February 27, 2009 - 01:44

I updated to 1.2. The previous error about too_long keywords has been fixed however I have now the error
Type video_upload
Date Friday, February 27, 2009 - 01:41
User hugosg
Location http://***.net/admin/reports/status/run-cron
Referrer http://***.net/admin/reports/status
Message Video Upload: error while attempting to upload a video.
Severity notice
Hostname ***
Operations

Which does not say too much.

The video is updated to youtube but the sceen in my web never show it. It keeps the blue window and saying video being processed.

Some help?

#15

hugosg - February 28, 2009 - 14:59

I know people is busy, but any help with the previous message would be great!!!
Cheers

#16

leban - March 2, 2009 - 06:58

Can't help more than to sign your problem. Videos are beign relayed to Youtube but Drupal cannot find them... in 1.2.

Edit: trying to describe the problem more clearly

1) video uploads ok (mp4 this time)
2) after cron run the is an error:
Video Upload: error while attempting to upload a video.
3) The video appears in Youtube and is viewable and referable normaly.
4) On manage video upload page I see two items refering to the created node and uploaded video
- The other one has the correct youtube id, node is show as 'orphaned' and Field Info 'not available'
- The other item has Id as Node Title, Node refers to the right nid and Field Info is field_video
(In the working nodes there is Id is the Youtube Id not Node Title.)
5) Drupal keeps pushin the video to youtube in the next cron runs too, which are then rejected as dublicates.

here is the some sql:
mysql> select * from content_type_video;
+-----+-----+-----------------+------------------+------------------+----------------+--------------------+-----------------------+
| vid | nid | field_video_fid | field_video_list | field_video_data | field_video_id | field_video_status | field_video_status_ts |
+-----+-----+-----------------+------------------+------------------+----------------+--------------------+-----------------------+
| 69 | 69 | 54 | 0 | a:0:{} | | 3 | 1235835707 |
| 65 | 65 | 49 | 0 | a:0:{} | J7kf5EJNzSw | 2 | 1235642401 |
| 55 | 55 | 31 | 0 | a:0:{} | WKstgDajdXI | 2 | 1234536302 |
| 56 | 56 | 32 | 0 | a:0:{} | 06uOG1sSqiI | NULL | 1234542601 |
+-----+-----+-----------------+------------------+------------------+----------------+--------------------+-----------------------+
4 rows in set (0.14 sec)

ie. nid 65 works, nide 69 is broken.

My guess is that Drupal fails to accept correct response from youtube api. It does get the right id, but failes to connect it to the video_field in the right node.

Hope this helps to track down the problem. I really need to get this to work. Is there anything else I can do to debug this?

Would there some kind of manual hack to make the videos work? While I wait for a solution?

#17

leban - March 2, 2009 - 17:17

New info about this problem...

Looks like the file size does matter here. I tried uploding bigger and bigger videos. Starting with 1,5Mb... 4Mb... 8Mb... 9Mb is the 1st one that fails the mentioned above. Limit seems to be somewhere between 8 and 9 megas. The whole file is uploaded, Youtube accepts bigger videos, but Drupal fails at cron run. No errors by the cron or anyplace else. My php.ini has 128M of mem. Tried to put that to 256M and extendt the timeouts, but not help. Both max_sizes are 32M, which should be enough?
Maybe timeout when waiting for a reply from the youtube api?

Edit: Upgraded to Zend 1.7.5 but still all files over 8M get stuck as orphaned and not binded into a field.

#18

jhedstrom - March 2, 2009 - 17:33
Version:6.x-1.0» 6.x-1.2

leban, and others still having issues, could you please post an export of the content type/field definition for the video field that isn't working? You can get this by installing the export module that is bundled with CCK.

A few other things to check in php.ini, or wherever you are setting php config values:

post_max_size = {as large as the largest video you expect to upload, 100M, 200M, etc).
upload_max_filesize = {same as above}

#19

leban - March 2, 2009 - 17:53
Version:6.x-1.2» 6.x-1.0

Is this what you need:

$content[type]  = array (
  'name' => 'Video',
  'type' => 'video',
  'description' => 'A <em>story</em>, similar in form to a <em>page</em>, is ideal for creating and displaying content that informs or engages website visitors. Press releases, site announcements, and informal blog-like entries may all be created with a <em>story</em> entry. By default, a <em>story</em> entry is automatically featured on the site\'s initial home page, and provides the ability to post comments.',
  'title_label' => 'Title',
  'body_label' => 'Body',
  'min_word_count' => '0',
  'help' => 'Laita Youtube-linkki vain, jos et jostain syystä saa videota näkymään automaattisesti youtubesta. Älä käytä molempia tapoja.',
  'node_options' =>
  array (
    'status' => true,
    'promote' => false,
    'sticky' => false,
    'revision' => false,
  ),
  'language_content_type' => '0',
  'old_type' => 'video',
  'orig_type' => 'story',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
  'comment' => '2',
  'comment_default_mode' => '4',
  'comment_default_order' => '1',
  'comment_default_per_page' => '50',
  'comment_controls' => '3',
  'comment_anonymous' => '0',
  'comment_subject_field' => '1',
  'comment_preview' => '0',
  'comment_form_location' => '1',
  'fivestar' => 1,
  'fivestar_stars' => '5',
  'fivestar_labels_enable' => 1,
  'fivestar_label_0' => 'Cancel rating',
  'fivestar_label_1' => 'Poor',
  'fivestar_label_2' => 'Okay',
  'fivestar_label_3' => 'Good',
  'fivestar_label_4' => 'Great',
  'fivestar_label_5' => 'Awesome',
  'fivestar_label_6' => 'Give it @star/@count',
  'fivestar_label_7' => 'Give it @star/@count',
  'fivestar_label_8' => 'Give it @star/@count',
  'fivestar_label_9' => 'Give it @star/@count',
  'fivestar_label_10' => 'Give it @star/@count',
  'fivestar_style' => 'average',
  'fivestar_text' => 'dual',
  'fivestar_title' => 1,
  'fivestar_feedback' => 1,
  'fivestar_unvote' => 0,
  'fivestar_position_teaser' => 'hidden',
  'fivestar_position' => 'below',
);
$content[fields]  = array (
  0 =>
  array (
    'label' => 'Roskavideo',
    'field_name' => 'field_video',
    'type' => 'video_upload',
    'widget_type' => 'video_upload_widget',
    'change' => 'Change basic information',
    'weight' => '-2',
    'file_extensions' => 'mov avi mp4 mpa mpe mpg mpeg qt wmv',
    'file_path' => '',
    'max_filesize_per_file' => '',
    'max_filesize_per_node' => '',
    'use_browser_upload_method' => false,
    'auto_delete_rejected_videos' => 0,
    'display' =>
    array (
      'default_width' => '480',
      'default_height' => '295',
      'small_width' => '240',
      'small_height' => '148',
      'thumb_width' => '128',
      'thumb_height' => '72',
      'related_videos' => 0,
      'autoplay' => 0,
      'fullscreen' => 1,
    ),
    'default_title' => '',
    'default_title_sync' => '1',
    'default_description' => 'roskavideo.fi',
    'default_description_sync' => '1',
    'default_keywords' => 'roskavideo',
    'default_keyword_sync' => '2',
    'developer_tags' => '',
    'video_category' => 'Nonprofit',
    'description' => '<b>HUOM! Lataa videotiedosto tästä. Kun Videota ladataan -ilmoitus tulee näkyviin, voit tallentaa sivun. Video siirretään YouTubeen noin 30 minuutin kulutta ja se julkaistaan sivulla kun Youtube on automaattisesti käsitellyt sen.</b>',
    'required' => 0,
    'multiple' => '0',
    'list_default' => '0',
    'force_list_default' => '0',
    'show_description' => '0',
    'op' => 'Save field settings',
    'module' => 'video_upload',
    'widget_module' => 'video_upload',
    'columns' =>
    array (
      'fid' =>
      array (
        'type' => 'int',
        'not null' => false,
      ),
      'list' =>
      array (
        'type' => 'int',
        'size' => 'tiny',
        'not null' => false,
      ),
      'data' =>
      array (
        'type' => 'text',
        'serialize' => true,
      ),
      'id' =>
      array (
        'type' => 'varchar',
        'length' => '32',
      ),
      'status' =>
      array (
        'type' => 'int',
        'default' => 3,
        'sortable' => true,
      ),
      'status_ts' =>
      array (
        'type' => 'int',
        'length' => '11',
        'sortable' => true,
        'default' => '0',
      ),
    ),
    'display_settings' =>
    array (
      'weight' => '-2',
      'parent' => '',
      'label' =>
      array (
        'format' => 'hidden',
      ),
      'teaser' =>
      array (
        'format' => 'thumb_link',
        'exclude' => 0,
      ),
      'full' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
);
$content[extra]  = array (
  'title' => '-5',
  'body_field' => '-1',
  'menu' => '-4',
);

also:

post_max_size = 32M
upload_max_filesize = 32M

#20

jhedstrom - March 2, 2009 - 18:36

Hmm, using the above field definition, I am able to upload video to youtube. Did you check the other php settings I mentioned in #18?

#21

leban - March 2, 2009 - 19:54

Yes. As I mentioned in the end of the message. Both settings 32M. The video that does not load is 9,4M. Do you also get the video on your site? Not just Youtube?

#22

leban - March 3, 2009 - 12:46

Maybe there is something broken in my installation then... I attached a screenie from the Manage Video Upload -page. This is the situation after Youtube has accepted a video over 9M.
Here is the orphaned video:

Videon nimi Id                Solmu          Field Info          Tila
yli 9m video t6BCqce2eek     orphaned        ei saatavilla          OK

As you see not binded to a node or field.

Then the last line - Node title instead of youtube id... and stuck in video beign processed

Videon nimi     Id            Solmu          Field Info       Tila
...
yli 9m video!    yli 9m video! 85             field_video    Video is being processed.

Hope you can figure something out despite the odd language...

AttachmentSize
Kuva 5.png 55.05 KB

#23

scandi - March 3, 2009 - 13:02

And in log file "Video Upload: error while attempting to upload a video."???

#24

leban - March 3, 2009 - 13:24

Indeed :) But only for videos of bigger than 9M.

#25

scandi - March 3, 2009 - 13:56

Yes it is valid. Files more 9Мб are lost.

#26

hugosg - March 3, 2009 - 22:39

I manage tu upload one file but smaller than 9 megs. I still not able to upload bigger files. It seems a problem that many of us are having.
I set post_max_size and upload_max_filesize in my php to be 200M
Hugo

#27

leban - March 6, 2009 - 08:15

Any progress on this issue? Anything else we could do compare yout set up and ours - if you are indedd able to upload bigger files into Youtube and bind them correctly to the right node and field.

#28

leban - March 11, 2009 - 07:19

Please. A quick note that you are working on this would be nice.

#29

scandi - March 11, 2009 - 21:49
Status:fixed» active

Files more 9Мб are lost.

#30

scandi - March 17, 2009 - 22:05
Version:6.x-1.0» 6.x-1.2
Priority:normal» critical

Who can help solve a problem?

#31

leban - April 6, 2009 - 05:23

The problem has not solved itself. Any ideas?

#32

happydrupal - June 12, 2009 - 08:08

A feature request about this issue since I have the same problem.

http://drupal.org/node/489586#comment-1693502

 
 

Drupal is a registered trademark of Dries Buytaert.