External string does not exist error while trying to deploy through Jenkins - deployment

We have repo with salesforce code. Goal is to deploy it to scratch org and launch tests.
Below is the error as we are getting while running a Jenkins pipeline for common libraries.
Error src/main/java/com/spartasystems/twd/security/PermissionGuard.cls External string does
not exist: PERMISSION_DENIED_AN_OBJECT (27:82)
Error src/main/java/com/spartasystems/twd/security/PermissionGuard.cls External string does
not exist: PERMISSION_DENIED_A_FIELD (29:82)
ERROR running force:source:deploy: Deploy failed.
My deploy code looks like as shows below:
stage('MDAPI Deploy To Scratch Org'){
sh 'ls -al'
sh 'cat sfdx-project.json'
sh 'cat src/labels/*'
SFDX.deployMDAPISourceCodeToScratchOrg("./abc/src/");
SFDX.deployMDAPISourceCodeToScratchOrg("./xyz/src/");
sh 'rm src/main/java/com/company/twd/util/DebuggingUtil'
sh 'sfdx force:source:deploy -x src/main/resources/package.xml'
}
Here is the package.xml file
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ApexClass</name>
</types>
<types>
<members>*</members>
<name>CustomObject</name>
</types>
<types>
<members>*</members>
<name>CustomLabels</name>
</types>
<version>49.0</version>
</Package>
Can anyone help me here as I am stuck and unable to fix this issue ?
I have got a response from Salesforce Stack Exchange that this might be something related to third-party java library . I am unable to understand whether there is an issue with Labels missing in Salesforce org or what else.
Kindly help me with this.

If you are using custom label then 'Custom label' must already exist in targeting environment(where you are deploying the code through Jenkins).

I don't think you understand my question from comments.
If the apex class PermissionGuard contains references like Label.PERMISSION_DENIED_AN_OBJECT then:
that "custom label" must already exist in the target environment
or your deployment must be creating that custom label in the same action that creates/updates this class.
It's not a Jenkins problem. You're pulling the files from some Git repo or locally on filesystem? If the developer committed to Git only the class but not the custom labels file - shout at the dev that this is not deployable. Whether to scratch org, to sandbox or to production.
The labels\CustomLabels.labels file will look similar to this
<?xml version="1.0" encoding="UTF-8"?>
<CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata">
<labels>
<fullName>CommunityAccessSuspended</fullName>
<categories>Community, Login</categories>
<language>en_US</language>
<protected>false</protected>
<shortDescription>CommunityAccessSuspended</shortDescription>
<value>Your access is disabled. Please contact your site administrator.</value>
</labels>
</CustomLabels>
If the dev doesn't know how to download the fresh file from org, sfdx force:mdapi:retrieve -r ./mdapi -u yourUsername#yourCompany.com -k ./path/to/package.xml should be a good start.

Related

Can not integrate TeleStax Restcomm in MetaSwitch Clearwater

I really want to study how restcomm works in clearwater as a Telephony Application Server.
I follow the guideline at:
http://telestax.com/wp-content/uploads/2013/12/ClearWater-RestComm-Integration-2013.pdf
But seemly, the verion of Restcomm in this article is too old (TelScale-Restcomm-JBoss-AS7-7.1.2-GA), and I am using the Restcomm in newer version (Restcomm-JBoss-AS7-7.7.0.900).
I could not follow the guide in this article because of some difference configuration between two versions.
I set up the clearwater successfully. I could make a SIP call in clearwater.
When I setup the restcomm (version Restcomm-JBoss-AS7-7.7.0.900),
I changed the local-address of media-server in file: standalone/deployments/restcomm.war/WEB-INF/conf/restcomm.xml
as follow:
<media-server-manager>
...
<local-address>192.168.0.117</local-address>
...
</media-server-manager>
(192.168.0.117 is my local IP address)
I did not change the references to 127.0.0.1:8080 in restcomm.xml file to point to 192.168.0.117:8180
because there is no references to 127.0.0.1:8080.
I think that may be the difference between two versions.
I also did not edit the JAVA_OPTS in bin/standalone.conf file because of misunderstanding.
I edit the file mediaserver/deploy/server-beans.xml as follow:
<property name="bindAddress">192.168.0.117</property>
<property name="localBindAddress">127.0.0.1</property>
<property name="externalAddress"><null/></property>
<property name="localNetwork">192.168.0.0</property>
<property name="localSubnet">255.255.255.0</property>
After that, I start media-server:
$ cd ${JBOSS_HOME}/mediaserver/bin
$ ./run.sh
The media-server start successfully.
Then, I start restcomm jboss:
$ cd ${JBOSS_HOME}/bin
$ sudo ./standalone.sh -Djboss.socket.binding.port-offset=100 -b 192.168.0.117
It got errors as the below picture.
enter image description here
But Jboss server still work, when I goto http:/192.168.0.117:8180
But I can not access the Restcomm managerment interface.
I also try to modify somes as the article:
-Modify default app: standalone/deployments/restcomm.war/demos/hello-play.xml
<Response>
<Play>http://192.168.0.117:8180/restcomm/audio/demo-prompt.wav</Play>
</Response>
-Add configure IMS core through Ellis configure file:
{
"Restcomm" :
"<InitialFilterCriteria><Priority>1</Priority><TriggerPoint> <ConditionTypeCNF></ConditionTypeCNF><SPT><ConditionNegated>0</ConditionNegated><Group>0</Group><Method>INVITE</Method><Extension></Extension></SPT></TriggerPoint><ApplicationServer><ServerName>sip:192.168.0.117:5180</ServerName><DefaultHandling>0</DefaultHandling></ApplicationServer></InitialFilterCriteria>"
}
-Bind the number to defaul app:
curl -X POST http://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166#192.168.0.117:8180/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/IncomingPhoneNumbers.json -d "PhoneNumber=4321" -d "VoiceUrl=http://192.168.0.117:8180/restcomm/demos/hello-play.xml"
It got the error:
That are my problems.
Thank you very much for supporting me.
Best Regards,
Indeed those steps are way too old and won't probably work on the new version.
I would recommend starting Restcomm with Docker instead and configure the JVM options and port offset (see http://docs.telestax.com/restcomm-docker-environment-variables/) in the docker run command
The rest of the description to configure Clearwater should still be valid.

Where are the logs for Kaleo workflow error: An error occurred in the workflow engine

I would like to know where to see more details on this Kaleo workflow error: An error occurred in the workflow engine.
I modified the single-approver-definition.xml to assign tasks to approvers depending on the category of the web content but I am unable to find the error. I also used Liferay's categorisation definition but am getting the same error.
https://github.com/liferay/liferay-plugins/blob/master/webs/kaleo-web/docroot/WEB-INF/src/META-INF/definitions/category-specific-definition.xml
Thank you!
Replace the code :
<?xml version="1.0"?>
<workflow-definition xmlns="urn:liferay.com:liferay-workflow_6.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:liferay.com:liferay-workflow_6.1.0 http://www.liferay.com/dtd/liferay-workflow-definition_6_1_0.xsd">
in header code xml. It resolves the problem.

Create Virtual Machine using libvirt error related to AppArmor

I am trying to create a virtual machine using libvirt using the command:
virsh create file
Contents of "file":
<domain type='qemu' id='3'>
<name>testvm</name>
<memory>100</memory>
<vcpu>1</vcpu>
<os>
<type arch='i686'>hvm</type>
</os>
<devices>
<disk type='file' device='disk'>
<source file='/libtmp/VM-linux.0.2.img'/>
<target dev='hdc'/>
</disk>
</devices>
<on_reboot>restart</on_reboot>
<on_poweroff>preserve</on_poweroff>
<on_crash>restart</on_crash>
</domain>
Here is error which occur.
error: Failed to create domain from file
error: internal error cannot load AppArmor profile 'libvirt-9cb01efc-ed3b-ff8e-4de5-7227d311dd15'
I am able to create the vm without loading the image file.
Everytime the profile name keeps on changing. I tried stopping it and creating the vm but I got the same error.
Any pointers will be very helpful.
I had the same problem and the reason was that I had a bad idea to place readonly cdrom image to /etc like this:
<disk type="file" device="cdrom">
<driver name='qemu' type="raw" />
<source file="/etc/libvirt/qemu/cdrom.iso" />
<target dev='hdb' bus='virtio'/>
<readonly/>
</disk>
Moving to /var removed the error message and allowed to start the virtual machine. This line:
<source file="/var/lib/libvirt/images/cdrom.iso" />
This is a bug in libvirt. See https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/665531
Edit the xml definition of the virtual domain with "virsh edit domainname" command. Replace type='host_device' with type='raw' in the xml definition.
This is a work around but not the correct way. Set AppArmor to complain mode using following command:
sudo aa-complain /usr/sbin/libvirtd

How do I configure a static context path in jboss7?

I am trying to find a way to configure a static context path i jboss7. We are upgrading from jboss4.2 and in that version we had a config element in server.xml that looked like this:
<Host name="localhost"
autoDeploy="false" deployOnStartup="false" deployXML="false"
configClass="org.jboss.web.tomcat.security.config.JBossContextConfig"
>
<Context path="/directory/pdf"
docBase="/tmp/pdfdok"
reloadable="true">
</Context>
It was in the directory deploy\jboss-web.deployer.
The intention of this is to be able to reach the directory /tmp/pdfdok with a url like this: http://server:port/directory/pdf or more exactly to reach a generated pdf document on this directory with the url: http://server:port/directory/pdf/pdfdoc.pdf from a client popup window.
Is there someone here who can help me?
Thanks
Rune
It seems like this is impossible to do in jboss7. I solved my problem by using a fileservlet instead. This is a good page to look at for an example: http://balusc.blogspot.com/2007/07/fileservlet.html

CruiseControl.NET no connection can be made?

I am setting up CruiseControl.NET and I get the following error message on the webdashboard:
No connection could be made because the target machine actively refused it 127.0.0.1:21234
The Url it is looking for is: tcp://localhost:21234/CruiseManager.rem
However the ccnet website in IIS has its tcp port set to 82.
So I use the following Url to navigate to the webdashboard http://127.0.0.1:82/ccnet/ViewFarmReport.aspx
I tried changing the Tcp port in IIS to 21234 and I get the following error message on the webdashboard:
Tcp channel protocol violation: expecting preamble.
I have also tried opening the port with the following command:
netsh firewall add portopening TCP 21234 CCNET
When I try and start the CCNET service I get the following message
The CruiseControl.NET Server service started then stopped. Some services stop automatically if they have no work to do....
Can anyone help me with this problem please?
EDIT - Adding config file
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<cb:define PublishDir="C:\Deploy\Portal2.0Build"/>
<project name="Portal2.0">
<workingDirectory>C:\PortalCruiseControl\Working</workingDirectory>
<artifactDirectory>C:\PortalCruiseControl\Artifacts</artifactDirectory>
<webURL>http://192.168.17.59:82/ccnet</webURL>
<triggers>
<intervalTrigger name="continuous" seconds="10"
buildCondition="IfModificationExists"/>
</triggers>
<sourcecontrol type="svn">
<trunkUrl>https://portal2003.local:8443/svn/portalv2.0/trunk</trunkUrl>
<executable>C:\Program Files (x86)\VisualSVN Server\bin\svn.exe</executable>
<username>ccnet</username>
<password>***</password>
<cleanCopy>true</cleanCopy>
</sourcecontrol>
<tasks>
<msbuild>
<executable>
C:\WINDOWS\microsoft.net\Framework64\v3.5\MSBuild.exe
</executable>
<projectFile>Portal2.0.sln</projectFile>
<buildArgs>
/target:build;publish /p:Configuration=Release /p:MSBuildExtensionsPath=C:\Progra~2\MSBuild /p:MSBuildEmitSolution=1 /p:publishdir=C:\Deploy\Portal2.0Build /verbosity:diag
</buildArgs>
<logger>
C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll
</logger>
</msbuild>
</tasks>
<labeller type="assemblyVersionLabeller">
<major>2</major>
<minor>0</minor>
<incrementOnFailure>false</incrementOnFailure>
</labeller>
<publishers>
<statistics />
<xmllogger />
<package>
<name>ZipFilePublish</name>
<compression>9</compression>
<always>false</always>
<flatten>false</flatten>
<baseDirectory>$(PublishDir)</baseDirectory>
<dynamicValues>
<replacementValue property="name">
<format>C:\Deploy\Builds\PortalBuild{0}.zip</format>
<parameters>
<namedValue name="$CCNetLabel" value="Default" />
</parameters>
</replacementValue>
</dynamicValues>
<files>
<file>*.*</file>
<file>**\*</file>
</files>
</package>
<email from="bla" mailhost="bla" port="25" userName="bla"
password="bla" includeDetails="TRUE" useSSL="FALSE">
<users>
<user name="User1" group="Portal" address=""/>
</users>
<groups>
<group name="Portal">
<notifications>
<notificationType>change</notificationType>
</notifications>
</group>
</groups>
</email>
</publishers>
</project>
The first error message is probably caused by CCNET service not running because of which the web dashboard can't connect to it. It should go away as soon as you fix the ccnet.config so that service starts running.
The second problem ("Ilegal characters in path"; you seem to have already figured out the missing nodes part) is caused by msbuild/executable element. It seems that CC.NET doesn't like whitespace and especially new line characters inside it's value. Replacing:
<executable>
C:\WINDOWS\microsoft.net\Framework64\v3.5\MSBuild.exe
</executable>
with:
<executable>C:\WINDOWS\microsoft.net\Framework64\v3.5\MSBuild.exe</executable>
should fix the problem.
Another hint: when you're having problems with the validity of your ccnet.config file, try using CCValidator.exe (it's in your CruiseControl.NET\server folder). It usually points out the problematic part of the config file quite nicely (although that wasn't the case with "Illegal characters in path" problem - I had to comment out specific parts of the config to find the offending node).
The first message you receive (connection actively refused) makes me think of a firewall which is blocking the port you're using.
The second problem could be anything. It could for instance be an error in your XML configuration (ccnet.config) file. Can you find any pointers in the Windows Eventlog ?
Regarding the 2nd problem: did you try to run the CC.NET server from the command line?
If you've got an error in your XML configuration, this will give you a more meaningful error message.
Which account are you using to run the Windows service?
Have you checked your ccnet's dashboard.config file?
It has the following line in it:
<server name="local" url="tcp://localhost:21234/CruiseManager.rem" ... />
Try changing the port on that to 82 and then restarting the website (you should be just able to add a space to the web.config file and save and IIS will restart the website).
Sounds like you're confusing two different functions:
tcp://localhost:21234
This is the default remoting port for clients like CCTray. This is not used for the IIS web site (dashboard).
Configuration document is likely missing Xml nodes required for properly populating CruiseControl co nfiguration. Missing Xml node (packageList) for required member (ThoughtWorks.CruiseControl.Core.Publishers.Package Publisher.PackageList)
Your example config is missing required packageList node.
A misleading error message. The port really is 21234, not 82. I got the same errors. The fix was to start ccnet.exe from the desktop shortcut to discover that the real problem was illegal code in my ccnet.config file.
After fixing the ccnet.config file, the problem moved on. When attempting to build, the system would not let the subversion client modify the read-only marker files in the checked out repo.
In my case I misprinted project configuration file name in ccnet.config instead of timescheduler.config it were timesheduler. When I fixed file name I was able to run ccnet service.
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<cb:include href="definitions.xml" xmlns:cb="urn:ccnet.config.builder"/>
<cb:include href="projects/timescheduler.config" xmlns:cb="urn:ccnet.config.builder"/>
</cruisecontrol>