RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.24k stars 10.43k forks source link

6.1.2: Data Export not working #28911

Open m4z opened 1 year ago

m4z commented 1 year ago

Description:

After updating Rocket.Chat from 5.4.3. to 6.1.2, the links generated by (Avatar → "My Account" → "Preferences" → ) "My Data" point to empty web pages (according to Firefox' "Show Source") and don't begin any download. (We last successfully tested this after updating from 5.4.1 to 5.4.2 back in February.)

Steps to reproduce:

  1. Go to Avatar → "My Account" → "Preferences" → "My Data"
  2. Click on either "Export my data (JSON)" or "Download my data (HTML)"
  3. If a recent export exists, the link will be shown; if not, it will be e-mailed to you after a couple of minutes
  4. Click that link
  5. See that the resulting page (https://[your_rc_url]/data-export/[random_string]) is empty (according to "Show Source" in Firefox) / a minimal page with an empty body (according to "Inspect" in Firefox)—I haven't recently used those two features together in a similar scenario, so I don't know if that is the default behavior, see "Additional context" below.

Expected behavior:

A download of the zip file should begin.

Actual behavior:

We are using the default settings for that feature (empty paths in "Administration" → "Workspace" → "Settings" → "User Data Download" → "Open"). Those undocumented settings seem to write the files into /tmp/userData${random}/ and then create an archive from them in /tmp/zipFiles/. I don't know what happens next, because even with debug logging, the only thing in the logs is this:

{"level":35,"time":"2023-04-13T17:38:09.846Z","pid":25054,"hostname":"[my_hostname]","name":"Meteor","method":"getAvatarSuggestion","userId":"[my_userid]","userAgent":"Mozilla/5.0 […] Firefox/102.0","referer":"https://[my_rc_server.example]/account/profile","remoteIP":"[some_ip]","instanceId":"[my_instance_id]"}
{"level":40,"time":"2023-04-13T17:38:09.846Z","pid":25054,"hostname":"[my_hostname]","name":"DeprecationWarning","section":"METHOD","msg":"getAvatarSuggestion will be deprecated in future versions of Rocket.Chat"}
{"level":35,"time":"2023-04-13T17:38:11.431Z","pid":25054,"hostname":"[my_hostname]","name":"API","method":"GET","url":"/api/v1/users.getAvatarSuggestion","userId":"[my_userid]","userAgent":"Mozilla/5.0 […] Firefox/102.0","host":"[my_rc_server.example]","referer":"https://[my_rc_server.example]/account/profile","remoteIP":"[some_ip]","status":200,"responseTime":1593}
{"level":35,"time":"2023-04-13T17:38:13.136Z","pid":25054,"hostname":"[my_hostname]","name":"Meteor","method":"requestDataDownload","userId":"[my_userid]","userAgent":"Mozilla/5.0 […] Firefox/102.0","remoteIP":null,"instanceId":"[my_instance_id]"}
{"level":35,"time":"2023-04-13T17:38:25.715Z","pid":25054,"hostname":"[my_hostname]","name":"Meteor","method":"requestDataDownload","userId":"[my_userid]","userAgent":"Mozilla/5.0 […] Firefox/102.0","remoteIP":null,"instanceId":"[my_instance_id]"}
# me opening the Admin Workspace and seeing the "Go fully featured" nag screen
{"level":35,"time":"2023-04-13T17:38:36.024Z","pid":25054,"hostname":"[my_hostname]","name":"Meteor","method":"cloud:checkRegisterStatus","userId":"[my_userid]","userAgent":"Mozilla/5.0 […] Firefox/102.0","remoteIP":null,"instanceId":"[my_instance_id]"}

Server Setup Information:

Client Setup Information

Additional context

The server is behind a firewall (incoming and outgoing). The clients are using a VPN. Both are using proxies.

According to Firefox' Inspect, this is the contents of the download page (while show-source displays it as completely empty):

<html><head><link rel="stylesheet" href="resource://content-accessible/plaintext.css"><script src="moz-extension://48c3788a-b1ed-4211-89b8-dc999270c701/assets/prompt.js"></script></head><body><pre></pre></body></html>

Relevant logs:

Server log above.

Browser error log:

PushServiceWebSocket: beginWSSetup: Error opening websocket. asyncOpen failed 
Exception { name: "NS_ERROR_SOCKET_CREATE_FAILED", message: "Component returned failure code: 0x804b0034 (NS_ERROR_SOCKET_CREATE_FAILED) [nsIWebSocketChannel.asyncOpen]", result: 2152398900, filename: "resource://gre/modules/PushServiceWebSocket.jsm", lineNumber: 540, columnNumber: 0, data: null, stack: "_beginWSSetup@resource://gre/modules/PushServiceWebSocket.jsm:540:16\n_onTimerFired@resource://gre/modules/PushServiceWebSocket.jsm:182:12\nobserve@resource://gre/modules/PushServiceWebSocket.jsm:155:12\n", location: XPCWrappedNative_NoHelper }
​
columnNumber: 0
​
data: null
​
filename: "resource://gre/modules/PushServiceWebSocket.jsm"
​
lineNumber: 540
​
location: XPCWrappedNative_NoHelper { QueryInterface: QueryInterface(), filename: Getter, name: Getter, … }
​​
QueryInterface: function QueryInterface()
​​
asyncCaller: null
​​
asyncCause: null
​​
caller: XPCWrappedNative_NoHelper { QueryInterface: QueryInterface(), filename: , name: , … }
​​
columnNumber: 16
​​
filename: "resource://gre/modules/PushServiceWebSocket.jsm"
​​
formattedStack: "_beginWSSetup@resource://gre/modules/PushServiceWebSocket.jsm:540:16\n_onTimerFired@resource://gre/modules/PushServiceWebSocket.jsm:182:12\nobserve@resource://gre/modules/PushServiceWebSocket.jsm:155:12\n"
​​
lineNumber: 540
​​
name: "_beginWSSetup"
​​
nativeSavedFrame: SavedFrame { source: "resource://gre/modules/PushServiceWebSocket.jsm", sourceId: 789, line: 540, … }
​​
sourceId: 789
​​
sourceLine: ""
​​
toString: function toString()
​​
<get asyncCaller()>: function asyncCaller()
​​
<get asyncCause()>: function asyncCause()
​​
<get caller()>: function caller()
​​
<get columnNumber()>: function columnNumber()
​​
<get filename()>: function filename()
​​
<get formattedStack()>: function formattedStack()
​​
<get lineNumber()>: function lineNumber()
​​
<get name()>: function name()
​​
<get nativeSavedFrame()>: function nativeSavedFrame()
​​
<get sourceId()>: function sourceId()
​​
<get sourceLine()>: function sourceLine()
​​
<prototype>: Object { … }
​
message: "Component returned failure code: 0x804b0034 (NS_ERROR_SOCKET_CREATE_FAILED) [nsIWebSocketChannel.asyncOpen]"
​
name: "NS_ERROR_SOCKET_CREATE_FAILED"
​
result: 2152398900
​
stack: "_beginWSSetup@resource://gre/modules/PushServiceWebSocket.jsm:540:16\n_onTimerFired@resource://gre/modules/PushServiceWebSocket.jsm:182:12\nobserve@resource://gre/modules/PushServiceWebSocket.jsm:155:12\n"
​
<prototype>: ExceptionPrototype { toString: toString(), name: Getter, message: Getter, … }
​​
columnNumber: 
​​
data: 
​​
filename: 
​​
lineNumber: 
​​
location: 
​​
message: 
​​
name: 
​​
result: 
​​
stack: 
​​
toString: function toString()
​​
Symbol(Symbol.toStringTag): "Exception"
​​
<get columnNumber()>: function columnNumber()
​​
<get data()>: function data()
​​
<get filename()>: function filename()
​​
<get lineNumber()>: function lineNumber()
​​
<get location()>: function location()
​​
<get message()>: function message()
​​
<get name()>: function name()
​​
<get result()>: function result()
​​
<get stack()>: function stack()
​​
<set stack()>: function stack()
​​
<prototype>: Object { … }
PushServiceWebSocket.jsm:543
m4z commented 1 year ago

The problem persists with 6.1.6.

akamkomputer commented 1 year ago

I can only export my files once. How can i reset the timelimit(?) it to test it again?

Slug-V commented 1 year ago

causes 403 with 6.2.10(snap). In snap environment, generated archive is present in /tmp/snap-private-tmp/snap.rocketchat-server/tmp/ So it seems there is a permission issue in Meteor