Expand my Community achievements bar.

SOLVED

How to setup local publish instance for cloud SDK?

Avatar

Level 9

We have to get grapqhl working. Graphql cant be used form author instance because it requires authentication, and the method is not documented and there is no way to "unprotect" the graphql endpoint on author to not require authenticaiton.

 

We understand that the publish instance doesnt have this restriction, i.e. we can call the graphql endpoint without authentication.

 

However, we cant find how to setup a publish instance which takes its content from the author instance.

 

This is on an M1 Mac.

 

We installed author by renaming our aem_cloud_SDK jar to aem-author-p4502.jar, unpacking it, then running crx-quickstart/bin/start.  This works, and we have installed the wknd site which has content fragments and setsup the graphql endpoint correctly.   We kept the default admin/admin user/pass

 

We installed publish by copying the aem cloud sdk jar file to aem-publish-p4503.jar in a separate dir and uplacking/running it.  The process is running, but when we try to hit any publish url e.g. http://localhost:4503/content/wknd/us/en/magazine/ski-touring we get 404.

 

With the NON cloud SDK, this works out of the box (i.e. replication happens automatically), but what do we need to do for cloud SDK to get this to work?

 

We only need the publish instance to try to find a way to access graphql endpoint in our local dev envs without authentication.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @TB3dock 

This setup completely works for me for both Author and Publish instance. Please make sure to run the instance by running the below command:

Author: java -jar aem-author-p4502.jar
Publish: java -jar aem-publish-p4503.jar

and for both the instance use the below username and password:

admin/admin

 

Here all the wknd pages are working fine in both author and publish instance.

 

In Cloud Service environment content is distributed from the Author Service to the Publish Service using Sling Content Distribution and the Adobe Pipeline whereas during development, to simulate the distribution of content using the local Author and Publish service the legacy Replication agents can be used.

 

  1. Login to the Author service and navigate to http://localhost:4502/etc/replication/agents.author.html
  2. Select the Default Agent and configure it.
  3. Transport tab please use this config: http://localhost:4503/bin/receive?sling:authRequestLogin=1 with admin/admin
  4. Save and test the connection.

asutosh_j3_2-1617019974655.png

asutosh_j3_3-1617019994502.png

 

It will allow you to replicate the page.

 

Please refer the below link:

https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/local-development-env...

 

Hope this helps!

Thanks!

 

View solution in original post

7 Replies

Avatar

Correct answer by
Community Advisor

Hi @TB3dock 

This setup completely works for me for both Author and Publish instance. Please make sure to run the instance by running the below command:

Author: java -jar aem-author-p4502.jar
Publish: java -jar aem-publish-p4503.jar

and for both the instance use the below username and password:

admin/admin

 

Here all the wknd pages are working fine in both author and publish instance.

 

In Cloud Service environment content is distributed from the Author Service to the Publish Service using Sling Content Distribution and the Adobe Pipeline whereas during development, to simulate the distribution of content using the local Author and Publish service the legacy Replication agents can be used.

 

  1. Login to the Author service and navigate to http://localhost:4502/etc/replication/agents.author.html
  2. Select the Default Agent and configure it.
  3. Transport tab please use this config: http://localhost:4503/bin/receive?sling:authRequestLogin=1 with admin/admin
  4. Save and test the connection.

asutosh_j3_2-1617019974655.png

asutosh_j3_3-1617019994502.png

 

It will allow you to replicate the page.

 

Please refer the below link:

https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/local-development-env...

 

Hope this helps!

Thanks!

 

Avatar

Level 9
Hi, If I start the author instance using equivalent of java -jar aem-author-p4502.jar it works as expected. If I start the aem-publish-p4503.jar in a new dir in the same way, whatever URL I hit on http://localhost:4503 I get 404 not found. There is no login option. I am using the local cloud SDK. It works if I use the old non-cloud jar file for author or publish (e.g. on my old windows computer), but on the mac I am using the cloud SDK as thats what most of the tutorials use, and cloud is what we are using in production.

Avatar

Community Advisor

@TB3dock Please use this URL to login on publish instance:
http://localhost:4503/libs/granite/core/content/login.html

 

For me also in local SDK it works and all the pages are rendering perfectly fine.
such as http://localhost:4503/content/wknd/en/restaurants/best-tacos-in-the-city.html

 

Let me know if this does not work.

Avatar

Level 9

If I go to: http://localhost:4502/etc/replication/agents.author.html I see that default agent (publish) is disabled. If I open it, and do "edit" next to settings, and configure the transport tab as directed, and save, its still disabled with no option to enable. If I hit "test connection" it gives:

 

 

Replication test to http://localhost:4503/bin/receive?sling:authRequestLogin=1

2021-03-29 14:34:18 - Create new HttpClient for Default Agent
2021-03-29 14:34:18 - * Auth User: admin
2021-03-29 14:34:18 - * HTTP Version: 1.1
2021-03-29 14:34:18 - * Connect Timeout: 900000
2021-03-29 14:34:18 - * Socket Timeout: 900000
2021-03-29 14:34:18 - adding header: Action:Test
2021-03-29 14:34:18 - adding header: Path:/content
2021-03-29 14:34:18 - adding header: Handle:/content
2021-03-29 14:34:18 - deserialize content for delivery
2021-03-29 14:34:18 - No message body: Content ReplicationContent.VOID is empty
2021-03-29 14:34:18 - Sending POST request to http://localhost:4503/bin/receive?sling:authRequestLogin=1
2021-03-29 14:34:18 - sent. Response: 404 Not Found
2021-03-29 14:34:18 - Replication (TEST) of /content not successful. Conversation follows
2021-03-29 14:34:18 - ------------------------------------------------
2021-03-29 14:34:18 - Sending message to localhost:4503
2021-03-29 14:34:18 - >> POST /bin/receive HTTP/1.0
2021-03-29 14:34:18 - >> Action: Test
2021-03-29 14:34:18 - >> Path: /content
2021-03-29 14:34:18 - >> Handle: /content
2021-03-29 14:34:18 - >> Referer: about:blank
2021-03-29 14:34:18 - >> Content-Length: 0
2021-03-29 14:34:18 - >> Content-Type: application/octet-stream
2021-03-29 14:34:18 - --
2021-03-29 14:34:18 - << HTTP/1.1 404 Not Found
2021-03-29 14:34:18 - << Cache-Control: must-revalidate,no-cache,no-store
2021-03-29 14:34:18 - << Content-Type: text/html;charset=iso-8859-1
2021-03-29 14:34:18 - << Content-Length: 433
2021-03-29 14:34:18 - <<
2021-03-29 14:34:18 - << <html>
2021-03-29 14:34:18 - << <head>
2021-03-29 14:34:18 - << <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
2021-03-29 14:34:18 - << <title>Error 404 Not Found</title>
2021-03-29 14:34:18 - << </head>
2021-03-29 14:34:18 - << <body><h2>HTTP ERROR 404 Not Found</h2>
2021-03-29 14:34:18 - << <table>
2021-03-29 14:34:18 - << <tr><th>URI:</th><td>/bin/receive</td></tr>
2021-03-29 14:34:18 - << <tr><th>STATUS:</th><td>404</td></tr>
2021-03-29 14:34:18 - << <tr><th>MESSAGE:</th><td>Not Found</td></tr>
2021-03-29 14:34:18 - << <tr><th>SERVLET:</th><td>org.apache.felix.http.base.internal.dispatch.DispatcherServlet-7938de07</td></tr>
2021-03-29 14:34:18 - << </table>
2021-03-29 14:34:18 - << </body>
2021-03-29 14:34:18 - << </html>
2021-03-29 14:34:18 - Message sent.
2021-03-29 14:34:18 - ------------------------------------------------
2021-03-29 14:34:18 - Replication (TEST) of /content not successful.

 


Replication test failed
Not Found

Avatar

Community Advisor

@TB3dock There is a filed called Enabled. Please select the check box.

 

asutosh_j3_0-1617021585657.png

 

Avatar

Level 9
OK, I killed the publish instance (by force quitting java), and restarted it, now publication works! how do you publish the whole site? I only see the option to publish one page at a time?

Avatar

Community Advisor

@TB3dock Please use the below process to activate all the page:

  1. Select the root page and click on 'Manage Publication'.
  2. Select 'Publish' as the Action and click 'Next'.
  3. Click on 'Select All' checkbox.
  4. Then Click Include Children.
  5. Popup will appear and unselect all checkbox and click on 'Add'.
  6. Click on 'Select All' checkbox which will select all the pages and will show as a list.
  7. Click on 'Publish' which will replicate all the page.