solved unable to confirm local audio file for conversion3

alt=
DannyA
@dannya
9 years ago
584 posts
I have been seeing this error more and more. I think its related to the s3 module. Do you have any idea what it means?
updated by @dannya: 04/23/15 12:36:18AM
brian
@brian
9 years ago
10,148 posts
DannyA:
I have been seeing this error more and more. I think its related to the s3 module. Do you have any idea what it means?

Yes - there is a Media function called:

jrCore_confirm_media_file_is_local()

What this function is used for is to say "make sure the file is on the same server I am calling from". If it is on S3 it goes and gets it and copies it over locally. This is needed so the conversion functions can operate on the file.

If you are seeing this error it means it could NOT copy the file from S3 to the local filesystem.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 03/18/15 01:55:35PM
alt=
DannyA
@dannya
9 years ago
584 posts
Ok. But like the other thread, my next question would be WHY? How does one troubleshoot that. Why doesn't the error tell you which file it attempted to access and why it couldn't access it?

On a separate note, what does this mean for large files? Does this mean every time you want to do a new conversion of a wav file you have to copy it over to the local system? How long does that copy remain? How does the transfer time impact performance? Do you have to wait for the whole file to copy over or does it start the conversion right away?
brian
@brian
9 years ago
10,148 posts
DannyA:
Ok. But like the other thread, my next question would be WHY? How does one troubleshoot that. Why doesn't the error tell you which file it attempted to access and why it couldn't access it?

The S3 API typically just gives an "access denied" error for any issue like this (since it would be a security issue if it told you the key did not exist for example). I can check it out and if the system is in developer mode I could dump the return so it can be checked out - that should be easy to add in.

Quote:
On a separate note, what does this mean for large files? Does this mean every time you want to do a new conversion of a wav file you have to copy it over to the local system?

Yes - that is correct.

Quote:
How long does that copy remain?

It is removed once the conversion process has completed.

Quote:
How does the transfer time impact performance? Do you have to wait for the whole file to copy over or does it start the conversion right away?

It waits for the whole file to copy over. The time does not really impact anything since the user is not waiting (it's being handled by a worker).


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
DannyA
@dannya
9 years ago
584 posts
brian:
It waits for the whole file to copy over. The time does not really impact anything since the user is not waiting (it's being handled by a worker).

I was just curious from a user standpoint. I think from a user standpoint, I think a key metric is the total time from upload to availability. If you look at soundcloud or youtube, it's very very fast.
brian
@brian
9 years ago
10,148 posts
The time spent in copying the file is usually just a second or two (for say a 10mb mp3) - by far the bigger time will be spent in the conversion process - especially on EC2 as the virtualized CPU makes it a bit slower.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
DannyA
@dannya
9 years ago
584 posts
Thats fine. But how do you account for that delay when triggering fuctions via the cue.

For example, how do you make sure the file IS local before kicking off the conversion (and avoiding getting this error)? I'm thinking larger files might not be copying over in time before the process kicks off.

How do you chain multiple queue functions that are dependent on the previous function completing successfully? e.g. I don't what the conversion to start until the file is copied. I don't want to generate a waveform until the conversion is complete. I don't want to delete the temp file until steps 1 and 2 are complete.
michael
@michael
9 years ago
7,717 posts
DannyA:....how do you make sure the file IS local before kicking off the conversion ....
That function brian gave above is what your after there:

$input_file = jrCore_confirm_media_file_is_local($profile_id, $input_file);
That will return the file if its there, or FALSE if it isn't.

Its a wrapper function that alters how it checks depending on whether the file system is local or cloud.
nate
@nate
9 years ago
917 posts
This is the code that fails
$input_file = jrCore_confirm_media_file_is_local($_args['profile_id'], basename($input_file),$_args);
	//return false;
    if (!$input_file) {
        jrCore_logger('CRI', "Unable to create waveform image. Audio file not found");
        return true;
    }

What we're after is a workaround to avoid failure. We need to create a waveform image from the audio file.



updated by @nate: 03/19/15 08:58:39AM
alt=
DannyA
@dannya
9 years ago
584 posts
yes, exactly. I want to kick off one queue function but only after the other operation is complete.
nate
@nate
9 years ago
917 posts
This is now returning an array

Quote:
Array ( [_created] => 1426795788 [_updated] => 1426795789 [_user_id] => 90 [audio_bpm] => 22 [audio_key] => A-sharp minor [audio_isrc] => [audio_text] => 22 [_profile_id] => 106 [audio_album] => Demos [audio_genre] => Breaks-Big Beat [audio_split] => {"106":"100"} [audio_title] => N8 S2 [audio_active] => on [audio_lyrics] => 22 [audio_pending] => 0 [audio_remixer] => [audio_explicit] => off [audio_agreement] => agree [audio_album_url] => demos [audio_file_name] => Demo_Track_Three.mp3 [audio_file_size] => 1424716 [audio_file_time] => 1426795789 [audio_file_type] => audio/mpeg [audio_genre_url] => breaks-big-beat [audio_title_url] => n8-s2 [audio_file_title] => Track 03 [audio_file_track] => 1 [audio_image_name] => bxp70277h.jpg [audio_image_size] => 1241030 [audio_image_time] => 1426795789 [audio_image_type] => image/jpeg [audio_remix_type] => {"106":"mechanical"} [audio_file_length] => 00:01:29 [audio_file_bitrate] => 128 [audio_file_smprate] => 44100 [audio_max_end_date] => [audio_release_date] => 1426737600 [audio_advance_price] => 0.00 [audio_display_order] => 0 [audio_min_lic_price] => 0.00 [audio_advance_status] => 0 [audio_catalog_number] => [audio_file_extension] => mp3 [audio_min_start_date] => [audio_image_extension] => jpg [audio_distrib_lic_count] => 0 [audio_territories_covered] => WW [_item_id] => 192 )

Causing conversion to fail and reporting this
Quote: [Artist N8] : invalid file type received for conversion: - type is not supported

updated by @nate: 03/19/15 01:16:52PM
brian
@brian
9 years ago
10,148 posts
DannyA:
yes, exactly. I want to kick off one queue function but only after the other operation is complete.

Make sure "max workers" is set to 1 when your register the worker in your module init.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
9 years ago
10,148 posts
Natedogg265:
[Artist N8] : invalid file type received for conversion: - type is not supported

jrCore_confirm_media_file_is_local() does not return an array - it returns the fully pathed local file so I have no idea where you are dumping that array from.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
DannyA
@dannya
9 years ago
584 posts
This started happening after we updated the s3 module last night from 1.0.5 to 1.0.7
brian
@brian
9 years ago
10,148 posts
DannyA:
This started happening after we updated the s3 module last night from 1.0.5 to 1.0.7

I'm not really sure what to say. The changes I added last night were just converting some fdebug() function calls to jrCore_logger().

I just tested here with the latest S3 module:

http://tdsdk.com/brian/uploaded_audio/50/s3-audio-test

and I see no problems. What I would suggest is to make sure you have a 100% "stock" Jamroom install that you can test on to see where the problem lies. Right now I don't see any problems with the S3 module - it is working as it should. I would suspect something in your custom code has broken something OR something is not configured or setup correctly.

If you can tell me how to reproduce the issue I will definitely fix it - I just don't see the issue you're seeing here.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
DannyA
@dannya
9 years ago
584 posts
Note the change involve 2 release updates. Perhaps it was something in 1.0.6. We also updated the core.

Tags