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

Fixed error when importing a container: This variable cannot be deleted as it is used in other places #388

Closed
tsteur opened this issue Dec 9, 2021 · 3 comments · Fixed by #389
Assignees
Labels
Bug Something isn't working

Comments

@tsteur
Copy link
Member

tsteur commented Dec 9, 2021

image

  • Create a new container.
  • Go to versions
  • Click on import
  • Import below data
{"idcontainer":"lRjDHEmG","idsite":1,"context":"web","name":"test2","description":"","created_date":"2021-12-09 19:28:11","updated_date":"2021-12-09 19:28:11","created_date_pretty":"Dec 9, 2021 20:28:11","updated_date_pretty":"Dec 9, 2021 20:28:11","revision":0,"version":{"name":"","description":"","revision":0,"created_date":"2021-12-09 19:28:11","created_date_pretty":"Dec 9, 2021 20:28:11","updated_date":"2021-12-09 19:28:11","updated_date_pretty":"Dec 9, 2021 20:28:11"},"tags":[],"triggers":[],"variables":[{"idvariable":36,"type":"MatomoConfiguration","name":"Matomo Configuration","parameters":{"matomoUrl":"{{Matomo Configuration}}","idSite":"1","enableLinkTracking":true,"enableCrossDomainLinking":false,"enableDoNotTrack":false,"enableJSErrorTracking":false,"enableHeartBeatTimer":false,"trackAllContentImpressions":false,"trackVisibleContentImpressions":false,"disableCookies":false,"requireConsent":false,"requireCookieConsent":false,"setSecureCookie":false,"cookieDomain":"","cookiePath":"","cookieSameSite":"Lax","domains":[],"alwaysUseSendBeacon":false,"userId":"","customDimensions":[],"bundleTracker":true,"registerAsDefaultTracker":true,"jsEndpoint":"matomo.js","trackingEndpoint":"matomo.php"},"lookup_table":[],"default_value":"","created_date":"2021-12-09 19:28:53","updated_date":"2021-12-09 19:28:53","created_date_pretty":"Dec 9, 2021 20:28:53","updated_date_pretty":"Dec 9, 2021 20:28:53"}]}

What this import represents (refs #293 ):

Eg create a MatomoConfiguration variable named "Matomo Configuration" and set Matomo URL to "https://matomo.org{{Matomo Configuration}}".

The above one there is a variable that references itself which is causing this issue. Technically, this should not be happening anymore as we prevented a while ago this from happening and any newer container it shouldn't be possible to configure such a container. Unless someone configured the JSON themselves.

Maybe we could time box and look into this for 1 hour to see if we can fix this issue and make such imports happen and if not we might put it back in the backlog. If we can't solve it quick, maybe in import we could catch this error and then attach an extra message so it reads like This variable cannot be deleted as it is used in other places. To remove this variable, first remove all places where this variable is used. It could be that a variable references itself within a variable.. We wouldn't change the error message though in other places.

@tsteur
Copy link
Member Author

tsteur commented Dec 13, 2021

As part of this issue for now we will adjust the error message. We will keep this issue open once the message is adjusted. Then as a next step we would need to see if we can revert to the previously active draft as the import would then have worked partially I assume and be incomplete. Ideally on any import failure we would revert to the previous version.

@justinvelluppillai justinvelluppillai changed the title Getting error when importing a container: This variable cannot be deleted as it is used in other places. To remove this variable, first remove all places where this variable is used Fixed error when importing a container: This variable cannot be deleted as it is used in other places Feb 1, 2022
@ben-dw
Copy link
Contributor

ben-dw commented Mar 1, 2022

Currently my Import process will not work, as I'm facing this issue. How can I tell which variable is giving me the most trouble?

@ben-dw
Copy link
Contributor

ben-dw commented Mar 2, 2022

Currently my Import process will not work, as I'm facing this issue. How can I tell which variable is giving me the most trouble?

If a variable uses other variables, it might break. So I have tried out, which variable is responsible, removed it and re-import the container. It worked like this.

@innocraft-automation innocraft-automation removed this from the Current sprint milestone Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants