widget crashes when not logged in

Open Beginner friendly
#16,516 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
android, java, kotlin
Domain
mobile-dev

Research direction

Start in DashboardWidgetConfigurationActivity.kt at line 139, then inspect ClientFactoryImpl.java at line 51 and AccountUtils.getBaseUrlForAccount at line 72. Reproduce adding the 3x4 widget while logged out and verify the flow no longer crashes and matches the expected widget behavior on the homepage.

Written by the indexing model from the issue text.

Description

0. Needs triage bug feature: dashboard and widgets performance: ISE/IAE :confused:
⚠️ 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

Attempt to add the 3x4 widget to the homepage.

Expected behaviour

Widget on homepage

Actual behaviour

Crash with code dump

Cause of error
Exception in thread "DefaultDispatcher-worker-1" com.nextcloud.client.network.ClientFactory$CreationException: com.owncloud.android.lib.common.accounts.AccountUtils$AccountNotFoundException: Account not found
    at com.nextcloud.client.network.ClientFactoryImpl.createNextcloudClient(ClientFactoryImpl.java:51)
    at com.nextcloud.client.widget.DashboardWidgetConfigurationActivity$loadWidgets$1.invokeSuspend(DashboardWidgetConfigurationActivity.kt:139)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
Caused by: Exception in thread "DefaultDispatcher-worker-1" com.owncloud.android.lib.common.accounts.AccountUtils$AccountNotFoundException: Account not found
    at com.owncloud.android.lib.common.accounts.AccountUtils.getBaseUrlForAccount(AccountUtils.java:72)
    at com.owncloud.android.lib.common.OwnCloudClientFactory.createNextcloudClient(OwnCloudClientFactory.java:198)
    at com.owncloud.android.lib.common.OwnCloudClientFactory.createNextcloudClient(OwnCloudClientFactory.java:182)
    at com.nextcloud.client.network.ClientFactoryImpl.createNextcloudClient(ClientFactoryImpl.java:49)
    at com.nextcloud.client.widget.DashboardWidgetConfigurationActivity$loadWidgets$1.invokeSuspend(DashboardWidgetConfigurationActivity.kt:139)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)

App information
  • ID: com.nextcloud.client
  • Version: 30350290
  • Build flavor: generic
Device information
  • Brand: google
  • Device: akita
  • Model: Pixel 8a
  • Id: BP4A.260205.001
  • Product: akita
Firmware
  • SDK: 36
  • Release: 16
  • Incremental: 14624666
Android version

16

Device brand and model

pixel 8a

Stock or custom OS?

Stock

Nextcloud android app version

3.25.2

Nextcloud server version

latest

Using a reverse proxy?

I don't know

Android logs
Cause of error
Exception in thread "DefaultDispatcher-worker-1" com.nextcloud.client.network.ClientFactory$CreationException: com.owncloud.android.lib.common.accounts.AccountUtils$AccountNotFoundException: Account not found
    at com.nextcloud.client.network.ClientFactoryImpl.createNextcloudClient(ClientFactoryImpl.java:51)
    at com.nextcloud.client.widget.DashboardWidgetConfigurationActivity$loadWidgets$1.invokeSuspend(DashboardWidgetConfigurationActivity.kt:139)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
Caused by: Exception in thread "DefaultDispatcher-worker-1" com.owncloud.android.lib.common.accounts.AccountUtils$AccountNotFoundException: Account not found
    at com.owncloud.android.lib.common.accounts.AccountUtils.getBaseUrlForAccount(AccountUtils.java:72)
    at com.owncloud.android.lib.common.OwnCloudClientFactory.createNextcloudClient(OwnCloudClientFactory.java:198)
    at com.owncloud.android.lib.common.OwnCloudClientFactory.createNextcloudClient(OwnCloudClientFactory.java:182)
    at com.nextcloud.client.network.ClientFactoryImpl.createNextcloudClient(ClientFactoryImpl.java:49)
    at com.nextcloud.client.widget.DashboardWidgetConfigurationActivity$loadWidgets$1.invokeSuspend(DashboardWidgetConfigurationActivity.kt:139)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)

App information
  • ID: com.nextcloud.client
  • Version: 30350290
  • Build flavor: generic
Device information
  • Brand: google
  • Device: akita
  • Model: Pixel 8a
  • Id: BP4A.260205.001
  • Product: akita
Firmware
  • SDK: 36
  • Release: 16
  • Incremental: 14624666
Server error logs

Additional information

I am not logged into my server. I just wanted to see the widget appearance.

Dominant language
Kotlin
Stars
5.6k
Forks
2k
Avg merge
1d 21h
Merged PRs (30d)
101

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextcloud/android

All issues in nextcloud/android

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.