Add attachement to card on Android fails if the `files_sharing` app is disabled
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 354
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 43
Description
dear deck developers,
i want to try your deck application on android and for that i want to upload an attachment on a card.
But this ends up in an error:
Error in Android:
`App Version: 1.24.1
App Version Code: 1024001
App Flavor: play
Files App Version Code: 30290090 (PROD)
OS Version: 4.19.87-27102101(G980FXXSKHXEA)
OS API Level: 33
Device: x1s
Manufacturer: samsung
Model (and Product): SM-G980F (x1seea)
it.niedermann.nextcloud.deck.exceptions.UploadAttachmentFailedException: 1 attachments failed to upload:App Version: 1.24.1
App Version Code: 1024001
App Flavor: play
Files App Version Code: 30290090 (PROD)
OS Version: 4.19.87-27102101(G980FXXSKHXEA)
OS API Level: 33
Device: x1s
Manufacturer: samsung
Model (and Product): SM-G980F (x1seea)
com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException: HTTP-Anfrage ist fehlgeschlagen mit HTTP-Statuscode: 500
at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onResponse(RequestHelper.java:70)
at com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$enqueue$0(Retrofit2Helper.java:87)
at com.nextcloud.android.sso.helper.Retrofit2Helper$1.$r8$lambda$n0izO5V3AflskH7z1H8dSLmVKXo(Unknown Source:0)
at com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda0.run(Unknown Source:6)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.RuntimeException: HTTP StatusCode wasn't 2xx:
Got [HTTP 500] for Call [GET http://localhost//index.php/apps/deck/api/v1.0/boards/1/stacks/1/cards/7/attachments] with Message:
[{"status":500,"message":"Internal server error: Please contact the server administrator if this error reappears multiple times, please include the request ID "mEv5QMohIS7TN3sdmCYj" below in your report.","requestId":"mEv5QMohIS7TN3sdmCYj"}
]
at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.buildCause(RequestHelper.java:87)
... 5 more
at it.niedermann.nextcloud.deck.ui.sharetarget.ShareProgressDialogFragment.lambda$onActivityCreated$1(ShareProgressDialogFragment.java:75)
at it.niedermann.nextcloud.deck.ui.sharetarget.ShareProgressDialogFragment.$r8$lambda$HW88O9MCTf-dRNubHlMyYQodRrU(Unknown Source:0)
at it.niedermann.nextcloud.deck.ui.sharetarget.ShareProgressDialogFragment$$ExternalSyntheticLambda0.onClick(Unknown Source:6)
at android.view.View.performClick(View.java:7892)
at android.widget.TextView.performClick(TextView.java:16220)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1218)
at android.view.View.performClickInternal(View.java:7869)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:30891)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8762)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)`
Error on server side:
POST","url":"/nextcloud/index.php/apps/deck/api/v1.0/boards/1/stacks/1/cards/7/attachments?",
"message":"Exception thrown: Exception","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.29.0","version":"29.0.2.2",
"exception":{"Exception":"Exception",
"Message":"Class \"OCA\\Files_Sharing\\AppInfo\\Application\" not found in file '/var/www/nextcloud/lib/private/Share20/Manager.php' line 733",
"Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":170,"Previous":{"Exception":"Error","Message":"Class \"OCA\\Files_Sharing\\AppInfo\\Application\" not found","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/deck/lib/Service/FilesAppService.php","line":218,"function":"createShare","class":"OC\\Share20\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/deck/lib/Service/AttachmentService.php","line":212,"function":"create","class":"OCA\\Deck\\Service\\FilesAppService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/deck/lib/Controller/AttachmentApiController.php","line":73,"function":"create","class":"OCA\\Deck\\Service\\AttachmentService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"create","class":"OCA\\Deck\\Controller\\AttachmentApiController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Share20/Manager.php","Line":733},"CustomMessage":"Exception thrown: Exception"}}
Operating system:
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Web server:
Apache: 2.4.59
Database:
mariadb: mariadb-server-10.5/stable 1:10.11.6-0+deb12u1 arm64
PHP version:
8.1.29
Nextcloud version: (see Nextcloud admin page)
Nextcloud Hub 8 (29.0.2)
Where did you install Nextcloud from:
Homepage
Signing status:
Login as admin user into your Nextcloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.
- No errors have been found.
**List of activated apps:**
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
`Enabled:
- calendar: 4.7.6
- circles: 29.0.0-dev
- cloud_federation_api: 1.12.0
- contacts: 6.0.0
- dashboard: 7.9.0
- dav: 1.30.1
- deck: 1.13.0
- federatedfilesharing: 1.19.0
- files: 2.1.0
- files_external: 1.21.0
- groupfolders: 17.0.1
- lookup_server_connector: 1.17.0
- mail: 3.7.1
- oauth2: 1.17.0
- provisioning_api: 1.19.0
- richdocumentscode_arm64: 24.4.201
- settings: 1.12.0
- spreed: 19.0.3
- tables: 0.7.3
- theming: 2.4.0
- twofactor_backupcodes: 1.18.0
- viewer: 2.3.0
- workflowengine: 2.11.0
Disabled:
- activity: 2.21.1 (installed 2.17.0)
- admin_audit: 1.19.0
- bruteforcesettings: 2.9.0 (installed 2.4.0)
- comments: 1.19.0 (installed 1.15.0)
- contactsinteraction: 1.10.0 (installed 1.6.0)
- encryption: 2.17.0
- federation: 1.19.0 (installed 1.15.0)
- files_downloadlimit: 2.0.0 (installed 2.0.0)
- files_pdfviewer: 2.10.0 (installed 2.6.0)
- files_reminders: 1.2.0 (installed 1.2.0)
- files_sharing: 1.21.0 (installed 1.17.0)
- files_texteditor: 2.15.1 (installed 2.15.1)
- files_trashbin: 1.19.0 (installed 1.15.0)
- files_versions: 1.22.0 (installed 1.18.0)
- firstrunwizard: 2.18.0 (installed 2.14.0)
- logreader: 2.14.0 (installed 2.10.0)
- nextcloud_announcements: 1.18.0 (installed 1.14.0)
- notifications: 2.17.0 (installed 2.13.1)
- password_policy: 1.19.0 (installed 1.15.0)
- photos: 2.5.0 (installed 2.0.1)
- privacy: 1.13.0 (installed 1.9.0)
- recommendations: 2.1.0 (installed 1.4.0)
- related_resources: 1.4.0 (installed 1.0.4)
- richdocuments: 8.4.3 (installed 8.4.3)
- richdocumentscode: 24.4.201
- serverinfo: 1.19.0 (installed 1.15.0)
- sharebymail: 1.19.0 (installed 1.15.0)
- socialsharing_email: 3.1.0 (installed 3.1.0)
- support: 1.12.0 (installed 1.8.0)
- survey_client: 1.17.0 (installed 1.13.0)
- suspicious_login: 7.0.0
- systemtags: 1.19.0 (installed 1.15.0)
- text: 3.10.0 (installed 3.6.0)
- twofactor_totp: 11.0.0-dev
- updatenotification: 1.19.1 (installed 1.15.0)
- user_ldap: 1.20.0
- user_status: 1.9.0 (installed 1.5.0)
- weather_status: 1.9.0 (installed 1.5.0)
`
**Nextcloud configuration:**
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder
or
Insert your config.php content here
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)
`{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"192.168.178.100",
"***REMOVED SENSITIVE VALUE***,
"pi.fritz.box",
"pi"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"overwrite.cli.url": "http:\/\/192.168.178.100\/nextcloud",
"dbtype": "mysql",
"version": "29.0.2.2",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"logtimezone": "UTC",
"installed": true,
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"theme": "",
"maintenance": false,
"loglevel": 1,
"trashbin_retention_obligation": "auto",
"updater.release.channel": "stable",
"updater.secret": "***REMOVED SENSITIVE VALUE***",
"app_install_overwrite": [
"calendar"
],
"mysql.utf8mb4": true,
"default_phone_region": "DE",
"mail_smtpport": "25",
"mail_sendmailmode": "smtp"
}
}
`
**Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/...
- no
</details>
<details>
<summary>Logs</summary>
#### Nextcloud log (data/nextcloud.log)
Insert your Nextcloud log here
- see attached
#### Browser log
Insert your browser log here, this could for example include:
- mobile.. so no browser console log
a) The javascript console log
b) The network log
c) ...
</details>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with apps/deck/lib/Service/FilesAppService.php around line 218, then follow AttachmentService.php around line 212 and AttachmentApiController.php line 73. Reproduce an attachment upload with files_sharing disabled and trace the createShare call; done means the upload no longer fails with the reported HTTP 500 and missing-class error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, php
- Domain
- api, backend, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100