Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error fetching URL Share to Share OC7 #13109

Closed
diablotin84 opened this issue Jan 5, 2015 · 11 comments
Closed

Error fetching URL Share to Share OC7 #13109

diablotin84 opened this issue Jan 5, 2015 · 11 comments
Labels

Comments

@diablotin84
Copy link

Hi,

I open this issue because i have this problem when i use share to share server owncloud:

In the log:

{"app":"PHP","message":"Cannot modify header information - headers already sent at /var/www/owncloud/lib/private/json.php#17","level":3,"time":"2015-01-05T11:06:54+00:00"}

Tks for return.

Sincerely,

@MorrisJobke
Copy link
Contributor

cc @schiesbn

@MorrisJobke
Copy link
Contributor

@diablotin84 Can you provide more information? Please use the https://github.com/owncloud/core/blob/master/issue_template.md to report issues

@DeepDiver1975
Copy link
Member

@jnfrmarks I assume there is a test plan for server-to-server sharing - can you please have a close look at the log files and watch out for errors like the one above?

Generally speaking any error with app: PHP shall be reported. Many thanks!

@diablotin84
Copy link
Author

@MorrisJobke thx for return

Steps to reproduce

In the files app, click on New and From link, paste URL share link from file to another Owncloud instance (ex: https://URLOWNCLOUD/public.php?service=files&t=9984faa15d8949414acc3cca7b8c531c) and obtain Error Fetching URL

Server configuration

Operating system: Debian 7.7

Web server: Apache/2.2.22

Database: MySQL 5.5.40

PHP version: PHP 5.4.36-0+deb7u1

ownCloud version: 7.0.4

Updated from an older ownCloud or fresh install: fresh install

List of activated apps: Activity, Calendar, Contacts, Deleted files, Documents, First Run Wizard, Full Text Search, Mail Template Editor, PDF Viewer, Pictures, Share Files, Text Editor, Updater, Versions, Video Viewer

The content of config/config.php:

Insert your config.php content here
(Without the database password, passwordsalt and secret)

'oc1b2273dc4b', 'passwordsalt' => 'MYPASSWORDSALT', 'secret' => 'MYSECRET', 'trusted_domains' => array ( 0 => 'IP', ), 'datadirectory' => '/var/www/owncloud/data', 'overwrite.cli.url' => 'http://IP/owncloud', 'dbtype' => 'mysql', 'version' => '7.0.4.2', 'dbname' => 'owncloud', 'dbhost' => 'localhost', 'dbtableprefix' => 'oc_', 'dbuser' => 'owncloud', 'dbpassword' => 'MYDBPWD', 'installed' => true, ); Are you using external storage, if yes which one: local Are you using encryption: no Client configuration Browser: Chrome Operating system: Debian Jessie Logs Web server error log Nothing Insert your webserver log here ownCloud log (data/owncloud.log) 2015-01-05T11:02:00+00:00"} {"app":"PHP","message":"Cannot modify header information - headers already sent at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"2015-01-05T11:02:03+00:00"} {"app":"PHP","message":"Cannot modify header information - headers already sent at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"2015-01-05T11:02:06+00:00"} {"app":"PHP","message":"Cannot modify header information - headers already sent at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"2015-01-05T11:02:09+00:00"} {"app":"PHP","message":"Cannot modify header information - headers already sent at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"2015-01-05T11:02:12+00:00"} {"app":"PHP","message":"Cannot modify header information - headers already sent at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"2015-01-05T11:02:15+00:00"} {"app":"PHP","message":"Cannot modify header information - headers already sent at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"2015-01-05T11:02:19+00:00"} {"app":"PHP","message":"Cannot modify header information - headers already sent at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"2015-01-05T11:02:22+00:00"} {"app":"PHP","message":"Cannot modify header information - headers already sent at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"2015-01-05T11:02:25+00:00"} {"app":"PHP","message":"Cannot modify header information - headers already sent at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"2015-01-05T11:02:28+00:00"} {"app":"PHP","message":"Cannot modify header information - headers already sent at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"2015-01-05T11:02:31+00:00"} {"app":"PHP","message":"Cannot modify header information - headers already sent at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"2015-01-05T11:03:33+00:00"}

@MorrisJobke
Copy link
Contributor

@diablotin84 So you used the URL from the public share page and not the download lunk provided by the input field below the file preview. Can you test this with the download URL (direct link)? Thanks

@diablotin84
Copy link
Author

I have click on Share and Share link, it's not right ?

@MorrisJobke
Copy link
Contributor

@diablotin84 On master this simply downloads a HTML page - the page that is shown if you browse that link. Then there is a direct link on that page. If you enter that one, the correct file is downloaded to your ownCloud. THis for for me here on master. No errors at all (for both links)

@diablotin84
Copy link
Author

@MorrisJobke OK thks for return, i have now a new error in my error log apache2

Invalid method in request quit

any idea ?

Sincerely

@PVince81
Copy link
Contributor

PVince81 commented Jan 9, 2015

Does the remote server have a valid SSL certificate ?

@boeserwolf
Copy link

Hi, i have the same issue when adding a URL from a remote ownCloud server, trying to create a server-to-server share:

"Error fetching URL"

The client fires an AJAX request:
https://[SERVER]/index.php/apps/files/ajax/newfile.php?dir=%2F&source=...&filename=public.php%3F...&requesttoken=...

The result is:
"Invalid name, '', '/', '<', '>', ':', '"', '|', '?' and '*' are not allowed."

apps/files/ajax/newfile.php, line 68:
if(!OCP\Util::isValidFileName($filename)) {
$result['data'] = array('message' => (string)$l10n->t("Invalid name, '', '/', '<', '>', ':', '"', '|', '?' and '*' are not allowed."));
OCP\JSON::error($result);
exit();

It seems like the GET variable "filename" is checked for containing illegal characters. But it's set to the URL of the shared resource, so isValidFileName checks against "index.php?...", and fails for the "?".

Hope that helps to fix the problem.

@PVince81
Copy link
Contributor

PVince81 commented Mar 3, 2015

Please don't use "Add from URL" to add remote shares. You should open the link directly and then click "Add to ownCloud" instead.

Also the feature "Add from URL" has been removed as per #14652 (many security issues)

@PVince81 PVince81 closed this as completed Mar 3, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants