I am getting this when enabling error reporting with 3.0.2 experimental.
since nothing is recorded in .logs, I assume it is something fundamental.
It holds any further development of the theme for me.
Any help with figuring this out, please?
PS: is there a way to disable translation enaltogetherether?
Quote:
Notice: Undefined offset: 1 in /.../gallery3/system/libraries/I18n.php on line 60
Dang... Something went wrong!
We tried really hard, but it's broken.
Talk to your Gallery administrator for help fixing this!
Notice: Undefined offset: 1 in /.../gallery3/system/libraries/I18n.php on line 60
Fatal error: Exception thrown without a stack frame in Unknown on line 0
Posts: 7994
I've seen that reported elsewhere as well, but in those cases they were using NGINX so I didn't spend much time debugging. I haven't seen this on Apache2 before. When did this start happening for you? What build of the code do you have?
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 2466
after upgrading to experimental from official - reported first back in April - http://gallery.menalto.com/node/101928
did not go away ever since
Posts: 2
I also have this problem. I had to force display of errors to even get any hint what was going on (every visitor just got a blank page).
In the following code (in system/libraries/l18n.php), I18n::get_locale(FALSE) returns an empty string.
Therefore $locale[1] doesn't exist, causing the line with Kohana::find_file to give an error.
I don't know what causes this to go wrong and I hope a developer knows, otherwise I have to dig deeper in the code or abandon gallery3 and try to make my own gallery.
Posts: 2
Found something also interesting... The first text my Gallery3 installation requests in get_text() is "mysqli::real_connect(): (28000/1045): Access denied for user '<databasename>'@'<host>' (using password: YES)"
I havn't found an error yet in the database settings in var/database.php yet though.
Posts: 16504
Sounds like your user you have connecting to your database doesn't have proper permission.
____________________________________________
Like Gallery? Like the support? Donate now!
Posts: 2466
Does not answer original question though...
Posts: 2466
OK... now I have to insist... I cannot release a new version of the theme unless I can ensure there are no errors...
Posts: 7994
This is at the top of my list, but I've had no time recently. I'll do my best.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 7994
Ok, digging into it now. Backtracking the error from:
That's in this code:
So I18n::get_locale(FALSE) must not be returning a value with an underscore in it. get_locale() just returns a value from I18n::$locale and that's set via I18n::set_locale() which is called from system/core/Kohana.php in Kohana::setup(). That code looks like this:
We set the locale.language config setting in modules/gallery/config/locale.php:
That has an underescore in it so after line 153 in Kohana::setup() $locales[0] should be en_US.UTF8. After that, it's less clear to me because it's system dependent. What does Kohana::$locale get set to after line 156 and line 159? If you can tell me those values I can probably figure out what's going wrong. Also, it would help if you gave me the output from running "locale -a"
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 2466
if you could provide me kohana file with the log, I can run it to see what values are
how do I run "locale -a"?
Posts: 7994
Tweak Kohana.php like the above, or replace it with this version:
http://www.menalto.com/.outgoing/gallery/Kohana.php.txt
To run locale -a, create a script like this:
Or copy it from: http://www.menalto.com/.outgoing/gallery/locale-a.php.txt
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 2466
2011-06-26 14:25:00 -04:00 --- error: 157:en_US.UTF-8
2011-06-26 14:25:00 -04:00 --- error: 161:en_US.UTF-8
C
POSIX
Posts: 7994
Hm. Ok, that locale value looks reasonable.. not what I was expecting! You don't have the en_US.UTF-8 locale on your system, and that's probably the real issue so if you add that locale the problem will go away. But even so, the code should work. Leave Kohana.php the way it is and replace system/libraries/I18n.php with http://www.menalto.com/.outgoing/gallery/I18n.php.txt and try again.. now what's in your log?
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 2466
Sent a PM
Posts: 7994
Ok, all the values look fine. $locale is an array with two values, but it claims that there's no value at offset 1. What's the error you're getting now? We need to close the gap between line 61 (in the modified file) saying that $locale is an array with two values, and line 63 saying that $locale doesn't have a values at position 1.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 2466
Edit: ok,m misread the included question
leaving both changes to kohana.php and I18n.php and enabling error reporting
Nothing in error log (I guess it does not even goes there)
disabling error reporting (local.php)
getting the following in error log
Posts: 7994
Any chance I can get SSH access here? It's hard to debug these issues remotely :-/
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 2466
I do not have it for my setup
FTP access?
Posts: 2466
and in the end ... what would be a solution? uninstall, roll back to 3.0.1?
Posts: 7994
Sorry, I'm travelling so my access is a little spotty. I'm in NYC now for the month; I should have a little more time to work on this. FTP access works, it's slow to debug that way but I can probably figure it out from that.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 7994
Hey Serge-- Still waiting on FTP access. I suspect that we can resolve this pretty quickly if I can just get in there and debug the problem directly.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 2466
PM sent
Posts: 2466
any luck?
Posts: 7994
Got in and looked around, but didn't sort it out yet. I have blocked out 2 hours tomorrow to dig in.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 2466
Thank you
really appreciate your help with this
Posts: 16
I've got the same problem after migrating my gallery to another server:
Notice: Undefined offset: 1 in public_html/system/libraries/I18n.php on line 60
Notice: Undefined offset: 1 in public_html/system/libraries/I18n.php on line 60 Fatal error: Exception thrown without a stack frame in Unknown on line 0
First no errors were visible, but after enabling mb_string and putting a local.php these error messages are thrown.
The if statement in I18n.php:
if($local_translation_files = Kohana::find_file('i18n', $locale[0].'/'.$locale[1]))
$translation_files = array_merge($translation_files, $local_translation_files);
Error log:
[Mon Jul 18 16:16:19 2011] [error] [client 77.248.233.35] PHP Notice: Undefined offset: 1 in public_html/system/libraries/I18n.php on line 60
[Mon Jul 18 16:16:19 2011] [error] [client 77.248.233.35] PHP Notice: Undefined offset: 1 in public_html/system/libraries/I18n.php on line 60
[Mon Jul 18 16:16:19 2011] [error] [client 77.248.233.35] PHP Notice: Undefined offset: 1 in public_html/system/libraries/I18n.php on line 60
[Mon Jul 18 16:16:19 2011] [error] [client 77.248.233.35] PHP Notice: Undefined offset: 1 in public_html/system/libraries/I18n.php on line 60
[Mon Jul 18 16:16:19 2011] [error] [client 77.248.233.35] PHP Fatal error: Exception thrown without a stack frame in Unknown on line 0
[Mon Jul 18 16:16:20 2011] [error] [client 77.248.233.35] PHP Notice: Undefined offset: 1 in public_html/system/libraries/I18n.php on line 60
[Mon Jul 18 16:16:20 2011] [error] [client 77.248.233.35] PHP Notice: Undefined offset: 1 in public_html/system/libraries/I18n.php on line 60
[Mon Jul 18 16:16:20 2011] [error] [client 77.248.233.35] PHP Notice: Undefined offset: 1 in public_html/system/libraries/I18n.php on line 60
[Mon Jul 18 16:16:20 2011] [error] [client 77.248.233.35] PHP Notice: Undefined offset: 1 in public_html/system/libraries/I18n.php on line 60
[Mon Jul 18 16:16:20 2011] [error] [client 77.248.233.35] PHP Fatal error: Exception thrown without a stack frame in Unknown on line 0
Posts: 7994
Ok, thanks to access to SergeD's box I managed to sort some of this out. It's an issue with the timezone detection code that appears to only surface on PHP 5 with strict mode enabled. This test code shows the error:
I get this error:
I am not 100% sure what the correct fix is. It sounds like the right answer is to set the date.timezone setting in php.ini and/or set it in the code before we call the date_default_timezone_get() function. Or you can turn off E_STRICT warning levels.
I've got to run for now, but I think that this is something that really needs to be fixed on the server's PHP settings-- anybody who calls this function is going to have a problem until the config is fixed. I'll work on a way to make G3 fail more gracefully when this happens.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 2466
Would be nice if you were to elaborate on your suggestion. Let's see if I can get it right
Adding
into config.php seems to solve the problem (or is it just hiding it?). I do not know how reliable is it though...
and as far as php.ini setting is
Ref:
http://www.php.net/manual/en/datetime.configuration.php
http://www.php.net/manual/en/timezones.america.php
http://www.rasyid.net/2007/08/29/datetimezone-in-phpini-for-php5/
PS: you should consider admin/install coverage for this though
Posts: 16
Would you like shell access to my machine as well?
Posts: 7994
@Serge, I think the php.ini setting is probably the right thing to do here. Any PHP app is going to have this problem until Apache/PHP is configured properly. Fixing it in Gallery 3 is only going to solve it for the one app. I'm still investigating workarounds and longer term fixes.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 2466
I am using WordPress and there is no problem there
So it could be managed on app level and I think it is proper way to do it
but... it works and this what counts
Posts: 16
I don't use E_STRICT in php.ini, so it seems to be a wider problem.
Posts: 72
I've tried just about everything and can't get this to work. I can't use my gallery and I need to get it working as soon as possible. Please help? The solutions above don't seem to work for me. I will add that I downloaded the entire folder and moved it to a new server, then restored the database. Essentially nothing changed but the server. Could this be a permissions issue and when i uploaded the files, the permissions changed?
http://199.167.200.101/~ddeg10/myersgallery/
Posts: 29
I'm running into this issue as well. I have performed all the workarounds above (including adding my timezone to both php.ini and config.php) and am still getting the problem. The output from the test code above is simply, "America/Edmonton" which is correct. So I'm confused, and have have double-checked that I performed everything above in this thread.
Notice: Undefined offset: 1 in /usr/local/www/apache22/sites/redbeet.com/pictures3/system/libraries/I18n.php on line 63
I'll leave my local.php enabled for the next few days if you want to check it out. I have SSH access if you have any interest in poking around.
--
Kelly's smooth running, free flowing Gallery 1: [url]www.redbeet.com/pictures[/url]
Kelly's all-new and improved Gallery 3: [url]www.redbeet.com/pictures3[/url]
Posts: 72
Can anyone help? No one seems to know how to fix this?
Posts: 2466
The only solution known is outlined above - http://gallery.menalto.com/node/102474#comment-377994
I did what I can to help Bharat
Posts: 72
The config located here?: gallery/application/config/config.php
Also where specifically should this code be added inside the file? Is the php.ini edit also required? if so, where specifically should that code be added? Is it the php.ini located in the main gallery directory or the global server php.ini?
The post cited seems vague and maybe I'm adding the code in the wrong place(s)? Please help.
Posts: 2466
yes, location of the config.php is correct
In my case I simply added code to the end of the file.
I believ this was enough for my setup to fix the problem
if not, then add appropriate line into [PHP] section of php.ini which can be created/found in gallery's root folder.
Posts: 72
Unfortunately i made those changes but they did nothing.
Posts: 16
It neither worked for me.
I'm getting kinda worried now. Maybe a reïnstallation? And import my previous collection into the new installation?
Posts: 28
This is kind of weird, but here's what happened to me. I had updated the my.cnf to enable networking in Ubuntu 11.04 in /etc/mysql/my.cnf I uncommented the line that has
#bind-address = 127.0.0.1
Then I got those same errors that are mentioned in this thread. So, I commented that back out, restart mysql and things are fine.
Now here's the weird part, I have 2 gallery3 installs on this server, one one of them the error never occurred! The one that had problems is at a different URL: http://www.dantesinfernophotography.com/gallery3 The one that didn't have the problem is at http://www.cocoanet.us/dantepasquale/gallery3.
http://www.cocoanet.us/dantepasquale/gallery3
http://www.cocoanet.us/dantepasquale/blog
http://www.dantesinfernophotography.com/gallery3
http://www.twitter.com/DantePasquale
Posts: 7994
Those of you who are having this problem, I am unable to reproduce it on my dev box. I can't be sure that I can fix it without reproducing it. If you can PM me ssh info so that I can get onto your box where the problem is happening, I can probably straighten this out pretty quickly. Otherwise, I'm just guessing... thanks.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 11
Any status on this? I have 3.0.2 on my server box, and wanted to upgrade from 2.x. I have the local.php error reporting file in the directory. I tried the config and ini workarounds and when I use both, I get a blank page. When I use just the config workaround, I get no error code, but the "Dang! ...." message. With neither workaround, I get the I18n.php line 60 error others are reporting here. No SSH available on my server, as I have to pay extra for it.
Posts: 11
Well, the latest build at of last night (branch master build 178) fixes the problem. Coupled with the Clean Canvas theme and engineer's fix found here (http://gallery.menalto.com/node/97030?page=5#comment-381556) for
<? if ($thumb_proportion != 1): ?>
all works just fine.
Posts: 137
I am facing same problem...
I did all the above timezone related changes in config.php and php.in and but that did not help to solve the problem.
I can provide SSH access.
Or let me know what all I should check out for.
Any clue is appreciated.
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God
Posts: 27300
You don't mention if you have upgraded to the most recent experimental version.
If you have then PM Bharat info.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 137
hi Dave,
The experimental version has file name issues. The filenames with all lower case is not matching with Source code where the file names starts with upper case.
Like bootstrap.php is referred as Bootstrap.
I started changing few, but it seems, its with all the files.
Is there any script that corrects it?
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God
Posts: 27300
As it should be. It works on my site:
note the difference between
http://www.langleycom.com/gallery3/application/Bootstrap.php
and
http://www.langleycom.com/gallery3/application/bootstrap.php
See the download from 5 min ago as Boot and not boot. Same with on the operational site Bootstrap.php not boot...
The download from the git repository and FTP to the site works for me. no script.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 137
Hi dave,
The experimental version also did not fix it.
It seems to be upgrade issue to me... If i install the latest code separately it all runs fine.
But when I copy the old var folder to new installed location, this happens.
Running upgrader also gives the same error.
I see that the following tables are missing, which are present in newly installed gallery
any clue? anything that you want me to check out?
-gopu
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God
Posts: 27300
bharat should be able to.
http://gallery.menalto.com/node/102474#comment-379817
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team