frappe / nextcloud-integration

Frappe App for NextCloud Integration
MIT License
48 stars 58 forks source link

Backup Upload Failed #20

Open knudeh opened 3 years ago

knudeh commented 3 years ago

Output of bench version

erpnext 13.x.x-develop
frappe 13.x.x-develop
nextcloud_integration 0.0.1

Steps to reproduce the issue

  1. Install according to Readme
  2. set settings, save
  3. backup now

Observed result

Got an Email to "Send Notifications To" with back log, see below. There are no files uploaded/backed up.

Expected result

Successful backup

Stacktrace / full error message

Error message: Traceback (most recent call last): 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 670, in urlopen httplib_response = self._make_request( 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 426, in _make_request six.raise_from(e, None) 
 File "", line 3, in raise_from 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 421, in _make_request httplib_response = conn.getresponse() 
 File "/usr/lib/python3.9/http/client.py", line 1347, in getresponse response.begin() 
 File "/usr/lib/python3.9/http/client.py", line 307, in begin version, status, reason = self._read_status() 
 File "/usr/lib/python3.9/http/client.py", line 268, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") 
 File "/usr/lib/python3.9/socket.py", line 704, in readinto return self._sock.recv_into(b) 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/urllib3/contrib/pyopenssl.py", line 318, in recv_into raise SocketError(str(e)) OSError: (104, 'ECONNRESET') During handling of the above exception, another exception occurred: Traceback (most recent call last): 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 724, in urlopen retries = retries.increment( 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/urllib3/util/retry.py", line 403, in increment raise six.reraise(type(error), error, _stacktrace) 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/urllib3/packages/six.py", line 734, in reraise raise value.with_traceback(tb) 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 670, in urlopen httplib_response = self._make_request( 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 426, in _make_request six.raise_from(e, None) 
 File "", line 3, in raise_from 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 421, in _make_request httplib_response = conn.getresponse() 
 File "/usr/lib/python3.9/http/client.py", line 1347, in getresponse response.begin() 
 File "/usr/lib/python3.9/http/client.py", line 307, in begin version, status, reason = self._read_status() 
 File "/usr/lib/python3.9/http/client.py", line 268, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") 
 File "/usr/lib/python3.9/socket.py", line 704, in readinto return self._sock.recv_into(b) 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/urllib3/contrib/pyopenssl.py", line 318, in recv_into raise SocketError(str(e)) urllib3.exceptions.ProtocolError: ('Connection aborted.', OSError("(104, 'ECONNRESET')")) During handling of the above exception, another exception occurred: Traceback (most recent call last): 
 File "/home/erpnext/erpnext-test/apps/nextcloud_integration/nextcloud_integration/nextcloud_integration/doctype/nextcloud_setting/nextcloud_setting.py", line 26, in start_taking_backup self.backup_to_nextcloud(upload_db_backup) 
 File "/home/erpnext/erpnext-test/apps/nextcloud_integration/nextcloud_integration/nextcloud_integration/doctype/nextcloud_setting/nextcloud_setting.py", line 58, in backup_to_nextcloud self.check_for_upload_folder() 
 File "/home/erpnext/erpnext-test/apps/nextcloud_integration/nextcloud_integration/nextcloud_integration/doctype/nextcloud_setting/nextcloud_setting.py", line 135, in check_for_upload_folder response = self.session.request("PROPFIND", self.upload_path, headers={"Depth": "0"}, allow_redirects=False) 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/requests/sessions.py", line 530, in request resp = self.send(prep, **send_kwargs) 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/requests/sessions.py", line 643, in send r = adapter.send(request, **kwargs) 
 File "/home/erpnext/erpnext-test/env/lib/python3.9/site-packages/requests/adapters.py", line 498, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', OSError("(104, 'ECONNRESET')"))

Might be related: https://stackoverflow.com/questions/43165341/python3-requests-connectionerror-connection-aborted-oserror104-econnr

wojosc commented 3 years ago

@knudeh I just ran this on v12 and it works. I will try it on v13 soon and let you know if I had a similar problem.

markusrock commented 3 years ago

It's also not working here.

Output of bench version

ERPNext: v13.0.2 (version-13)
Frappe Framework: v13.0.3 (version-13)
Nextcloud Integration: v0.0.1 (HEAD)

Stacktrace / full error message

Error message: ./xxxx.frappe.cloud/private/backups/20210422_121022-xxxx_frappe_cloud-database.sql.gz - Failed while uploading Site Config ./xxxx.frappe.cloud/private/backups/20210422_121022-werock1_frappe_cloud-site_config_backup.json - Failed while uploading DB Traceback (most recent call last): File "/home/frappe/frappe-bench/apps/nextcloud_integration/nextcloud_integration/nextcloud_integration/doctype/nextcloud_setting/nextcloud_setting.py", line 28, in start_taking_backup raise Exception Exception 

Additional information

Installed via Frappcloud

knudeh commented 3 years ago

Follow-up:

frappe/frappe/utils/init.py 310 def execute_in_shell(cmd, verbose=0, low_priority=False):

aditsanghvi commented 2 years ago

any updates??

thejoe8495 commented 2 years ago

I repaired the nextcloud long time ago for my version 13 installation, can you try my version?

https://github.com/thejoe8495/nextcloud-integration