Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Local Env with VSCode AEM Sync Issue

Avatar

Level 2

Hi all, new AEM developer here.

 

I have my local environment up and running but I'm having issues syncing changes from VSCode to my local environment.  I'm using the AEM Sync extension here: https://marketplace.visualstudio.com/items?itemName=yamato-ltd.vscode-aem-sync

 

When I try and import or export I get the following error: Cannot establish a connection to server http://localhost:4502: ERR_HTTP_HEADERS_SENT.

 

I verified the settings of the extension which is setup for http://localhost:4502 and with the correct credentials.  Has anyone encountered this issue before? Or is there a log in AEM somewhere that I may be able to look at that may have more information as far as why the connection couldn't be established?

 

Thanks!

 

1 Accepted Solution

Avatar

Correct answer by
Level 2

FYI, in case anyone else runs into similar issues.  Working with a co-worker we discovered our proxy had a network route for localhost that was causing issues.  You can check this by opening a command prompt and doing a "nslookup localhost".

 

Once we discovered that, the fix was a matter of removing the windows system environment variables for http/s proxies and restarting VS-code.  Issue was then solved.

View solution in original post

7 Replies

Avatar

Community Advisor

Hi @Dusty ,

Try to open the system console (http://localhost:4502/system/console/bundles ) first and see whether all bundles are in active mode or not. If you are able to open the system/console and all the bundles are in active then there is no issue with the server. 

Check if it can be accessed via 127.0.0.1:4502 or with your IP?

I have tried it it works well. Verify your configurations are in place as below

Screen Shot 2022-07-11 at 2.02.45 PM.png

Regards,

Santosh

Avatar

Level 2

Thanks for your reply Santosh.

 

Confirming all bundles are active:

Dusty_0-1657563239592.png

 

Confirming I can access the environment via IP:

Dusty_1-1657563285086.png

 

And confirming my AEM Sync settings

Dusty_2-1657563350884.png

 

Avatar

Community Advisor

It looks like your settings are correct. Adding mine for reference

Shubham_borole_0-1657562704455.png

 

When I set this up recently, I noticed that my sync to AEM was not working and found that there was another vscode extension I had installed too (AEM Sync) I uninstalled this one and after that the (VS Code AEM Sync) started working. So we can check settings or extensions that might be hindering this.

Just want to make sure this is not the case for you. If so we can try that.

 

Other reasons I can think of are local instance is not up (not likely) and the file you are trying to sync is not allowed via filter xml

Avatar

Level 2

Hi Shubham,

 

I disabled all other extensions and reloaded VSCode and the issue still persists. I do not have the other AEM Sync extension installed but I had previously tried that extension, it did not work either.

 

Thanks for your reply.

Avatar

Community Advisor

You may have already tried this but worth a shot. But just after I posted the reply earlier my sync was not working, there was no error or pop up notification. I saw it happening couple times and had to uninstall and install the extension back to make it work.

Any more info on your vscode version may be? I will check mine and update

Avatar

Level 2

I tried uninstalling and reinstalling the extension but that didn't solve the issue.  I could try uninstalling VSCode and re-installing everything as a next step maybe.  This is my VSCode version information:


Version: 1.69.1 (user setup)
Commit: b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a
Date: 2022-07-12T08:21:24.514Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Windows_NT x64 10.0.19044

 

I do wonder if it's some issue related to my work vpn and proxy settings that I need to sort out, but haven't found anything so far.

 

Thanks!

Avatar

Correct answer by
Level 2

FYI, in case anyone else runs into similar issues.  Working with a co-worker we discovered our proxy had a network route for localhost that was causing issues.  You can check this by opening a command prompt and doing a "nslookup localhost".

 

Once we discovered that, the fix was a matter of removing the windows system environment variables for http/s proxies and restarting VS-code.  Issue was then solved.