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

Problem with GuzzleHttp #11278

Closed
olegbolden opened this issue Sep 19, 2018 · 12 comments
Closed

Problem with GuzzleHttp #11278

olegbolden opened this issue Sep 19, 2018 · 12 comments
Labels

Comments

@olegbolden
Copy link

olegbolden commented Sep 19, 2018

Can not open file with Collabora Office (local docker installation)
Collabora online application version is 2.0.13 (richdocuments)

Expected behaviour

Office format file is opened within Nextcloud window

Actual behaviour

In case WOPI server field is blank in the settings of the Collabora online (fresh install of this app) we have
Fatal error: Cannot declare class GuzzleHttp\Handler\CurlFactory, because the name is already in use in /var/www/.../3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 16

In case WOPI server field is filled in:
Fatal error: Cannot declare class GuzzleHttp\Exception\RequestException, because the name is already in use in /var/www/.../3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php on line 0

I suspect that there is no proper connection between nextcloud and Collabora Office in docker container and this causes the last Error.

Operating system:
Linux Debian Jessie

Web server:
Nginx+PHP-FPM

Database:
MySQL

PHP version:
7.1.20

Nextcloud version:
14.0

Updated from an older Nextcloud/ownCloud or fresh install:
Updated from 13.6

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #9152 (Problem renaming folders), #9356 (problem with updater ), #4908 (Problem upgrading NextCloud), #11133 (Fix exception class), and #11197 (Problems with "digital" usernames).

@olegbolden olegbolden changed the title Problem with GuzzleHttp\Handler\CurlFactory class Problem with GuzzleHttp Sep 20, 2018
@olegbolden
Copy link
Author

I found the origin of the problem.
You need to specifiy IP-address of collabora online server explicitly in nginx ssl section like this:

listen xxx.xxx.xxx.xxx 443 ssl;

In most internet instructions with nginx reverse proxy settings including collabora this listen directive is specified as

listen 443 ssl;

The second error (Cannot declare class GuzzleHttp\Exception\RequestException) appears due to invalid sertificate if IP is not specified.
Our webserver and nextcloud installation run in LXC Proxmox container with ISPmanager panel. Hope this info helps those who works in the same environment.

Nonetheless I think that the above errors should be properly processed to help nextcloud administrators in Collabora online installation rather then go in blind.

@fullmetalrooster
Copy link

Having the same issue all day long I finally found out that my self-signed certificate was the problem. While my Browser knows the full chain of a letsencrypt certificate the internal curl function of nextcloud does not. Copying the fullchain certificate to my nginx-container solved the Problem.

@joshp23
Copy link

joshp23 commented Oct 19, 2018

Having this issue with Nextcloud 14.0.3 updated from 13, Collabora Online (richdocuments) 3.0.1, Ubuntu 16.04, PHP 7.0, Apache. Collabora itself was installed via repo and was working fine before Nextcloud upgrade.

Using Letsencrypt certs, declaring ip (not *) in Listen directive and VirtualHost conf.
Error:
PHP Fatal error: Cannot declare class GuzzleHttp\\Exception\\RequestException, because the name is already in use in /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php on line 0

If I set the Collabora url in admin settings to https://127.0.0.1:9980 instead of https://example.com the error becomes:

Cannot declare class GuzzleHttp\\Handler\\CurlFactory, because the name is already in use in /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 16


UPDATE

Solved! it was an expired certificate for the loolwsd server. Going to update the settings in loolwsd server instead of the hack I did when I set it up ;) Hope this helps someone in a similar spot.

@kesselb
Copy link
Contributor

kesselb commented Oct 24, 2018

Thank you for reporting back 👍

@plepps
Copy link

plepps commented Nov 14, 2018

I had the same issue - in my case it was because my NC was not a native subdomain. "https://server.foo.bar/nc"
I changed NC to run on this URL "https://nc.foo.bar" and start a new collabbora docker with this new domain and it works perfectly now!

@joshp23
Copy link

joshp23 commented Dec 26, 2018

this came back after updating to collabora 6.0.0 from repo while using collabora NC app v 3.1.0 in NC 14.0.4
All certificates / settings are appropriate and up to date

@jodoe
Copy link

jodoe commented Dec 28, 2018

@joshp23 - I have exactly the same problem since updating from the repo, I had a perfectly working NC14 install until then. Did you manage to resolve yours?

this came back after updating to collabora 6.0.0 from repo while using collabora NC app v 3.1.0 in NC 14.0.4
All certificates / settings are appropriate and up to date

@joshp23
Copy link

joshp23 commented Dec 29, 2018

@jodoe I snooped about here paying attention to step 4, and here paying attention to option 2.

Therefore, to get it working I updated the config script at /etc/loolwsd/loolwsd.xml to contain new options in 6.0 update, then set net.listen=loopback for security reasons as I then set ssl.enable=false, and ssl.termination=true. I made sure that the reverse proxy in Nginx is calling plain all addresses such as http://localhost:9980; and so forth. Restarted loolwsd and it worked for me!

@jodoe
Copy link

jodoe commented Dec 30, 2018

@joshp23 thanks for the reply, it ended up being the lo_template_path, it wasn't pointing at collaboraoffice6.0, as it was still using the old config file, it was pointing at collaboraoffice5.3. I changed this and everything's working again :)

@joshp23
Copy link

joshp23 commented Dec 31, 2018

@jodoe right on. Glad you mentioned that point. That was the first option that I u reset as well, only it did not result in a functional environment, which happened only after I completed the above steps.

Glad that you got things working.

@apiraino
Copy link

In my case the problem was a misconfiguration of the Collabora virtualhost. The error Cannot declare class GuzzleHttp\Handler\CurlFactory was pretty obscure but I've found better clues on the nextcloud.log file.

(hth)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants