[RC] Attachments in subfolders

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
User avatar
shortmort37
Registered User
Posts: 427
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: [RC] Attachments in subfolders

Post by shortmort37 » Fri Aug 15, 2014 9:05 pm

Hi Fabio, I'm finally getting around to testing this mod.

I built a test environment, and copied my production board to it. It installed fine, but while waiting on the execution of move_attachments_in_subfolders.php, I get this:

General Error
SQL ERROR [ mysql4 ]

MySQL server has gone away [2006]

SQL

SELECT COUNT(DISTINCT s.session_ip) as num_guests FROM phpbb_sessions s WHERE s.session_user_id = 1 AND s.session_time >= 1408136040

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/includes/db/dbal.php
LINE: 757
CALL: trigger_error()

FILE: [ROOT]/includes/db/mysql.php
LINE: 193
CALL: dbal->sql_error()

FILE: [ROOT]/includes/functions.php
LINE: 4139
CALL: dbal_mysql->sql_query()

FILE: [ROOT]/includes/functions.php
LINE: 4173
CALL: obtain_guest_count()

FILE: [ROOT]/includes/functions.php
LINE: 4523
CALL: obtain_users_online()

FILE: [ROOT]/move_attachments_in_subfolders.php
LINE: 172
CALL: page_header()


Of course, the reason why I want this mod is because ftp has an 8K limit on files in any directory (I am well in excess of that), and not all of the images in /files copied over from prod to test. Could that be why it's upset? Or was some timeout exceeded?

Thanks
Dan

I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 » Sat Aug 16, 2014 12:58 pm

Hi Dan,
this error is not directly related to my MOD, but is something tied with the normal session handler of the PHPBB3 board.

In different words, I think you've made some mistake in creating your test environment and/or in copying your board into it.

:)

User avatar
shortmort37
Registered User
Posts: 427
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: [RC] Attachments in subfolders

Post by shortmort37 » Sat Aug 16, 2014 3:16 pm

Hmmm... That's odd,except for the fact that not all the images from /files were copied via ftp (which is the very reason for wanting to apply your mod in the first place), the test board performs exactly the same as production, in every way.

I guess I'll take it up with my service provider.

Thanks anyway
Dan

I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 » Sat Aug 16, 2014 9:49 pm

Have you changed, within the ACP under the "server configuration" -> Cookie, the cookie configuration?

If not, this could result in this kind of problems...

:)

User avatar
shortmort37
Registered User
Posts: 427
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: [RC] Attachments in subfolders

Post by shortmort37 » Sun Aug 17, 2014 3:38 pm

Oops, I hadn't done that, Fabio. I fixed it - but, I'm still getting the same error.

My ISP advises:
InMotion Support wrote:I do apologize this error that you are receiving, however would it be alright if you could provide us with exact replication steps, so we may view this error ourselves, and be able to check in on everything that's going on within that server, to give you that error. It does seem as it may be missing some important entries within the mysql database, or isn't calling them correctly. I would recommend using the mysql check/repair database tool, available within your cpanel, then retrying this mod.

http://www.inmotionhosting.com/support/ ... r-database
I'll advise them of the link, and do the check/repair of the database and report back here. Meanwhile, if you have any other ideas, please let me know.

Many thanks
Dan

User avatar
shortmort37
Registered User
Posts: 427
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: [RC] Attachments in subfolders

Post by shortmort37 » Mon Aug 18, 2014 11:56 am

OK, the database check indicated no corruption. I gave them the link to the script and they executed it. Here's what they said:
InMotion Hosting Support wrote:It seems to be that you are running out of MySQL connections, and we are trying to figure out why, it seems there are alot of slow running queries that is causing the system to use all the connections and lock out which causes the update to fail, so you might want to look into the slow quires to see if you can get those to stop maxing out your connections.
Maybe they should tell *me* why the queries are running so slowly on *their* server! And that's what I will say to them...

At any rate, is there any way to throttle database activity?

thanks
Dan

I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 » Mon Aug 18, 2014 5:28 pm

Dan, the "slow" query is write down into the message error:

SELECT COUNT(DISTINCT s.session_ip) as num_guests FROM phpbb_sessions s WHERE s.session_user_id = 1 AND s.session_time >= 1408136040

If you have PHPMYADMIN or a similar DB management software, you can try to run the query by yourself and to see if it works or not.

What I can assure to you is that this query is not fired "directly" from my MOD... you can check it by yourself: it's enough to try to search the query code within the PHP file, and you will find 0 result).

The query is fired from the core PHPBB3 application when it is counting the number of forum visitors (sessions).

Unfortunately I can't help so much in that case... probably it's better for you to open a new topic under the "3.0.x Support Forum", to receive a better assistance.

:)

User avatar
shortmort37
Registered User
Posts: 427
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: [RC] Attachments in subfolders

Post by shortmort37 » Mon Aug 18, 2014 6:00 pm

It's curious, Fabio - I can run that query directly with no complaint:

Image

So I'm not sure what to make of it - why the script containing the query fails, when a direct execution of the query does not.

Dan

dan filipi
Registered User
Posts: 82
Joined: Fri Dec 21, 2007 6:36 pm

Re: [RC] Attachments in subfolders

Post by dan filipi » Thu Dec 11, 2014 3:33 pm

I-FR70 wrote:Hi wile,
there is no function to revert changes back, but it's quite easy to do it manually, going through all steps in reverse order and deleting the added code.

About the files, it's quite easy to create a script that scans all subfolders in the "files" folder and moves all files in the main folder.
When I have a bit of time, I'll do it.

Ciao.
There is a problem with this MOD running on 3.1.
Have you looked into reversing it?

Thanks!

User avatar
Lumpy Burgertushie
Registered User
Posts: 66849
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: [RC] Attachments in subfolders

Post by Lumpy Burgertushie » Thu Dec 11, 2014 3:38 pm

you can't run 3.0 MODs in 3.1 at all.

you have to wait for the MOD to be converted to an extension before you can use it in 3.1


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 » Thu Dec 11, 2014 3:51 pm

Lumpy Burgertushie wrote:you can't run 3.0 MODs in 3.1 at all.

you have to wait for the MOD to be converted to an extension before you can use it in 3.1

robert
Yes, please don't use this MOD (or any other MOD) for a PHPBB3 board version 3.1.x or higher.

Probably, in the near future, I'll convert my MOD to an extension... but before this, I have to decide to move my board from 3.0 to 3.1, and it require time...

:)

dan filipi
Registered User
Posts: 82
Joined: Fri Dec 21, 2007 6:36 pm

Re: [RC] Attachments in subfolders

Post by dan filipi » Thu Dec 11, 2014 4:22 pm

Lumpy Burgertushie wrote:you can't run 3.0 MODs in 3.1 at all.

you have to wait for the MOD to be converted to an extension before you can use it in 3.1


robert
Yes I am aware of this which is why I asked if a reversal of this mod has been developed in order to update to 3.1 without breaking all the attachments.
A reversal is what I need before I can update because 3.1 doesn't recognize attachments in subfolders.

dan filipi
Registered User
Posts: 82
Joined: Fri Dec 21, 2007 6:36 pm

Re: [RC] Attachments in subfolders

Post by dan filipi » Fri Dec 12, 2014 5:33 pm

Looking at database of the attachments, the file name doesn't have a folder number associated with it in the name that I see right off. I suppose a script that moves or copies all the attachment files into one directory like they were before this MOD and changes whatever file name associations (if any or needed) in the database would effectively reverse this MOD and bring attachments back to how they were so a 3.1 update could be done.
Seems simple enough but very much beyond my capabilities so I'm hoping someone steps up and does this.

Thank you.

dan filipi
Registered User
Posts: 82
Joined: Fri Dec 21, 2007 6:36 pm

Re: [RC] Attachments in subfolders

Post by dan filipi » Fri Dec 12, 2014 6:21 pm

I figured it out.
The solution is simple as moving the attachments from the sub folders that were created by this mod into the files root directory and the attachments work once again in 3.1.

I tried this on only 2 attachments so far (including their thumbnails) on a update install of 3.1 from 3.0.12 which did it's database update during installation.
Be sure to backup before making any changes.

I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 » Mon Dec 29, 2014 9:24 am

Hi all,
if you want to reverse the MOD because you upgrade to 3.1.x, I confirm it's enough to move the attachments from the subfolders to the main "files" folder.

Anyway I'll develop the extension as soon as possible... unfortunately, due an house moving, I'm without ADSL connection at home (since November 10)... so I'll do the job once the internet provider will connect again my new house.

:)

Locked

Return to “[3.0.x] MODs in Development”