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

owncloudcmd ignores --httpproxy #6281

Closed
tsteub opened this issue Jan 4, 2018 · 18 comments
Closed

owncloudcmd ignores --httpproxy #6281

tsteub opened this issue Jan 4, 2018 · 18 comments
Assignees
Labels
ReadyToTest QA, please validate the fix/enhancement type:bug
Milestone

Comments

@tsteub
Copy link

tsteub commented Jan 4, 2018

Expected behaviour

Connection to owncloud server should use proxy

Actual behaviour

Proxy argument --httpproxy is ignored.
owncloudcmd tries to contact server directly.

Steps to reproduce

  1. Call owncloudcmd -n --httpproxy http://proxy:port /localdir https://server.example.com/owncloud

Server configuration

Does not matter in this case.

Client configuration

Client version: 2.4.0

Operating system: Ubuntu 16.04

OS language: English

Qt version used by client package (Linux only, see also Settings dialog): 5.6.2

Client package (From ownCloud or distro) (Linux only): from owncloud

Installation path of client:
/usr/bin/owncloudcmd symbolic link to /opt/ownCloud/ownCloud/bin/owncloudcmd

Logs

  1. Client logfile: Output of owncloud --logwindow or owncloud --logfile log.txt
    01-04 16:03:56:846 [ info sync.accessmanager ]: 2 "" "https://www.tomas-teubner.de/owncloud/ocs/v1.php/cloud/capabilities?format=json" has X-Request-ID "c260c1ec-ac9f-4295-91ac-f1c07ecc2476"
    01-04 16:03:56:846 [ debug sync.cookiejar ] [ OCC::CookieJar::cookiesForUrl ]: QUrl("https://www.tomas-teubner.de/owncloud/ocs/v1.php/cloud/capabilities?format=json") requests: ()
    01-04 16:03:56:847 [ info sync.networkjob ]: OCC::JsonApiJob created for "https://www.tomas-teubner.de/owncloud" + "ocs/v1.php/cloud/capabilities" ""
    01-04 16:04:23:537 [ warning sync.networkjob ]: Network job timeout QUrl("https://www.tomas-teubner.de/owncloud/ocs/v1.php/cloud/capabilities?format=json")
    01-04 16:04:23:537 [ warning sync.networkjob ]: QNetworkReply::NetworkError(OperationCanceledError) "Connection timed out" QVariant(Invalid)
    01-04 16:04:23:537 [ info sync.networkjob.jsonapi ]: JsonApiJob of QUrl("https://www.tomas-teubner.de/owncloud/ocs/v1.php/cloud/capabilities?format=json") FINISHED WITH STATUS QNetworkReply::NetworkError(OperationCanceledError) "Connection timed out"
    01-04 16:04:23:537 [ warning sync.networkjob.jsonapi ]: Network error: "ocs/v1.php/cloud/capabilities" "Connection timed out" QVariant(Invalid)
    01-04 16:04:23:537 [ debug default ] [ main(int, char**)::<lambda ]: Server capabilities QJsonObject()
    01-04 16:04:23:537 [ debug sync.networkjob ] [ OCC::AbstractNetworkJob::slotFinished ]: Network job OCC::JsonApiJob finished for "ocs/v1.php/cloud/capabilities"
    Error connecting to server

  2. Web server error log:
    n/a

  3. Server logfile: ownCloud log (data/owncloud.log):
    n/a

@ckamm
Copy link
Contributor

ckamm commented Jan 5, 2018

@tsteub Did your proxy option have the form --httpproxy http://host:port - there is no error message if the proxy can't be read (I'll fix that) and the "http://" is mandatory for example. Also, localhost connections don't use the proxy: that's a decision inside Qt unfortunately.

ckamm added a commit that referenced this issue Jan 5, 2018
In particular before the capability call.

Also warn if no proxy is set because the command line doesn't follow the
strict format requirements.
@ckamm
Copy link
Contributor

ckamm commented Jan 5, 2018

I've also found a small bug where the very first call was done before the proxy was set up. This might have caused your issue.

@ckamm ckamm self-assigned this Jan 5, 2018
@ckamm ckamm added type:bug ReadyToTest QA, please validate the fix/enhancement labels Jan 5, 2018
@ckamm ckamm modified the milestones: 2.5.0, 2.4.1 Jan 5, 2018
ckamm added a commit that referenced this issue Jan 5, 2018
In particular before the capability call.

Also warn if no proxy is set because the command line doesn't follow the
strict format requirements.

(cherry picked from commit d0e7f61)
@tsteub
Copy link
Author

tsteub commented Jan 6, 2018

Yes, the proxy is specified in the correct format: http://proxy.tomas.local:3128
The owncloud server used is not within my private network.
After starting owncloudcmd netstat shows a "SYN_SENT" to port 443 of that server which is blocked by my firewall.

@ckamm
Copy link
Contributor

ckamm commented Jan 8, 2018

@tsteub If you like you could try the nightly 2.4.1 from https://build.opensuse.org/package/show/isv:ownCloud:community:nightly/owncloud-client which should have my patch.

@tsteub
Copy link
Author

tsteub commented Jan 8, 2018

@ckamm : 2.4.1 nightly build works perfectly. Thank you.

@tsteub tsteub closed this as completed Jan 8, 2018
@mariolanno
Copy link

Sorry,

I have the same problem...
I put this command:

owncloudcmd --httpproxy 'http://domain\user@password:proxy.domain.priv:8083' --trust -u USER -p PASS /root/.owncloud/ https://owncloud.domain.com

And the output is:

FINISHED WITH STATUS QNetworkReply::NetworkError(OperationCanceledError) "Connection timed out"

What's wrong?

Thanks

Mario

@SamuAlfageme
Copy link
Contributor

Hey @mariolanno; are you using 2.4.1 nightly from https://build.opensuse.org/package/show/isv:ownCloud:community:nightly/owncloud-client? Check with owncloudcmd --version and upgrade your client version if needed.

Thanks!

@mariolanno
Copy link

[root@machine ~]# owncloudcmd --version
ownCloud version 2.4.0 (build 8911)
Git revision 9a1f736
Using Qt 5.6.2, built against Qt 5.6.2
Using 'OpenSSL 1.0.1e-fips 11 Feb 2013'

@SamuAlfageme
Copy link
Contributor

SamuAlfageme commented Jan 16, 2018

@mariolanno here: https://software.opensuse.org/download.html?project=isv:ownCloud:community:nightly&package=owncloud-client are the install instructions in case you need them; e.g. for Ubuntu 16.04:

$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community:/nightly/Ubuntu_16.04/ /' > /etc/apt/sources.list.d/owncloud-client.list"
$ sudo apt-get update
$ sudo apt-get upgrade owncloud-client

@mariolanno
Copy link

I have RHEL 6.7

Thanks

@mariolanno
Copy link

$ cd /etc/yum.repos.d
$ wget https://download.opensuse.org/repositories/isv:/ownCloud:/community:/nightly/CentOS_6/isv:ownCloud:community:nightly.repo

$ yum upgrade owncloud-client

Right?

@mariolanno
Copy link

I cannot test it now.
You can confirm that this upgrade resolves the problem and that command works fine?

Thanks

Mario

@mariolanno
Copy link

I upgraded it but the following error occurred

01-16 17:30:12:271 [ fatal default ]: Could not read httpproxy. The proxy should have the format "http://hostname:port".
Aborted (core dumped)

@SamuAlfageme
Copy link
Contributor

SamuAlfageme commented Jan 16, 2018

@mariolanno by reading your previous comment, there might be a problem with your proxy hostname: http://domain\user@password:proxy.domain.priv:8083' . Is it correct? The \ might be behind the crash.

@mariolanno
Copy link

the proxy address is correct, infact I put this when I set handly
export https_proxy='http://domain\user:[email protected]:8083'

OwnCloud would the format in:

http://domain\user@password:proxy.domain.priv:8083

@mariolanno
Copy link

mariolanno commented Jan 17, 2018

Hi,
I solved in other method, but I cannot understand how I can upload only files located in a specific dir.
For example, I would upload all files located in /opt/own

If I put the following command

owncloudcmd --trust -u username -p password /opt/ownc https://myowncloud.domain/owncloud

I download all content from owncloud, how can I upload files located under /opt/own ?

Thanks

Mario

@SamuAlfageme
Copy link
Contributor

@mariolanno Neat! was it an issue with the proxy address in the end?

how I can upload only

owncloudcmd is a syncing client, that's why it works in both directions. For upload-only behavior I can suggest using cadaver. If you have further questions you can reach us in https://central.owncloud.org/.

Thanks!

@mariolanno
Copy link

Thanks Samuel,

I tested in webdav and works fine.
Thanks for you suggestion, I will try cadaver.

Thanks a lot

Mario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ReadyToTest QA, please validate the fix/enhancement type:bug
Projects
None yet
Development

No branches or pull requests

4 participants