Media file being deleted by Media library functions

Found a bug? Tell us!!
Post Reply
WQGJ-587
Regular
Posts: 7
Joined: Mon Nov 08, 2010 1:59 am

Media file being deleted by Media library functions

Post by WQGJ-587 »

I have Popfetcher installed and working like a charm.

It catches an email with a .wav file attached to it, and post the text and a link to the .wav file.

If I in admin and click on Media library, it shows all the files. A .jpg I had uploaded as a banner, and all the .wav files that has been submitted via email.

However, here is the problem. once Media library has been clicked and displayed, it deletes all of the .wav files that were posted via Popfetcher.

They stay fine until i click on Media library on the right. They are displayed but deleted.

Anyone have a thought on that?

I dont have to do anything to them. not even touch one of the files at all. just the simple act of loading the Media library link displays them and deletes them.

running a brand new, shinny fresh install of 1.5.4.
and if i didnt say it, I love Serendipity, it has been the best for my application. simple, complete and actually does 99% of how i want it. (that other 1% will be asked in another post. :lol: )

Thanks in advance
Tom


UPDATE FURTHER PROBLEM

I have also found out, that if i am in the admin panel, and click on New entry, while in there, if i click on the Media button to add media to the new post, it pops up a new window.
In this new window it says,
Select file to insert
Click the file you want to insert:
then below that, it has a line saying that it deleted the file that was in the post from popfetcher.
only one at this point.

so, the entry then has a link that is dead because it deleted the file.
I was not even editing that post, this was a new entry from the admin panel.

what did i break?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Media file being deleted by Media library functions

Post by garvinhicking »

Hi!

Can you post the actual message that s9y gives you when the file gets deleted? Usually it shouldn't do that, so I wonder which option might do that.

Maybe you can also check your serendipity_images database table and see if you have an entry for the WAV file that gets deleted BEFORE you access the window.

Also, you should be able to disable ANY touching of your library, if you go to the s9y configuration and set "automagic synchronisation on-the-fly" to No.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
WQGJ-587
Regular
Posts: 7
Joined: Mon Nov 08, 2010 1:59 am

Re: Media file being deleted by Media library functions

Post by WQGJ-587 »

Hey Garvin,
Thanks for taking time out in this busy world. I am sure this takes up a lot of time.

now, to answer with findings.

i have a screen shot of the media window showing that it deleted the files.
the only thing i did there was click on the media button to add media to new entry.
when it opens, you see the msg's that it deleted the files.
Screen shot attached to view.

Yes, the images are showing in the dbase table Images.

and Yes, if i turn off the fly sync, it does not do that.

In the image below, you will see that it says it deleted the two files, that had been posted via Popfetch. and true to its word, even though they show in the box below that, they are deleted.

Regards
Tom
Image
Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Media file being deleted by Media library functions

Post by garvinhicking »

Hi!
WQGJ-587 wrote:Hey Garvin,
Thanks for taking time out in this busy world. I am sure this takes up a lot of time.
No problem! That's what I'm here for. I hope you have some patience, because I believe we'll need some investigating to get your issue sorted out.

I believe the problem is that the automatic synchronisation feature cannot match the files inside the database table to the ones found on your filesystem. It might be that some column is not properly filled, or even prefixed with some "./" so that the file is not matched.

Can you put a file through popfetcher to your database and then make a SQL dump of the corresponding row of that file in the serendipity_images table?

Also, please edit your file include/functions_images.inc.php, search for "function serendipity_displayImageList", should be around line 1431.

There you see:

Code: Select all

static $debug = false;
change that to:

Code: Select all

static $debug = true;
Now, after you made the SQL dump, enable the synchronisation feature again and view the media database. You should get some more verbose output there which you can copy&paste here to this forum along with the SQL dump of that image row.

I think that should be sufficient for me to work out what's happening.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
WQGJ-587
Regular
Posts: 7
Joined: Mon Nov 08, 2010 1:59 am

Re: Media file being deleted by Media library functions

Post by WQGJ-587 »

ok, I think i got it all lined up.

there was just 3 items in it as of this point, one, i put in through the media manager, the other two, were done by email via popfetcher.

so i simply left it as was and processed your requests.

the sql dump is attatched. the following will be the copy/paste of the media lib. debug data as it processed.

Code: Select all

2010/ is a directory.
2010/11/ is a directory.
2010/11/All_Call_11-08-2010_1356.wav is a file.
2010/11/All_Call_11-08-2010_1922.wav is a file.
CCNetalertbanner.serendipityThumb.jpg is a file.
.empty is a file.
CCNetalertbanner.jpg is a file.
popfetcher-2010-11.log is a file.

Got files:

Array
(
    [2010/11/All_Call_11-08-2010_1356.wav] => 1
    [2010/11/All_Call_11-08-2010_1922.wav] => 1
    [CCNetalertbanner.serendipityThumb.jpg] => 1
    [.empty] => 1
    [CCNetalertbanner.jpg] => 1
    [popfetcher-2010-11.log] => 1
)

Image Sync Right: 1 Onthefly Sync: 1 Hash: 480ce4b2d1975939b9b65b443077bc1f!=80dd04c9da6a575718cb24bab449188e

Got images:

Array
(
    [0] => Array
        (
            [path] => 
            [name] => CCNetalertbanner
            [extension] => jpg
            [thumbnail_name] => serendipityThumb
            [id] => 1
        )

    [1] => Array
        (
            [path] => /2010/11/
            [name] => All_Call_11-08-2010_1922
            [extension] => wav
            [thumbnail_name] => 
            [id] => 46
        )

    [2] => Array
        (
            [path] => /2010/11/
            [name] => All_Call_11-08-2010_1356
            [extension] => wav
            [thumbnail_name] => 
            [id] => 45
        )

)

File name is CCNetalertbanner.jpg,
thumbnail is CCNetalertbanner.serendipityThumb.jpg

File name is /2010/11/All_Call_11-08-2010_1922.wav,
thumbnail is /2010/11/All_Call_11-08-2010_1922..wav
Deleting Image 46
Deleted the file entitled /2010/11/All_Call_11-08-2010_1922.wav

File name is /2010/11/All_Call_11-08-2010_1356.wav,
thumbnail is /2010/11/All_Call_11-08-2010_1356..wav
Deleting Image 45
Deleted the file entitled /2010/11/All_Call_11-08-2010_1356.wav

Cleaned up 2 database entries

Got unmatched files:

Array
(
    [0] => 2010/11/All_Call_11-08-2010_1356.wav
    [1] => 2010/11/All_Call_11-08-2010_1922.wav
    [2] => .empty
    [3] => popfetcher-2010-11.log
)

Checking 2010/11/All_Call_11-08-2010_1356.wav

Inserting image All_Call_11-08-2010_1356.wav from 2010/11/

Array
(
    [name] => All_Call_11-08-2010_1356
    [extension] => wav
    [mime] => audio/x-wav
    [size] => 
    [dimensions_width] => 0
    [dimensions_height] => 0
    [path] => 2010/11/
    [authorid] => 0
    [hotlink] => 0
    [id] => 2010/11/All_Call_11-08-2010_1356.wav
    [realname] => 
    [displaymime] => audio/x-wav
    [location] => /home/ccnet/public_html/alerts/
)

into database

Checking 2010/11/All_Call_11-08-2010_1922.wav

Inserting image All_Call_11-08-2010_1922.wav from 2010/11/

Array
(
    [name] => All_Call_11-08-2010_1922
    [extension] => wav
    [mime] => audio/x-wav
    [size] => 
    [dimensions_width] => 0
    [dimensions_height] => 0
    [path] => 2010/11/
    [authorid] => 0
    [hotlink] => 0
    [id] => 2010/11/All_Call_11-08-2010_1922.wav
    [realname] => 
    [displaymime] => audio/x-wav
    [location] => /home/ccnet/public_html/alerts/
)

into database

Checking .empty

Checking popfetcher-2010-11.log

Inserted 2 images into the database
Filters - Find media
Directory 	
ok,, i did not click any buttons or do anything while i was on that screen. In fact, I clicked on a link on the menu to the left to get to another section so i wouldnt do anything.
I then clicked on media library link again, and this is the debug info on the second trip in.
the files are deleted.

Code: Select all

2010/ is a directory.
2010/11/ is a directory.
CCNetalertbanner.serendipityThumb.jpg is a file.
.empty is a file.
CCNetalertbanner.jpg is a file.
popfetcher-2010-11.log is a file.

Got files:

Array
(
    [CCNetalertbanner.serendipityThumb.jpg] => 1
    [.empty] => 1
    [CCNetalertbanner.jpg] => 1
    [popfetcher-2010-11.log] => 1
)

Image Sync Right: 1 Onthefly Sync: 1 Hash: 5c22b1e95f1a1153d299e99e63afc337!=480ce4b2d1975939b9b65b443077bc1f

Got images:

Array
(
    [0] => Array
        (
            [path] => 
            [name] => CCNetalertbanner
            [extension] => jpg
            [thumbnail_name] => serendipityThumb
            [id] => 1
        )

    [1] => Array
        (
            [path] => 2010/11/
            [name] => All_Call_11-08-2010_1922
            [extension] => wav
            [thumbnail_name] => 
            [id] => 48
        )

    [2] => Array
        (
            [path] => 2010/11/
            [name] => All_Call_11-08-2010_1356
            [extension] => wav
            [thumbnail_name] => 
            [id] => 47
        )

)

File name is CCNetalertbanner.jpg,
thumbnail is CCNetalertbanner.serendipityThumb.jpg

File name is 2010/11/All_Call_11-08-2010_1922.wav,
thumbnail is 2010/11/All_Call_11-08-2010_1922..wav
Deleting Image 48
Unable to locate the file entitled 2010/11/All_Call_11-08-2010_1922.wav, maybe it has already been deleted?

File name is 2010/11/All_Call_11-08-2010_1356.wav,
thumbnail is 2010/11/All_Call_11-08-2010_1356..wav
Deleting Image 47
Unable to locate the file entitled 2010/11/All_Call_11-08-2010_1356.wav, maybe it has already been deleted?

Cleaned up 2 database entries

Got unmatched files:

Array
(
    [0] => .empty
    [1] => popfetcher-2010-11.log
)

Checking .empty

Checking popfetcher-2010-11.log
Filters - Find media
Directory
I will actually delete those two entries from the blog, and post another test.
that way if you would like to see the front of it or anything it will be there.

http://www.alerts.cc-net.org

Also, to get the sql table to upload, I had to rename it and add a .txt onto the end.

If I missed anything, Let me know and i'll try again

Thanks again
Tom
Attachments
serendipity_images.sql.txt
Had to add .txt on to the end in order to upload.
(2.13 KiB) Downloaded 254 times
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Media file being deleted by Media library functions

Post by garvinhicking »

Hi!

Ok, I think we got it.

The serendipity_event_popfetcher.php file defines the "subfolder" architecture like this:

Code: Select all

            $maildir .= '/' . date('Y') . '/' . date('m') . '/';
(line 729)

This makes it store the path as "/2011/10/file.wav" - but the s9y code wants to have it WITHOUT a leading /, and so it cannot match the files properly.

I think it should be sufficient to replace the code above to:

Code: Select all

            $maildir .= date('Y') . '/' . date('m') . '/';
to make the popfetcher store the files properly. Can you confirm/try that?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
WQGJ-587
Regular
Posts: 7
Joined: Mon Nov 08, 2010 1:59 am

Re: Media file being deleted by Media library functions

Post by WQGJ-587 »

Yes, sir,
I can confirm that fix is the solution.

Thank you very much kind sir,

I first installed WP. but could never figure out how to get there postmaster plugin to catch and post the files.
Even searching there forum could reveal a solution.
Then I found Serendipity. I love it. Much simpler operation, and does to a T what I wanted to do.

Thanks again for your help, and hard work in the whole product line.

I have found a glitch that I think is inside the Popfetcher plugin. Whom would I address that to?
a lil detail. would be the way it see's email address's on incoming email.
I have a program that, according to them, follows the industry standard for email address formatting, as per the following quote from them
Regarding the angle brackets, they are used to differentiate a name "Tom Brock" from the actual email address. This is standard formatting for SMTP. We use a third-party component for the SMTP communications and leaving out the brackets will cause an error. I'm not sure whether servers would accept it without brackets either..

Here's some more info on the subject:

http://www.cns.utoronto.ca/usg/technote ... intro.html

http://tools.ietf.org/html/rfc2822

I have to put the brackets "<>" around the email address in the configuration on the option Restrict e-mail sender in order to get it to accept emails from that program.

with that said, When i tried to follow up on who developed or follow that i ran into a dead end.
If there is some one who is familiar with it i'd love to know if i can work around that, or just leave it as is.



Regards
Tom
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Media file being deleted by Media library functions

Post by garvinhicking »

Hi!
I can confirm that fix is the solution.
That's great! And I'm very glad you had the patience to work this out together with me. :-)

About your glitch, this is more of a security feature of popfetcher. Basically, someone who knew what your usual mail adress is to be allowed to create postings in your blog could "fake" that address inside his mail agent and submit:

"<yourallowedmail@host.com>" <myrealmail@host.com>

as the Sender-Line; and then, if popfetcher were to simply match any brackets there, it would accept the "faked" mail adress as an accepted one.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply