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

Push publishing a content type fails if it is on a site that does not exist on target AND NO Error Message #29255

Closed
wezell opened this issue Jul 17, 2024 · 4 comments · Fixed by #29344 or #29769

Comments

@wezell
Copy link
Contributor

wezell commented Jul 17, 2024

Parent Issue

No response

Problem Statement

If you create a content type that lives on host that does not exist on the target site, it will fail to publish and give no error. See screenshot below with no actionable error:

Failed to publish because an error occurred: An error occurred when processing Content Type in '/data/shared/assets/bundles/01J30Y1TQTNFG2MZEBFTQJPWQ9/working/dotcms.com/50e7185be91fea68442ef189e5ac0cb5.contentType.json' with ID 'Documentation Homepage': 50e7185be91fea68442ef189e5ac0cb5
Screenshot 2024-07-17 at 2 14 32 PM

Steps to Reproduce

  1. add a new site (name random name)
  2. add a content type on this site
  3. try to push publish just this content type (without dependencies) to demo.dotcms.com

Acceptance Criteria

  1. A good fix is to include the "hostName" in the content Type definition, rather than just the siteId. We could do a lookup in the handler to
  • see if the site exists by id,
  • if not, lookup site by hostname
  • if not, fall back to system_host

This would prevent failures.

At minimum, we should show a better error message that describes the actual problem.

@jcastro-dotcms
Copy link
Contributor

jcastro-dotcms commented Jul 17, 2024

NOTE TO DEVS:

When the error message is being put together:

final String errorMsg = String.format("An error occurred when processing Content Type in '%s' with ID '%s': %s",
workingOn, (null == contentType ? "(empty)" : contentType.name()), (null == contentType ? "(empty)" :
contentType.id()), e.getMessage());

The String.format method is expecting 3 parameters, but it's receiving 4. Therefore, the error message from the original exception is not going to be present in the message displayed in the UI.

@dsilvam
Copy link
Contributor

dsilvam commented Aug 26, 2024

Failed Internal QA: Saving the Content Type under default host instead of system host

@dsilvam dsilvam assigned dsilvam and unassigned dsilvam Aug 26, 2024
dsilvam added a commit that referenced this issue Aug 27, 2024
github-merge-queue bot pushed a commit that referenced this issue Aug 28, 2024
The siteName is also needed to be set to the CT because otherwise the
host it gets looked up by siteName first if it does not exist on the
receiver it will fallback to defaultHost, which is *not* the desired
behavior here, which is fallback to system_host.
@dsilvam dsilvam removed their assignment Aug 28, 2024
@freddyDOTCMS freddyDOTCMS self-assigned this Aug 28, 2024
@freddyDOTCMS
Copy link
Contributor

Pass Internal QA: Now the Content Type is saved under the SYSTEN_HOST

@josemejias11
Copy link
Contributor

Approved: Tested on trunk_b8fe837, Docker, macOS 14.5, FF v126.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment