Alfresco Webscripts with PostMan (Chrome ) vs RestClient (Mozilla)

Alfresco Webscripts with PostMan (Chrome ) vs RestClient (Mozilla)


Alfresco Webscripts with PostMan (Chrome ) vs RestClient (Mozilla)


Chrome might give you a hard time while you try to execute certain webscript calls in Alfresco with 
Cross-Origin Resource Sharing (CORS) Filter: CORS origin denied: chrome-extension://coohjcphdfgbiolnekdpbcijmhambjff

Use Mozilla rest client and do a submit by setting Content-type: application/json
For example :
Below post request adds a user(with userid -userid774) to the Alfresco Administrators
Grab a ticket and submit along :

Alfresco AMP installation error

Alfresco AMP installation error

Alfresco AMP installation : java.io.FileNotFoundException: /tmp/alfresco_amps/alfresco/alfresco-consulting-repo-utils-0.5.0.amp/module.properties


java.io.FileNotFoundException: /tmp/alfresco_amps/alfresco/alfresco-consulting-repo-utils-0.5.0.amp/module.properties
        at de.schlichtherle.truezip.file.TFileInputStream.newInputStream(TFileInputStream.java:108)
        at de.schlichtherle.truezip.file.TFileInputStream.<init>(TFileInputStream.java:81)
        at org.alfresco.repo.module.tool.ModuleDetailsHelper.createModuleDetailsFromPropertyLocation(ModuleDetailsHelper.java:105)
        at org.alfresco.repo.module.tool.ModuleManagementTool.installModule(ModuleManagementTool.java:229)
        at org.alfresco.repo.module.tool.ModuleManagementTool.main(ModuleManagementTool.java:832)
Caused by: java.util.zip.ZipException: Expected 40 more entries in the Central Directory!
        at de.schlichtherle.truezip.zip.RawZipFile.mountCentralDirectory(RawZipFile.java:480)
        at de.schlichtherle.truezip.zip.RawZipFile.<init>(RawZipFile.java:150)
        at de.schlichtherle.truezip.zip.RawZipFile.<init>(RawZipFile.java:129)
        at de.schlichtherle.truezip.fs.archive.zip.ZipInputShop.<init>(ZipInputShop.java:45)
        at de.schlichtherle.truezip.fs.archive.zip.ZipDriver.newInputShop(ZipDriver.java:498)
        at de.schlichtherle.truezip.fs.archive.zip.ZipDriver.newInputShop(ZipDriver.java:481)
        at de.schlichtherle.truezip.fs.FsTargetArchiveController.mount0(FsTargetArchiveController.java:197)
        at de.schlichtherle.truezip.fs.FsTargetArchiveController.mount(FsTargetArchiveController.java:155)
        at de.schlichtherle.truezip.fs.FsFileSystemArchiveController$ResetFileSystem.autoMount(FsFileSystemArchiveController.java:85)
        at de.schlichtherle.truezip.fs.FsFileSystemArchiveController.autoMount(FsFileSystemArchiveController.java:37)
        at de.schlichtherle.truezip.fs.FsBasicArchiveController.autoMount(FsBasicArchiveController.java:113)
        at de.schlichtherle.truezip.fs.FsBasicArchiveController$1Input.getLocalTarget(FsBasicArchiveController.java:185)
        at de.schlichtherle.truezip.fs.FsBasicArchiveController$1Input.getDelegate(FsBasicArchiveController.java:200)
        at de.schlichtherle.truezip.socket.DelegatingInputSocket.getBoundSocket(DelegatingInputSocket.java:43)
        at de.schlichtherle.truezip.socket.DelegatingInputSocket.newInputStream(DelegatingInputSocket.java:63)
        at de.schlichtherle.truezip.fs.FsContextController$Input.newInputStream(FsContextController.java:273)
        at de.schlichtherle.truezip.fs.FsResourceController$Input.newInputStream(FsResourceController.java:252)
        at de.schlichtherle.truezip.socket.DelegatingInputSocket.newInputStream(DelegatingInputSocket.java:63)
        at de.schlichtherle.truezip.fs.FsSyncController$Input.newInputStream(FsSyncController.java:400)
        at de.schlichtherle.truezip.fs.FsLockController$Input$1NewInputStream.call(FsLockController.java:455)
        at de.schlichtherle.truezip.fs.FsLockController$Input$1NewInputStream.call(FsLockController.java:452)
        at de.schlichtherle.truezip.fs.FsLockController.locked(FsLockController.java:328)
        at de.schlichtherle.truezip.fs.FsLockController.writeLocked(FsLockController.java:268)
        at de.schlichtherle.truezip.fs.FsLockController$Input.newInputStream(FsLockController.java:459)
        at de.schlichtherle.truezip.fs.FsFinalizeController$Input.newInputStream(FsFinalizeController.java:177)
        at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input$NewInputStream.call(FsFalsePositiveArchiveController.java:333)
        at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input$NewInputStream.call(FsFalsePositiveArchiveController.java:326)
        at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$TryChild.call(FsFalsePositiveArchiveController.java:507)
        at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController.call(FsFalsePositiveArchiveController.java:104)
        at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input.newInputStream(FsFalsePositiveArchiveController.java:323)
        at de.schlichtherle.truezip.file.TFileInputStream.newInputStream(TFileInputStream.java:104)
        ... 4 more
        Suppressed: java.nio.file.FileSystemException: /tmp/alfresco_amps/alfresco/alfresco-consulting-repo-utils-0.5.0.amp/module.properties: Not a directory
                at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
                at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
                at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
                at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
                at java.nio.file.Files.newByteChannel(Files.java:361)

Solution:


Verified the s3 bucket where amps were unpacked and copied for deployment was corrupt!

Amazon RDS DB Update Allocated Storage -Alfresco MySQL

Amazon RDS 


DB update appear to be stuck in the modifying state when attempting to increase allocated storage.

Last week, bulk import following a content migration effort from Sharepoint to alfresco landed us in filling up of Alfresco DB metadata table aggressively and left us with no option but increase the allocated story for our MySQL DB.

This caused an enormous amount of delay in updating RDS DB instance update to increase an allocated storage of 200GB to 2000 from 30 mins to 1.35 hours. It is advisable to have this planned for off hours to have lower business impacts.

Options leveraged :

1. AWS Console




2. CLI command:

    https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ModifyInstance.MySQL.html


3. Bamboo Deployment


How to update Java Heap Size Alfresco Windows Service

How to update Java Heap Size Alfresco Windows Service


Options:
1. Update the setenv.bat/setenv.sh file
2. Update the alfrescoTomcatw.exe(service) file

Option 1: Update the setenv.bat/setenv.sh file


Step 1: Go to the <alfresco-home>tomcat\bin folder
Step 2: Edit the file setenv.bat to update the value starting with SET JAVA_OPTS.. to have the value - --JvmMx 4095 replaced with the desired maximum value, say --JvmMx 8129

Option 2: Update the alfrescoTomcatw.exe(service) file


Step1. Go to the <alfresco-home>tomcat\bin folder
Step 2: Find and right-click on the alfrescoTomcatw.exe file, click on Open

Step 3: Click on the Java tab



Step 4: Update the Maximum memory pool to the desired RAM.
Step 5: Restart the server.


Alfresco Illegal key size Issue - Solved


Alfresco Illegal key size Issue 


Ever had to add a crypto key in alfresco configurations and ran into below issue? You can try the fix mentioned below to come out of it.

Caused by: java.security.InvalidKeyException: Illegal key size or default parameters
                at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1026)
                at javax.crypto.Cipher.implInit(Cipher.java:801)
                at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
                at javax.crypto.Cipher.init(Cipher.java:1249)
                at javax.crypto.Cipher.init(Cipher.java:1186)
                at org.alfresco.consulting.module.distobj.impl.DefaultConfigurationService.validateCrypto(DefaultConfigurationService.java:371)



Solution

                Step 1: Download the JCE Unlimited jars from oracle downloads 
                Step 2: Add to your JDK or JRE lib under \lib\security\
                Step 3: Set below property in the <jdk or jre home>\lib\security\java.security
crypto.policy=unlimited

                Step 4: Restart the server

Admin console settings overwrite the alfresco global configurations

Admin console settings overwrite the alfresco global configurations



Do you often deal with lot of Alfresco configurations including those simple looking ones at alfresco-global.properties? Dealt with Below points might be of your interest

alfresco-global.properties


Alfresco has summoned many of its product configuration to this file alfresco-global.properties from files such as repository.properties, database configurations etc to one single file. This helps easy management of various configurations. When installed using installer the file is found in below location:
 <alfresco-installation-directory>\tomcat\shared\classes

Administration -Points to remember

1. Alfresco Admin Console : values overwrite the values from properties files including alfresco-global.properties

2.JMX Console: Values saved through admin console needs to be managed using JMX Console

3. Server restart: In most cases a Server/service restart are required for the changes to get reflected. However certain configurations such as log4j, License etc doesnt require a server restart

4. Server/Client Cache - Always remember to clear the caches such as browser cache (private browing/going incognito) , Tomcat temp, work folder clearance saves a lot of time in successful validation of configurations
Alfresco Invalid keystore format

Alfresco Invalid keystore format

Alfresco Invalid keystore format

Ever got into the issue below while installing the cert?

I:\Alfresco51\alf_data\keystore>F:\Alfresco51\java\bin\keytool -list -v -keystore ssl.keystore
keytool error: java.io.IOException: Invalid keystore format
java.io.IOException: Invalid keystore format
        at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
        at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
        at sun.security.provider.KeyStoreDelegator.engineLoad(Unknown Source)
        at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(Unknown S
ource)
        at java.security.KeyStore.load(Unknown Source)
        at sun.security.tools.keytool.Main.doCommands(Unknown Source)
        at sun.security.tools.keytool.Main.run(Unknown Source)
        at sun.security.tools.keytool.Main.main(Unknown Source)


Try below Solution

Check if you are appending the keytool parameter -storeType with values like JCEKS/JKS/PKCS12