owncloud-archive / news

:newspaper: News app for ownCloud
GNU Affero General Public License v3.0
290 stars 106 forks source link

/owncloud/index.php/apps/news/ always redirects to /owncloud/index.php #319

Closed icebrian closed 11 years ago

icebrian commented 11 years ago

Hello everyone,

I have for a while now been suffering from a problem that makes the News client via web unusable.

Basically whenever I access the "News" app I get redirected to "/owncloud/index.php". I have tried everything I could think of to try a debug this problem but it is always the same.

This was present since the first day I started using OC v5.0.4 + News. I am currently at OC v 5.0.10 and News v1.205 and App Framework v0.102, so all the latest version and the problem persists.

I was using only HTTPS but I have tried only via HTTP but problem is the same. The only times in which News works is after installing a new version, after the install I can access News only once, all subsequente acesses are redirected to the OwnCloud main page.

I have tried using diferent browsers (in Linux and Windows), clearing caches, history, cookies, etc all to no avail.

I've been following the bugs here but I have never seen anyone complaining about this problem, so that makes me think that this might be specific to my own setup.

I all everything is pretty simple, I am using a QNAP TS-439 Pro II NAS that provides customization abilities in which one can run a webserver for such thing as OwnCloud.

OwnCloud itself works great, but News app does not. On the NAS am using PHP 5.3.14 and Apache/2.2.14.

In the apache access_log I get the following, after clicking on the News app icon.

192.168.1.203 - - [19/Aug/2013:14:11:00 +0100] "GET /owncloud/index.php/apps/news/ HTTP/1.1" 307 - 192.168.1.203 - - [19/Aug/2013:14:11:00 +0100] "GET /owncloud/index.php HTTP/1.1" 200 9834 192.168.1.203 - - [19/Aug/2013:14:11:00 +0100] "GET /owncloud/remote.php/core.css?v=0af787945872196b42c9f73ead2565c8 HTTP/1.1" 304 - 192.168.1.203 - - [19/Aug/2013:14:11:00 +0100] "GET /owncloud/index.php/core/js/config.js?v=0af787945872196b42c9f73ead2565c8 HTTP/1.1" 200 1079 192.168.1.203 - - [19/Aug/2013:14:11:00 +0100] "GET /owncloud/remote.php/core.js?v=0af787945872196b42c9f73ead2565c8 HTTP/1.1" 200 232681 192.168.1.203 - - [19/Aug/2013:14:11:00 +0100] "GET /owncloud/index.php/apps/files/css/files.css?v=0af787945872196b42c9f73ead2565c8 HTTP/1.1" 304 - 192.168.1.203 - - [19/Aug/2013:14:11:00 +0100] "GET /owncloud/core/img/breadcrumb.svg HTTP/1.1" 200 2468 192.168.1.203 - - [19/Aug/2013:14:11:00 +0100] "GET /owncloud/index.php/core/routes.json HTTP/1.1" 200 12394 192.168.1.203 - - [19/Aug/2013:14:11:00 +0100] "POST /owncloud/index.php/core/ajax/translations.php HTTP/1.1" 200 30 192.168.1.203 - - [19/Aug/2013:14:11:00 +0100] "GET /owncloud/index.php/core/ajax/share.php?fetch=getItemsSharedStatuses&itemType=file HTTP/1.1" 200 30 192.168.1.203 - - [19/Aug/2013:14:11:00 +0100] "GET /owncloud/cron.php HTTP/1.1" 200 20 192.168.1.203 - - [19/Aug/2013:14:11:01 +0100] "POST /owncloud/index.php/core/ajax/translations.php HTTP/1.1" 200 30 192.168.1.203 - - [19/Aug/2013:14:11:01 +0100] "GET /owncloud/index.php/apps/files/ajax/scan.php?force=false&dir=&requesttoken=7a3821ce8bc14d91091e HTTP/1.1" 200 86

As one can see the first HTTP code is a 307, a redirect. Well here is my report, if any other information is needed please let me know.

BernhardPosselt commented 11 years ago

News will redirect to index.php when there is an authentication error. Never run into this problem though personally. Please try to set up owncloud on a different server to try to narrow down the problem.

BernhardPosselt commented 11 years ago

And could you also try to install the notes app from git master? it uses the same style of programming

icebrian commented 11 years ago

Setting up a new system on a diferent isn't going to be easy for me, but will try. In the meantime have been trying to get notes from git running but to no avail (https://github.com/owncloud/notes).

Have also been doing more tests. If I for example, disable and then re-enable News, I can access my news feeds the first time and only the first time, meaning if I navigate away and come back I get the redirect problem once again.

What is strange to me is that, whenever I upgrade or re-install the first access works fine, but any other subsequente accesss do not.

BernhardPosselt commented 11 years ago

Can you enable debug mode (See readme) and post data/Owncloud.Log?

tim3towers commented 11 years ago

Same problem here after upgrading PHP to 5.5.1 and enabling the opcache. Log message: CSRF check failed Disabling the opcache fixed the issue.

icebrian commented 11 years ago

After enabling debug mode in owncloud.log after accessing News app I get:

{"app":"news","message":"CSRF check failed","level":0,"time":"2013-08-20T22:27:08+00:00"}

tim3towers: how does one disable opcache? I tried with "opcache.enable = Off" and "opcache.enable = 0" in php.ini but I am still experiencing same problem.

icebrian commented 11 years ago

Here is my php.ini file in case it might come in handy

[PHP] engine = On short_open_tag = On asp_tags = Off precision = 12 y2k_compliance = On output_buffering = Off zlib.output_compression = Off implicit_flush = Off unserialize_callback_func= serialize_precision = 100 allow_call_time_pass_reference = On safe_mode = Off safe_mode_gid = Off safe_mode_include_dir =
safe_mode_exec_dir = safe_mode_allowed_envvars = PHP safe_mode_protected_env_vars = LD_LIBRARY_PATH disable_functions = disable_classes = expose_php = On max_execution_time = 240 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data memory_limit = 256M error_reporting = E_ALL & ~E_NOTICE display_errors = Off display_startup_errors = Off log_errors = Off log_errors_max_len = 1024 ignore_repeated_errors = Off ignore_repeated_source = Off report_memleaks = On track_errors = Off variables_order = "EGPCS" register_globals = Off register_argc_argv = On post_max_size = 2047M gpc_order = "GPC" magic_quotes_gpc = Off magic_quotes_runtime = Off
magic_quotes_sybase = Off auto_prepend_file = auto_append_file = default_mimetype = "text/html" doc_root = user_dir = include_path = ".:/etc/config/php" extension_dir = /usr/local/apache/modules enable_dl = On file_uploads = On upload_max_filesize = 2047M allow_url_fopen = On default_socket_timeout = 300 upload_tmp_dir = /share/Web opcache.enable=0 opcache.enable_cli=0 [Syslog] define_syslog_variables = Off

[mail function] SMTP = localhost smtp_port = 25 sendmail_path = /usr/sbin/sendmail -t -i [Java]

[Date] date.timezone = "Europe/Lisbon"

[SQL] sql.safe_mode = Off

[ODBC] odbc.allow_persistent = On odbc.check_persistent = On odbc.max_persistent = -1 odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1

[MySQL] mysql.allow_persistent = On mysql.max_persistent = -1 mysql.max_links = -1 mysql.default_port = mysql.default_socket = "/tmp/mysql.sock" mysql.default_host = mysql.default_user = mysql.default_password = mysql.connect_timeout = 60 mysql.trace_mode = Off

[mSQL] msql.allow_persistent = On msql.max_persistent = -1 msql.max_links = -1

[PostgresSQL] pgsql.allow_persistent = On pgsql.auto_reset_persistent = Off pgsql.max_persistent = -1 pgsql.max_links = -1 pgsql.ignore_notice = 0 pgsql.log_notice = 0

[Sybase] sybase.allow_persistent = On sybase.max_persistent = -1 sybase.max_links = -1 sybase.min_error_severity = 10 sybase.min_message_severity = 10 sybase.compatability_mode = Off

[Sybase-CT] sybct.allow_persistent = On sybct.max_persistent = -1 sybct.max_links = -1 sybct.min_server_severity = 10 sybct.min_client_severity = 10

[dbx] dbx.colnames_case = "unchanged"

[bcmath] bcmath.scale = 0

[browscap]

[Informix] ifx.default_host = ifx.default_user = ifx.default_password = ifx.allow_persistent = On ifx.max_persistent = -1 ifx.max_links = -1 ifx.textasvarchar = 0 ifx.byteasvarchar = 0 ifx.charasvarchar = 0 ifx.blobinfile = 0 ifx.nullformat = 0

[Session] session.save_handler = files session.use_cookies = 1 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 100 session.gc_maxlifetime = 1440 session.bug_compat_42 = 1 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 0 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

session.save_path = /share/MD0_DATA/.php_session [MSSQL] mssql.allow_persistent = On mssql.max_persistent = -1 mssql.max_links = -1 mssql.min_error_severity = 10 mssql.min_message_severity = 10 mssql.compatability_mode = Off mssql.secure_connection = Off

[Assertion]

[Ingres II] ingres.allow_persistent = On ingres.max_persistent = -1 ingres.max_links = -1 ingres.default_database = ingres.default_user = ingres.default_password =

[Verisign Payflow Pro] pfpro.defaulthost = "test-payflow.verisign.com" pfpro.defaultport = 443 pfpro.defaulttimeout = 30

[com]

[Printer]

[mbstring]

[FrontBase]

[exif]

[eaccelerator] extension = eaccelerator.so eaccelerator.shm_size = 32 eaccelerator.cache_dir = /.eaccelerator.tmp eaccelerator.enable = 1 eaccelerator.optimizer = 1 eaccelerator.check_mtime = 1 eaccelerator.debug = 0 eaccelerator.filter = eaccelerator.shm_max = 1M eaccelerator.shm_ttl = 0 eaccelerator.shm_prune_period = 3600 eaccelerator.shm_only = 0 eaccelerator.compress = 1 eaccelerator.compress_level = 9

[Crack]

; End: [Imagick] extension = imagick.so

tim3towers commented 11 years ago

Do you have PHP5.5? I don't see a opcache section. Try to disable eaccelerator.

icebrian notifications@github.com schrieb am 21.08.2013:

Here is my php.ini file in case it might come in handy

[PHP] engine = On short_open_tag = On asp_tags = Off precision = 12 y2k_compliance = On output_buffering = Off zlib.output_compression = Off implicit_flush = Off unserialize_callback_func= serialize_precision = 100 allow_call_time_pass_reference = On safe_mode = Off safe_mode_gid = Off safe_mode_include_dir =
safe_mode_exec_dir = safe_mode_allowed_envvars = PHP safe_mode_protected_env_vars = LD_LIBRARY_PATH disable_functions = disable_classes = expose_php = On max_execution_time = 240 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data memory_limit = 256M error_reporting = E_ALL & ~E_NOTICE display_errors = Off display_startup_errors = Off log_errors = Off log_errors_max_len = 1024 ignore_repeated_errors = Off ignore_repeated_source = Off report_memleaks = On track_errors = Off variables_order = "EGPCS" register_globals = Off register_argc_argv = On post_max_size = 2047M gpc_order = "GPC" magic_quotes_gpc = Off magic_quotes_runtime = Off
magic_quotes_sybase = Off auto_prepend_file = auto_append_file = default_mimetype = "text/html" doc_root = user_dir = include_path = ".:/etc/config/php" extension_dir = /usr/local/apache/modules enable_dl = On file_uploads = On upload_max_filesize = 2047M allow_url_fopen = On default_socket_timeout = 300 upload_tmp_dir = /share/Web opcache.enable=0 opcache.enable_cli=0 [Syslog] define_syslog_variables = Off

[mail function] SMTP = localhost smtp_port = 25 sendmail_path = /usr/sbin/sendmail -t -i [Java]

[Date] date.timezone = "Europe/Lisbon"

[SQL] sql.safe_mode = Off

[ODBC] odbc.allow_persistent = On odbc.check_persistent = On odbc.max_persistent = -1 odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1

[MySQL] mysql.allow_persistent = On mysql.max_persistent = -1 mysql.max_links = -1 mysql.default_port = mysql.default_socket = "/tmp/mysql.sock" mysql.default_host = mysql.default_user = mysql.default_password = mysql.connect_timeout = 60 mysql.trace_mode = Off

[mSQL] msql.allow_persistent = On msql.max_persistent = -1 msql.max_links = -1

[PostgresSQL] pgsql.allow_persistent = On pgsql.auto_reset_persistent = Off pgsql.max_persistent = -1 pgsql.max_links = -1 pgsql.ignore_notice = 0 pgsql.log_notice = 0

[Sybase] sybase.allow_persistent = On sybase.max_persistent = -1 sybase.max_links = -1 sybase.min_error_severity = 10 sybase.min_message_severity = 10 sybase.compatability_mode = Off

[Sybase-CT] sybct.allow_persistent = On sybct.max_persistent = -1 sybct.max_links = -1 sybct.min_server_severity = 10 sybct.min_client_severity = 10

[dbx] dbx.colnames_case = "unchanged"

[bcmath] bcmath.scale = 0

[browscap]

[Informix] ifx.default_host = ifx.default_user = ifx.default_password = ifx.allow_persistent = On ifx.max_persistent = -1 ifx.max_links = -1 ifx.textasvarchar = 0 ifx.byteasvarchar = 0 ifx.charasvarchar = 0 ifx.blobinfile = 0 ifx.nullformat = 0

[Session] session.save_handler = files session.use_cookies = 1 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 100 session.gc_maxlifetime = 1440 session.bug_compat_42 = 1 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 0 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

session.save_path = /share/MD0_DATA/.php_session [MSSQL] mssql.allow_persistent = On mssql.max_persistent = -1 mssql.max_links = -1 mssql.min_error_severity = 10 mssql.min_message_severity = 10 mssql.compatability_mode = Off mssql.secure_connection = Off

[Assertion]

[Ingres II] ingres.allow_persistent = On ingres.max_persistent = -1 ingres.max_links = -1 ingres.default_database = ingres.default_user = ingres.default_password =

[Verisign Payflow Pro] pfpro.defaulthost = "test-payflow.verisign.com" pfpro.defaultport = 443 pfpro.defaulttimeout = 30

[com]

[Printer]

[mbstring]

[FrontBase]

[exif]

[eaccelerator] extension = eaccelerator.so eaccelerator.shm_size = 32 eaccelerator.cache_dir = /.eaccelerator.tmp eaccelerator.enable = 1 eaccelerator.optimizer = 1 eaccelerator.check_mtime = 1 eaccelerator.debug = 0 eaccelerator.filter = eaccelerator.shm_max = 1M eaccelerator.shm_ttl = 0 eaccelerator.shm_prune_period = 3600 eaccelerator.shm_only = 0 eaccelerator.compress = 1 eaccelerator.compress_level = 9

[Crack]

; End: [Imagick] extension = imagick.so


Reply to this email directly or view it on GitHub: https://github.com/owncloud/news/issues/319#issuecomment-22983852

icebrian commented 11 years ago

Hi there,

sorry for late reply. Yes am running PHP 5.3.14, I now tried with:

php_flag eaccelerator.enable 0

in .htaccess file and am pleased to report that news is now running as expected.

If you need anything else let me know.

Thanks

KolbenJoe commented 10 years ago

I have a similar one. My owncloud installation is running on a shared server featuring SSL only via SSL proxy. Owncloud enforces redirection to the SSL proxy.

So when I go to http://cloud.mydomain.com it is redirected to https://ssl-account.com/cloud.mydomain.com/index.php/apps/news/ (in the case, that news was the last application I was using). That's fine.

Nevertheless when my browser is closed for a longer time and I open it again the owncloud tab tries to redirect to https://ssl-account.com/index.php/apps/news/ which is wrong.

This is happening since I upgraded to owncloud 7.0.1 and I remember that this was different with owncloud 5. My rewrite rules were similar.

In .htaccess it is RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-FORWARDED-SERVER} !^ssl-account.com$ [NC] RewriteRule ^(.*)$ https://ssl-account.com/%{HTTP_HOST}/$1 [R=301,L]

in config.php it is [...] 'overwritehost' => 'ssl-account.com', 'overwriteprotocol' => 'https', 'overwritewebroot' => '/cloud.mydomain.com', 'overwritecondaddr' => '^85.13.128.137$',

As I see there is an update available to 7.0.2 I will try this one and report back...

BernhardPosselt commented 10 years ago

The redirect issue was fixed in 7.0.1, maybe your config is off

KolbenJoe commented 10 years ago

I am still having my problem with 7.0.2 it seems....