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

HEAD request from SSO-authorized client app leads to Nextcloud app crash #12186

Open
4 tasks done
0xf104a opened this issue Nov 18, 2023 · 0 comments
Open
4 tasks done
Labels
bug developer experience feature: authentication Authentication or accounts related integration performance: NPE 🚫 NullPointerException / Null Pointer Exception stable-3.26

Comments

@0xf104a
Copy link

0xf104a commented Nov 18, 2023

⚠️ Before posting ⚠️

  • This is a bug, not a question or an enhancement.
  • I've searched for similar issues and didn't find a duplicate.
  • I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

The following code which executed in client application leads to Nextcloud app crash when called

@Override
  public boolean checkNewNotifications() throws Exception {
      NextcloudRequest request = new NextcloudRequest.Builder().setMethod("HEAD")
              .setUrl(Uri.encode("/ocs/v2.php/apps/notifications/api/v2/notifications", "/"))
              .build();
      Response response = API.performNetworkRequestV2(request);
      String lastEtag = Objects.requireNonNull(response.getPlainHeader("ETag")).getValue();
      Log.d(TAG, "lastETag=" + lastEtag);
      Log.d(TAG, "mETag=" + mETag);
      if(!lastEtag.equals(mETag)){
          Log.d(TAG, "New notifications found");
          mETag = lastEtag;
          return true;
      }
      return false;
  }

See the code here
Note that changing request method to GET fixes error, though makes such requests energy-inefficient

Expected behaviour

The HEAD request should properly work without throwing exception and/or crashing Nextcloud app

Actual behaviour

The Nextcloud app crashes showing the following report

Exception in thread "ParcelFileDescriptor Transfer Thread" java.lang.NullPointerException
    at java.io.SequenceInputStream.nextStream(SequenceInputStream.java:112)
    at java.io.SequenceInputStream.read(SequenceInputStream.java:211)
    at java.io.InputStream.read(InputStream.java:205)
    at com.nextcloud.android.sso.aidl.ParcelFileDescriptorUtil$TransferThread.run(ParcelFileDescriptorUtil.java:76)

App information

ID: com.nextcloud.client

Version: 30260090

Build flavor: generic

Device information

Brand: OnePlus

Device: OnePlus7TProNR

Model: HD1925

Id: TQ3A.230901.001

Product: OnePlus7TProNR

Firmware

SDK: 33

Release: 13

Incremental: PolarMod-1.3-r1-hotdogg-20231016_145036-user

Android version

13

Device brand and model

OnePlus 7T Pro 5G(hotdogg)

Stock or custom OS?

Custom

Nextcloud android app version

3.26.0(F-Droid)

Nextcloud server version

27.1.3

Using a reverse proxy?

Yes

Android logs

crash.log

Server error logs

[Sat Nov 18 19:28:20.147789 2023] [core:error] [pid 27955:tid 140288571983552] [client 100.64.22.27:53598] AH00082: an unknown filter was not added: Deflate
[Sat Nov 18 19:28:20.367436 2023] [mpm_worker:error] [pid 25117:tid 140289272453184] AH00288: scoreboard is full, not at MaxRequestWorkers
[Sat Nov 18 19:28:20.445802 2023] [core:error] [pid 27675:tid 140287053657792] [client 100.64.22.27:53610] AH00082: an unknown filter was not added: Deflate
[Sat Nov 18 19:28:20.694604 2023] [core:error] [pid 27990:tid 140288991422144] [client 100.64.22.27:53612] AH00082: an unknown filter was not added: Deflate
[Sat Nov 18 19:28:21.068449 2023] [core:error] [pid 28025:tid 140289108854464] [client 100.64.22.27:53614] AH00082: an unknown filter was not added: Deflate
[Sat Nov 18 19:28:21.368670 2023] [mpm_worker:error] [pid 25117:tid 140289272453184] AH00288: scoreboard is full, not at MaxRequestWorkers
[Sat Nov 18 19:28:21.380971 2023] [core:error] [pid 28026:tid 140287993181888] [client 100.64.22.27:53618] AH00082: an unknown filter was not added: Deflate
[Sat Nov 18 19:28:21.814248 2023] [core:error] [pid 28094:tid 140287649244864] [client 100.64.22.27:53628] AH00082: an unknown filter was not added: Deflate
[Sat Nov 18 19:28:22.369872 2023] [mpm_worker:error] [pid 25117:tid 140289272453184] AH00288: scoreboard is full, not at MaxRequestWorkers
[Sat Nov 18 19:28:22.550135 2023] [core:error] [pid 28095:tid 140288253224640] [client 100.64.22.27:58026] AH00082: an unknown filter was not added: Deflate
[Sat Nov 18 19:28:23.371402 2023] [mpm_worker:error] [pid 25117:tid 140289272453184] AH00288: scoreboard is full, not at MaxRequestWorkers
[Sat Nov 18 19:28:24.372663 2023] [mpm_worker:error] [pid 25117:tid 140289272453184] AH00288: scoreboard is full, not at MaxRequestWorkers
[Sat Nov 18 19:28:25.373901 2023] [mpm_worker:error] [pid 25117:tid 140289272453184] AH00288: scoreboard is full, not at MaxRequestWorkers
[Sat Nov 18 19:28:26.379545 2023] [mpm_worker:error] [pid 25117:tid 140289272453184] AH00288: scoreboard is full, not at MaxRequestWorkers
[Sat Nov 18 19:28:27.380740 2023] [mpm_worker:error] [pid 25117:tid 140289272453184] AH00288: scoreboard is full, not at MaxRequestWorkers
[Sat Nov 18 19:28:28.381905 2023] [mpm_worker:error] [pid 25117:tid 140289272453184] AH00288: scoreboard is full, not at MaxRequestWorkers
[Sat Nov 18 19:28:28.855174 2023] [core:error] [pid 27710:tid 140288949458624] [client 100.64.22.1:60208] AH00082: an unknown filter was not added: Deflate
[Sat Nov 18 19:28:29.383183 2023] [mpm_worker:error] [pid 25117:tid 140289272453184] AH00288: scoreboard is full, not at MaxRequestWorkers
[Sat Nov 18 19:28:29.866286 2023] [core:error] [pid 28096:tid 140287540172480] [client 100.64.22.1:42815] AH00082: an unknown filter was not added: Deflate

Additional information

  • The ROM in use is PolarMod which is slightly customized LinageOS(hardened malloc, minor UI customizations and bootloader lock support)
  • Logs are partially provided due to private information stored in them
  • HEAD requests seem to work without SSO
  • Server logs are in EET time, device logs are in CEST time
  • The issue with more detailed logs from side of application is opened in repository of my application
@0xf104a 0xf104a added the bug label Nov 18, 2023
@joshtrichards joshtrichards added the performance: NPE 🚫 NullPointerException / Null Pointer Exception label Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug developer experience feature: authentication Authentication or accounts related integration performance: NPE 🚫 NullPointerException / Null Pointer Exception stable-3.26
Projects
None yet
Development

No branches or pull requests

2 participants