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

Clean has exceeded language limit #119

Open
laststandjam opened this issue Jan 17, 2025 · 12 comments · May be fixed by #121
Open

Clean has exceeded language limit #119

laststandjam opened this issue Jan 17, 2025 · 12 comments · May be fixed by #121

Comments

@laststandjam
Copy link

Brief bug description

I have an environment with the two languages, the maximum number languages allowed in my subscription. After backing up, cleaning, and restoring the environment. It becomes impossible to clean it again as I run into a Validation Error {"message":"The specified project already contains the maximum number of active languages for your subscription plan. To add a new language, deactivate an existing language first."} This is still with two active languages and one inactivate one.

Repro steps

  1. Create as many languages as your subscription allows in an environment.
  2. Run a backup
  3. Clean the environment.
  4. Restore from the backup.
  5. Try to clean the environment again.

Expected behavior

Be able to clean the environment as my active languages aren't above the limit.

Test environment

  • Platform/OS: [e.g. .NET Core 2.1, iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Screenshots

Image Image
@IvanKiral
Copy link
Contributor

Hey @laststandjam,

You are right, the code would not work, on this condition. I tried to fix it by handling the active languages first. Can you please check whether solution from #121 works for you?

You would need to switch to branch fix_clean_languages_limitation and follow these instruction to run tool locally https://github.com/kontent-ai/data-ops?tab=readme-ov-file#getting-started-with-development.

Thank you.

@csimonszuyderland
Copy link

Hello @IvanKiral, @laststandjam ,

Unfortunately running the tool locally with branch fix_clean_languages_limitation has not solved the problem yet

I now get the message:
Image

But activating inactive languages is not possible:
Image

Hopefully this will provide a starting point for finding a solution. Thank you!

@IvanKiral
Copy link
Contributor

Hey @csimonszuyderland,

thank you for trying out the solution. Can you please try it once again? I had some uncommitted changes that might solve this so I have pushed them. Remember to pull the changes again. I'm sorry about that.

@csimonszuyderland
Copy link

Hi @IvanKiral ,

The clean command is now running successfully, but when I perform a restore from a backup I get the following error message:

The specified project already contains the maximum number of active languages for your subscription plan. To add a new language, deactivate an existing language first.

(The languages are still in the environment)

@IvanKiral
Copy link
Contributor

Sadly, languages cannot be deleted :/. Are the languages deactivated?

@csimonszuyderland
Copy link

Yes, the languages are deactivated:

Image

@IvanKiral
Copy link
Contributor

Would it be possible for you to send me the zip you are trying to restore, so i can try it myself?

@IvanKiral
Copy link
Contributor

IvanKiral commented Jan 23, 2025

@csimonszuyderland I think I find something, the tool is also trying to restore deactivated languages. I am considering to filter inactive languages when restoring. Is that okay for you?

Other option is to add them as inactive (now the tool import all languages as active, which is not nice) but then there might be a problem with same external-id

@csimonszuyderland
Copy link

@IvanKiral That seems like a good option to me.

@IvanKiral
Copy link
Contributor

okay I pushed that solution for now :) I was able to import with your zip, so hopefully, I didn't miss something :D Anyway, I will probably rewrite it not to skip languages, but to sort them and deal with inactive ones at first. Sorry for the inconvenience.

Let me know if it is working now for you.

@IvanKiral IvanKiral linked a pull request Jan 23, 2025 that will close this issue
5 tasks
@csimonszuyderland
Copy link

Great, this works, the restore of the backup was successful!

Thanks for solving the problem quickly!

@IvanKiral
Copy link
Contributor

Glad to hear! :) Thank you for your collaboration, it was really helpful :)

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

Successfully merging a pull request may close this issue.

3 participants