taky icon indicating copy to clipboard operation
taky copied to clipboard

DP Server throws error for multi user send

Open skadakar opened this issue 3 years ago • 1 comments

While I'm not quite sure why this is an issue, the scenario described is a user trying to send a datapackage to multiple users at once. As you can see there is a local IP in the __serverdestination that could possibly create issues. This has to be replicated to be understood I think.

Sending to individual users or uploading to the server appears to have worked fine as a workaround.

DP Server error:

[2022-08-17 16:18:10 +0000] [28] [DEBUG] GET /Marti/sync/content
ERROR:taky.dps:Exception on /Marti/sync/content [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/local/lib/python3.8/dist-packages/taky/dps/views/datapackage.py", line 102, in datapackage_get
    return send_file(name, as_attachment=True, attachment_filename=meta["Name"])
TypeError: send_file() got an unexpected keyword argument 'attachment_filename'

COT for DL:

<event version="2.0" uid="GeoChat.ANDROID-6c73d4d6dd34a614.5c5528af-fef9-4aad-900f-0197ec63acdc.1e5be732-50ca-4a58-acda-644c5a34f6ce" type="b-t-f" how="h-g-i-g-o" time="2022-08-17T16:17:22.329Z" start="2022-08-17T16:17:22.329Z" stale="2022-08-18T16:17:22.329Z">
  <point lat="XX.135672" lon="XX.956435" hae="120.9" ce="2.6" le="9999999.0"/>
  <detail>
    <__chat parent="UserGroups" groupOwner="true" messageId="e9f8f548-690a-41ea-85d1-54b946b1759e" chatroom="boys" id="5c5528af-fef9-4aad-900f-0197ec63acdc" senderCallsign="GE1">
      <chatgrp uid0="ANDROID-6c73d4d6dd34a614" uid1="ANDROID-e06e12b8b00ccd94" id="5c5528af-fef9-4aad-900f-0197ec63acdc"/>
      <hierarchy>
        <group uid="UserGroups" name="Groups">
          <group uid="5c5528af-fef9-4aad-900f-0197ec63acdc" name="boys">
            <contact uid="ANDROID-6c73d4d6dd34a614" name="GE1"/>
            <contact uid="ANDROID-e06e12b8b00ccd94" name="GE2"/>
          </group>
        </group>
      </hierarchy>
    </__chat>
    <link uid="ANDROID-6c73d4d6dd34a614" type="a-f-G-U-C" relation="p-p"/>
    <__serverdestination destinations="192.168.50.181:4242:tcp:ANDROID-6c73d4d6dd34a614"/>
    <remarks source="BAO.F.ATAK.ANDROID-6c73d4d6dd34a614" time="2022-08-17T16:17:22.329Z">[UPDATED CONTACTS]</remarks>
    <marti>
      <dest callsign="GE2"/>
    </marti>
  </detail>
</event>

Download error:

<event version="2.0" uid="ANDROID-e06e12b8b00ccd94" type="b-f-t-a" how="m-g" time="2022-08-17T16:19:34.315Z" start="2022-08-17T16:19:34.315Z" stale="2022-08-17T16:19:44.315Z">
  <point lat="XX.408850" lon="XX.694212" hae="121.4" ce="4.0" le="nan"/>
  <detail>
    <ackresponse uid="4fe80305-072a-4c92-b4f0-1223b1499fb0" senderUid="ANDROID-e06e12b8b00ccd94" success="false" tag="DP-leroen" reason="Unable to download" sha256="344c5eb4dd79b952b0f02a707be9655e9ccd3ab91da54162779b54683ac230e4" sizeInBytes="88680202"/>
    <marti>
      <dest callsign="GE1"/>
    </marti>
  </detail>
</event>

skadakar avatar Aug 17 '22 19:08 skadakar

I suspect this is because Flask changed the arguments in 2.x. Until I can do a proper merge, I've pinned Flask to 1.1.x in c12c189

tkuester avatar Sep 10 '22 15:09 tkuester

User reports this works now! Closing the issue!

tkuester avatar Feb 05 '23 00:02 tkuester

This works as expected in the routing-marti-uid branch. Possibly in earlier as well.

skadakar avatar Feb 05 '23 00:02 skadakar