[SOLVED] Error using Server Add : "The file property does not exist in the Server_add_entry_Model class"

Molwanh

Joined: 2009-04-22
Posts: 10
Posted: Tue, 2011-03-08 11:19

Hi,

As it is my first post since long : thanks a lot for you job on gallery ! Helping my since years.

I am trying to install gallery3 and importing all my photos using Server Add and I got an error when adding a large number of items :

exception 'Kohana_Exception' with message 'The file property does not exist in the Server_add_entry_Model class' in /var/www/photos/system/libraries/ORM.php:398
Stack trace:
#0 /var/www/photos/modules/server_add/controllers/server_add.php(289): ORM_Core->__get('file')
#1 [internal function]: Server_Add_Controller::add(Object(Task_Model))
#2 /var/www/photos/modules/gallery/helpers/task.php(90): call_user_func_array('Server_Add_Cont...', Array)
#3 /var/www/photos/modules/server_add/controllers/server_add.php(122): task_Core::run('3')
#4 [internal function]: Server_Add_Controller->run('3')
#5 /var/www/photos/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Server_Add_Controller), Array)
#6 [internal function]: Kohana_Core::instance(NULL)
#7 /var/www/photos/system/core/Event.php(208): call_user_func_array(Array, Array)
#8 /var/www/photos/application/Bootstrap.php(67): Event_Core::run('system.execute')
#9 /var/www/photos/index.php(102): require('/var/www/photos...')
#10 {main}

The problem happens during the process when I add a large number of items (usually happens between the 400th and the 800th item). After the error, maintenance page asks me to rebuild some images (but not all missing ones).
Looking database, "server_add_entries" table, all items are here but process has stop suddenly ("item_id" column is NULL for all non-added items).

I test only on fresh installation (default modules and default themes). Problem happen on stable version 3.0.1 and with the GIT version.

I remember that I have tested gallery3 some times ago (RC2 I think) and I didn't get any problem with Server Add.

Here are my server informations :
- Debian Squeeze 64bits (Linux 2.6.32-5-amd64 on x86_64)
- Apache version 2.2.16
- PHP 5.3.3-7 with Suhosin-Patch
- mysql Ver 14.14 Distrib 5.1.49

If you need any other information, let me know.

Thanks.

 
sebcool20

Joined: 2009-09-18
Posts: 38
Posted: Thu, 2011-03-10 00:16

Pretty much the same problem, but it worked well until yesterday... I've been adding large amounts for pics without any problem, and now it keeps going wrong, even with not so big amount of pics... a very small amount works tho...

Server:
Operating system: Linux 2.6.18-294.26.1.el5.lve0.7.49
Apache: Unknown
PHP: 5.2.12
MySQL: 5.0.91-community-log
Server load: 1.64 1.68 1.64
Graphics toolkit: imagemagick

 
Molwanh

Joined: 2009-04-22
Posts: 10
Posted: Mon, 2011-03-14 09:00

Does anybody have an idea how to solve/bypass this problem ?

 
sebcool20

Joined: 2009-09-18
Posts: 38
Posted: Tue, 2011-03-22 16:39

Asking again, anyone can help with that??

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2011-03-22 17:30

When I search for this issue, this thread with some suggestions from Bharat comes up:
http://gallery.menalto.com/node/100240
____________________________________________
Like Gallery? Like the support? Donate now!

 
Molwanh

Joined: 2009-04-22
Posts: 10
Posted: Tue, 2011-03-22 21:53

Well, it does seems to work for me to run the upgrader. I was able to successfully import >6000 photos.

In fact, I saw that message but as I was using a new installation (no upgrade), I wasn't thinking it applied.
But... it might be a problem if you must run the upgrader to have a new installation to work, no?

In all case, thanks anyway. I should have tried this by myself.

I have now another problem. If I can't find the solution, I will come back :)

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2011-03-22 22:00
Quote:
But... it might be a problem if you must run the upgrader to have a new installation to work, no?

For a new install, no. If you upgrade the code after the new install, yes, you must always run the upgrader.
____________________________________________
Like Gallery? Like the support? Donate now!

 
Molwanh

Joined: 2009-04-22
Posts: 10
Posted: Tue, 2011-03-22 22:23

In fact, I was using a fresh installer (I ran the installer and activate Serveradd module, nothing more). I had made this test several times.

 
Molwanh

Joined: 2009-04-22
Posts: 10
Posted: Thu, 2011-03-24 09:33

Apparently, I was lucky last time. I still have the problem when adding lot of items using serveradd.
And yes, I have run (again and again) the upgrader.

So now, I am stuck and I don't know how to solve this issue.

Thanks.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Thu, 2011-03-24 12:51
Quote:
I still have the problem when adding lot of items using serveradd.

Sounds to me like you can add small amounts and are running into some limit imposed by your host.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
sebcool20

Joined: 2009-09-18
Posts: 38
Posted: Thu, 2011-03-24 15:08

Still the same problem here too, but I've been able to add big amounts of pics in the past... It just happened to stop working without any apparent reason...

 
sebcool20

Joined: 2009-09-18
Posts: 38
Posted: Thu, 2011-03-24 15:11

I tried with just running the upgrader, with the same result. Tried to disable EXIF module and same problem again.

 
Molwanh

Joined: 2009-04-22
Posts: 10
Posted: Thu, 2011-03-24 15:11

I own my server and I didn't put any limit. If there is any parameter to change, I would be pleased to know :)

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Mon, 2011-03-28 15:39

I posed the question to Bharat to have a look. I can't quite see where it's fumbling.
____________________________________________
Like Gallery? Like the support? Donate now!

 
sebcool20

Joined: 2009-09-18
Posts: 38
Posted: Wed, 2011-03-30 01:03

I also tried adding a complete other bunch of pics (was always trying with the same pics) and I got the same problem... Added about 300 and then get to same error log. I tried running the "Fix your Gallery" thing in the maintenance section, added pics, and I still get the same problem...

Here's my log:
2011-03-29 17:40:44 -07:00 --- error: exception 'Kohana_Exception' with message 'The file property does not exist in the Server_add_entry_Model class' in /home/projeti/public_html/xxxxxxx.com/gallery/system/libraries/ORM.php:398
Stack trace:
#0 /home/projeti/public_html/xxxxxxx.com/gallery/modules/server_add/controllers/server_add.php(289): ORM_Core->__get('file')
#1 [internal function]: Server_Add_Controller::add(Object(Task_Model))
#2 /home/projeti/public_html/xxxxxxx.com/gallery/modules/gallery/helpers/task.php(90): call_user_func_array('Server_Add_Cont...', Array)
#3 /home/projeti/public_html/xxxxxxx.com/gallery/modules/server_add/controllers/server_add.php(122): task_Core::run('91')
#4 [internal function]: Server_Add_Controller->run('91')
#5 /home/projeti/public_html/xxxxxxx.com/gallery/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Server_Add_Controller), Array)
#6 [internal function]: Kohana_Core::instance(NULL)
#7 /home/projeti/public_html/xxxxxxx.com/gallery/system/core/Event.php(208): call_user_func_array(Array, Array)
#8 /home/projeti/public_html/xxxxxxx.com/gallery/application/Bootstrap.php(67): Event_Core::run('system.execute')
#9 /home/projeti/public_html/xxxxxxx.com/gallery/index.php(102): require('/home/projeti/p...')
#10 {main}

 
Molwanh

Joined: 2009-04-22
Posts: 10
Posted: Wed, 2011-03-30 08:09

If you need any other information, do not hesitate.

I would be possible, if needed, to give you access to my server (under my control of course :) ) so you can look by yourself. So, if it could help, just ask.
Thanks for your time.

 
Molwanh

Joined: 2009-04-22
Posts: 10
Posted: Fri, 2011-04-01 10:26

I had time to search a bit about this problem and it seems I have bypassed the problem.

I have corrected the line 289 in 'modules/server_add/controllers/server_add.php' which seems to be the problem. Replacing
$task->log("Skipping invalid file: {$entry->file}");
by
$task->log("Skipping invalid file: {$entry->path}");

(in fact, I didn't find any reference to a file property so...)

Doing this, I was able to add all my photos (about 8000) without problem. And I have some log indicating that it is skipping some invalid files (which were certainly crashing the application).

----------------------

Looking in the code, I also saw another problem in 'modules/server_add/controllers/server_add.php' on line 243 :
$name = basename($entry->path);
In fact, I was having problem with folder/files with special chars. By searching, I found that locales were not correctly set in the module. As I wasn't able to find where this is defined in gallery so I made a (bad) workaround by forcing locales to fr_FR.UTF8 (that I am using on my system) in the function. This solved the problem with accent. I think you should find a solution to have the correct locales here or to not use 'basename'.

----------------------

And, as I was inside and because I didn't like how gallery manage filename with accent (for URL).

If someone is looking for the same thing that me (or maybe to include this in the main code), here are my changes :

I changed two file to replace non standard characters by ascii ones :

In 'modules/gallery/models/item.php' line 340. Replace
$tmp = preg_replace("/[^A-Za-z0-9-_]+/", "-", $tmp);
by

$tmp = str_replace('&', '-and-', $tmp);
$tmp = str_replace(' ', '-', $tmp);
$tmp = str_replace('--', '-', $tmp);
$tmp = text::transliterate_to_ascii($tmp);
$tmp = trim(preg_replace('/[^\w\d_ -]/si', '', $tmp));

and in 'modules/gallery/helpers/item.php', line 156. Replace
$result = preg_replace("/[^A-Za-z0-9-_]+/", "-", $result);
by

$result = str_replace('&', '-and-', $result);
$result = str_replace(' ', '-', $result);
$result = str_replace('--', '-', $result);
$result = text::transliterate_to_ascii($result);
$result = trim(preg_replace('/[^\w\d_ -]/si', '', $result));

----------------------

Hope my workarounds will help you to correct these problems.
Sorry if my english is not very good.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sat, 2011-04-02 22:36

@Molwanh: excellent work! I didn't know about text::transliterate_to_ascii but we should definitely use this. I've created https://sourceforge.net/apps/trac/gallery/ticket/1668 to track that for 3.0.2

And the main issue for this thread is a bug in the code from when I updated the module to v4:
https://sourceforge.net/apps/trac/gallery/ticket/1669
Your fix is correct -- I'll push it shortly.

---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Fri, 2011-04-22 21:09

Ticket #1668 is fixed. We'll do simple transliteration using text::transliterate_to_ascii by default, but if you install the "transliterate" module from contrib, it uses a much larger table (~16,500 entries) so it'll do a much more comprehensive set of conversions.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!

 
guanche
guanche's picture

Joined: 2009-01-18
Posts: 57
Posted: Mon, 2011-05-23 12:29

i am using latest G3 version and have upgraded it and even have done Mr Molwanh corretion to that files but i still get an error when trying to add a 400mb FLV video to my gallery.

i get:

Quote:
exception 'Kohana_Exception' with message 'The file property does not exist in the Server_add_entry_Model class' in /home/guancheo/public_html/guanche/entorno/system/libraries/ORM.php:398
Stack trace:
#0 /home/guancheo/public_html/guanche/entorno/modules/server_add/controllers/server_add.php(289): ORM_Core->__get('file')
#1 [internal function]: Server_Add_Controller::add(Object(Task_Model))
#2 /home/guancheo/public_html/guanche/entorno/modules/gallery/helpers/task.php(90): call_user_func_array('Server_Add_Cont...', Array)
#3 /home/guancheo/public_html/guanche/entorno/modules/server_add/controllers/server_add.php(122): task_Core::run('64')
#4 [internal function]: Server_Add_Controller->run('64')
#5 /home/guancheo/public_html/guanche/entorno/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Server_Add_Controller), Array)
#6 [internal function]: Kohana_Core::instance(NULL)
#7 /home/guancheo/public_html/guanche/entorno/system/core/Event.php(208): call_user_func_array(Array, Array)
#8 /home/guancheo/public_html/guanche/entorno/application/Bootstrap.php(67): Event_Core::run('system.execute')
#9 /home/guancheo/public_html/guanche/entorno/index.php(102): require('/home/guancheo/...')
#10 {main}

Does anybody knows how to solve this.

Thank you so much

regards all

guanche

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Mon, 2011-05-23 15:13

@guanche: you have the latest code, but you haven't run the upgrader so your database schema is out of date. See the upgrading instructions in my signature.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!

 
guanche
guanche's picture

Joined: 2009-01-18
Posts: 57
Posted: Mon, 2011-05-23 18:22

Thank ytou Mr Bharat

i had done

http://www.guanche.org/guanche/entorno/index.php/upgrader

with results at the pic i have attached.

Isnt that so?

but i cant add that big video.

Thank you Mr Bharat

regards all

guanche

AttachmentSize
g3_upgrader.jpg69.41 KB
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Tue, 2011-05-24 14:15

guanche,
you are not using the latest experimental code. Follow directions in bharats signature.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
guanche
guanche's picture

Joined: 2009-01-18
Posts: 57
Posted: Thu, 2011-05-26 07:34

Hello i think now is all upgraded (see pic attached)

id osent give me 'Kohana_Exception' error, but now when trying to add server a flv video it say "Succesfully Added 1 Photo" but the video dosent appears at the page,

i have tested log and it say now:

------------
Skipping invalid file: /home1/guancheo/subida_wg/LuchaGuanche.flv
Añadiendo fotos/álbums (1 de 1)
------------

video works fine here at my local computer with Kaffeine and VLC and it have been downloaded from my page at Youtube where it works fine too.

Any help with this?

Thank you so much

regards all

guanche

AttachmentSize
g3_upgraded.jpg62.81 KB
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Thu, 2011-05-26 23:26

Can you add these videos?
http://www.mediacollege.com/adobe/flash/video/tutorial/example-flv.html

Dave
____________________________________________
Blog & G2 || floridave - Gallery Team

 
guanche
guanche's picture

Joined: 2009-01-18
Posts: 57
Posted: Fri, 2011-05-27 02:55

Hello Mr Floridave

i have uploaded to server that videos and tried to "Add from server" them and it says "Sucesfuly Added 3 Photos" but still nothing appears at the page.

Log say:

------------------------
Skipping invalid file: /home1/guancheo/subida_wg/20051210-w50s_56K.flv
Skipping invalid file: /home1/guancheo/subida_wg/20051210-w50s.flv
Skipping invalid file: /home1/guancheo/subida_wg/barsandtone.flv
Adding Photos/álbums (3 of 3)
------------------------

Thank you for your help

regards

guanche

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Fri, 2011-05-27 03:10
Quote:
Skipping invalid file:...

is not the same as the title of this tread so we are getting confused.
Start a new thread after trying the no_ffmpeg module and the video dimensions module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Sun, 2012-01-01 21:33

Comments are now locked for this topic.