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

[Bug]: Provisionning API /ocs/v1.php/cloud/apps/<app-id> doesn't return anything in XML format #33330

Closed
6 tasks done
MercierCorentin opened this issue Jul 24, 2022 · 9 comments
Assignees
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: apps management

Comments

@MercierCorentin
Copy link

MercierCorentin commented Jul 24, 2022

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

Following these instruction : https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/instruction_set_for_apps.html#get-app-info

I get no result when trying to get an app metadata with the provisioning API xml format.

When JSON formatting is requested, I get a valid result.
Others app routes are working, I can disable and enable an app.

Steps to reproduce

  1. Create a fresh install from the official docker image
  2. Use the following command:
curl -u {admin}:{password -X GET 'http://{nc-instance-domain}/ocs/v1.php/cloud/apps/files' -H "OCS-APIRequest: true"
  1. You get a HTTP 200 OK response with a content length of 0.

Expected behavior

I would expect the documented response (here):

<?xml version="1.0"?>
<ocs>
  <meta>
    <statuscode>100</statuscode>
    <status>ok</status>
  </meta>
  <data>
    <info/>
    <remote>
      <files>appinfo/remote.php</files>
      <webdav>appinfo/remote.php</webdav>
      <filesync>appinfo/filesync.php</filesync>
    </remote>
    <public/>
    <id>files</id>
    <name>Files</name>
    <description>File Management</description>
    <licence>AGPL</licence>
    <author>Robin Appelman</author>
    <require>4.9</require>
    <shipped>true</shipped>
    <standalone></standalone>
    <default_enable></default_enable>
    <types>
      <element>filesystem</element>
    </types>
  </data>
</ocs>

Installation method

Official Docker image

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.0

Web server

Apache (supported)

Database engine version

SQlite

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)

Configuration report

www-data@7faffe3cd28f:~/html$ ./occ config:list system
{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.1.111:8080"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "sqlite3",
        "version": "24.0.2.1",
        "overwrite.cli.url": "http:\/\/192.168.1.111:8080",
        "installed": true,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory"
    }
}

List of activated Apps

www-data@7faffe3cd28f:~/html$ ./occ app:list
Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - admin_audit: 1.14.0
  - bruteforcesettings: 2.4.0
  - circles: 24.0.0
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_external: 1.16.1
  - files_pdfviewer: 2.5.0
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - firstrunwizard: 2.13.0
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - nextcloud_announcements: 1.13.0
  - notifications: 2.12.0
  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - quota_warning: 1.14.0
  - recommendations: 1.3.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - updatenotification: 1.14.0
  - user_ldap: 1.14.1
  - user_status: 1.4.0
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - encryption: 2.12.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

No response

@MercierCorentin MercierCorentin added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jul 24, 2022
@szaimen
Copy link
Contributor

szaimen commented Jan 23, 2023

Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+

@Chartman123
Copy link

@szaimen If it's the same cause (see forms issue) then this is still valid in 26

@MercierCorentin
Copy link
Author

MercierCorentin commented Mar 5, 2023

@szaimen I was able to reproduce it on 25.0.3.2 and 25.0.4.1 in the same environment.

@szaimen If it's the same cause (see forms issue) then this is still valid in 26

Seems like the same issue.

@jotoeri
Copy link
Member

jotoeri commented Mar 5, 2023

I tested it once on forms - Seems like it works, when returning an array (forms/api/v2/forms returns a list of forms), while it does not work, when returning an object (forms/api/v2/form/1 returns a single form).

Corresponding error log should be this one (no trace unfortunately):

PHP - TypeError: XMLWriter::writeElement(): Argument #2 ($content) must be of type ?string, stdClass given at /var/www/nc/lib/private/AppFramework/OCS/BaseResponse.php#148

@szaimen
Copy link
Contributor

szaimen commented Jun 21, 2023

Cc @provokateurin

@provokateurin
Copy link
Member

If the error message you are seeing is related to the bug, then I already fixed it in #38745. It was meant as a feature though, so apparently some apis misbehave. It is only available on master right now, but I guess it could be backported to fix this bug. I will first try it myself and see if it fixes this problem.

@provokateurin provokateurin self-assigned this Jun 22, 2023
@provokateurin
Copy link
Member

@MercierCorentin I tried your command to reproduce the problem but I get a valid XML response. I tested it on 27.0.0 which doesn't have the PR I mentioned above applied. Can you try again on 27.0.0 and see if your problem is solved?

@provokateurin
Copy link
Member

I assume this problem is fixed in the latest release, please re-open if that is not the case.

@Chartman123
Copy link

Chartman123 commented Aug 1, 2023

@provokateurin I still get the error message from @jotoeri's post in Forms with NC 27.0.1 when I try to get a single form.

TypeError: XMLWriter::writeElement(): Argument #2 ($content) must be of type ?string, stdClass given at /srv/www/htdocs/nextcloud/lib/private/AppFramework/OCS/BaseResponse.php#151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: apps management
Projects
None yet
Development

No branches or pull requests

6 participants