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

Fix: Defining app config values breaks ansible script execution #69

Open
d7oc opened this issue Nov 16, 2022 · 7 comments
Open

Fix: Defining app config values breaks ansible script execution #69

d7oc opened this issue Nov 16, 2022 · 7 comments

Comments

@d7oc
Copy link
Contributor

d7oc commented Nov 16, 2022

If the S3 configuration is given in the owncloud_config_extra section like this:

owncloud_config_extra:
  - objectstore:
      class: 'OCA\\Files_Primary_S3\\S3Storage'
      arguments:
        bucket: "owncloud"
        part_size: "5242880"
        concurrency: "5"
        options:
          version: "2006-03-01"
          region: "us-east-1"
          credentials:
            key: "username"
            secret: "password"
          use_path_style_endpoint: true
          endpoint: "http:\/\/hostname:8000"

Ansible aborts the execution due to a class not found exception in occ check. A separate execution of occ check looks like this:

occ check
An unhandled exception has been thrown:
Error: Class 'OCA\Files_Primary_S3\S3Storage' not found in /var/www/owncloud/lib/private/legacy/util.php:115
Stack trace:

The reason is that the apps are installed

- include_tasks: apps.yml
after the config is written
- name: Install ownCloud config file
so the system doesn't know the class when occ check is executed in
- name: Get ownCloud setup status

@enbrnz
Copy link
Contributor

enbrnz commented Nov 17, 2022

As we are using the market app to install further apps, we can only install new apps after the main installation.
So, one idea would be, to install app configuration after the main installation.

However, you are trying to install files_primary_s3 which specifically needs to have its configuration available before maintenance:install.

Which ownCloud install package are you using? I'm not sure whether the complete bundle even includes files_primary_s3. Perhaps you need to provide a custom owncloud tarball to the ansible playbook which includes it?

@d7oc
Copy link
Contributor Author

d7oc commented Nov 17, 2022

files_primary_s3 is even missing in the complete install package, so it needs to be installed separately right now. I placed the tarball in an asset directory in this case as the system here was air gapped. The custom tarball would be a workaround which might do the trick. But when it comes to workarounds I can also run the Ansible script twice, once without the configuration to just install the app, and once with the configuration to have everything completed.

So you think there is no solution for this in which we can just change the order of execution in the Ansible script?

@enbrnz
Copy link
Contributor

enbrnz commented Nov 17, 2022

present=['market:install'],

The oc_app library within this playbook uses market:install to install additional apps.
Therefore we cannot change the order of execution.

The custom tarball would be a workaround which might do the trick. But when it comes to workarounds I can also run the Ansible script twice, once without the configuration to just install the app, and once with the configuration to have everything completed.

I was thinking about this one too, yes you could do that one too.

@d7oc
Copy link
Contributor Author

d7oc commented Nov 17, 2022

Last thing which came to my mind: What about inventing something like owncloud_config_extra_post_install which will be written just after the general installation but before the installation of apps? Stuff like the S3 configuration which refers to app classes would then just go there.

@enbrnz
Copy link
Contributor

enbrnz commented Nov 17, 2022

Yes, that might be a good idea.

I think files_primary_s3 only needs to be fully configured before the first user login.
If for example the admin logs in before it is configured, then the user storage will be created in the datadirectory.

But we need to verify first, that it isn't needed before maintenance:install, because then this idea wouldn't work.

@d7oc
Copy link
Contributor Author

d7oc commented Nov 17, 2022

Who can verify this?

@enbrnz
Copy link
Contributor

enbrnz commented Nov 30, 2022

Who can verify this?

I would recommend to either read the code, or try it out. Wasabi/Backblaze (among others) offer trial S3 access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants