Code Monkey home page Code Monkey logo

mms-alfresco's Introduction

Model Management System

Language Grade: Java CircleCI

The MMS AMP is a hosted application run atop the community version of an Alfresco Enterprise Content Management Server.

NOTE 1: AMPs for Alfresco as built from this maven project are meant to be run by Alfresco Community Edition v5.1.g (AKA 201605-GA)

Per Alfresco's documentation on Modules, Alfresco Module Packages (AMPs) are installed using the Module Management Tool MMT jar file. The latest version of the two AMPs you will be "exploding" into the "alfresco" and "share" WARs resident within the embedded Tomcat server are available via the download links leading to the two interdependent portions named "mms-repo.amp" and "mms-share.amp", relating to "alfresco.war" and "share.war", respectively.

Download of the alfresco WAR related portion of the "MMS" Alfresco module.

Download of the share WAR related portion of the "MMS" Alfresco Module.

In tandem with the EMS-Webapp (colloquially known as the View Editor), and the Magicdraw Development Kit (MDK) for MagicDraw client and Teamwork Cloud users; this github repo serves as a one-stop shop to set up the Model Management Server per the MMS-MDK-VE Compatibility Matrix.

Developer Setup

Dependencies

  • ElasticSearch 5.x (Up to 5.5)
  • PostgreSQL 9.x (Up to 9.4 is using PostgreSQL for Alfresco)

Optional Dependencies (optional if using MDK 3.3.3+, only needed for VE realtime updates)

  • ActiveMQ 5.X

1a. Using Intellij

  • Open Project with root of 'mms'
  • Import Maven Project
  • Open Project Structure and Import Module "mms-ent" and set to find projects recursively

1b. Import Project from git repo to Eclipse

  • Eclipse > File > Import > General > Existing Projects into Workspace
  • Set 'Root Directory' as the path to mms e.g. Browse to $HOME/workspace/mms
  • In the 'Projects' list, you should see all poms. Click Finish

1c. Import Maven Project into Eclipse

  • Eclipse > File > Import > Maven > Existing Maven Projects
  • Set 'Root Directory' as the path to mms e.g. Browse to $HOME/workspace/mms/mms-ent
  • In the 'Projects' list, you should see all poms. Click Finish

2. Configure Eclipse to use Maven 3.X.X

  • Eclipse > Window > Preferences > Maven > Installation
  • Toggle Maven 3.X.X
    • If Maven 3.X.X is not listed, download and install it.
    • On a Mac, install it at /usr/local/Cellar/maven.
    • On a Linux, anywhere in your $PATH.
  • Return to Eclipse > Window > Preferences > Maven > Installation
  • Choose Add...
    • Browse and select Maven 3.X.X installed location.
    • Location is the maven home that you can get by running the newly installed maven, with mvn -V

3. Configure Run Configuration**

  • Select mms-ent project
  • From menu bar, choose Run > Run Configurations
  • Right-click Maven Build > New
    • Enter mms for Name textbox
    • At Main tab
      • Enter ${project_loc} or ${workspace_loc} for Base Directory textbox
      • Enter install for Goals textbox
      • Enter run for Profiles textbox
      • Select Maven 3.X.X (whatever you chose to setup in step 2) for Maven Runtime
    • At JRE tab
      • Select Java 8 for JRE.
      • If it's not installed, download and install Java 8. Afterward, return to here and select Java 8.

Install Dependencies

1. Install and Configure ElasticSearch

  • Download ElasticSearch 5.X
  • Install ElasticSearch
  • Start ElasticSearch then run mms-ent/repo-amp/src/main/resources/mms-mappings.sh

2. Install and Configure PostgreSQL

  • Download PostgreSQL 9.x
    • If using PostgreSQL as the database for Alfresco, PostgreSQL 9.4 is the latest supported version
  • Install PostgreSQL
  • Start PostgreSQL server
  • Connect to the PostgreSQL server and:
    • Create a mms user (referenced by pg.user in your mms-ent/mms.properties file)
      • Ensure you set a password (referenced by pg.pass)
    • Create a mms database ( referenced by pg.name)
  • Execute mms-ent/repo-amp/src/main/resources/mms.sql
    • windows CMD e.g.: psql -h localhost -p 5432 -U mms -d mms -v schema=public < C:\path\to\mms\repo\mms.sql

3. Install and Configure ActiveMQ

  • Download ActiveMQ 5.X
  • Install ActiveMQ
  • Start ActiveMQ service

Running

1a. Running Alfresco

  1. Select file menu Run > Run Configurations
  2. Expand Maven Build
  3. Select mms
    1. Click Run button
    • If you get error:-Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HOME environment variable and mvn script match. Goto Window -> Preference -> Java -> Installed JREs -> Edit -> Default VM arguments set -Dmaven.multiModuleProjectDirectory=$M2_HOME

1b. Running Alfresco

  1. From mms-ent directory, either run clean-run.sh, run.sh, or ./mvnw install -Prun -Ddependency.surf.version=6.3

2. Testing Alfresco

  1. Enter http://localhost:8080/share/ at a browser's url address textbox.
  2. Enter admin for user name
  3. Enter admin for password

Design Documentation

1. MMS using ElasticSearch and PostgreSQL


General Design

+----------------+   \
| REST API Layer |    \
|----------------|     \
|   WebScripts   |      MMS
|----------------|     /
|Storage | Layer |    /
+----------------+   /
  /\         /\
  ||         ||
  \/         \/
+-----+    +----+
| RDB |    | ES |
+-----+    +----+
(Graph)    (Data)

2. Configuration Schema

  • Global PG database called 'mms' holds configuration information per project
  • Contains Org, Project, and DB Location information

3. Graph Database

  • Each project has it's own database configured in the mms database

  • All graph related information stored in relational database

  • Schema defined in mms.sql

    • Nodes
    • Edges
    • Edge types
    • Node types
    • Commits
    • Refs
  • Functions defined that are recursive for getting parents, children etc.

  • All access to the graph is done via the PostgresHelper that contains functions to interface with the database

  • The graph should never be manipulated directly from anywhere else

The nodes in the graph contain pointers to ElasticSearch documents which contain the real information * Same goes for other things such as configurations or commits

Each of these pointers is the “latest one” * Because for a given SYSMLID there can be multiple documents for each version of that node

The history of each node can be retrieved via a query to ElasticSearch (see ElasticHelper.java)

4. Graph Schema

Nodes and edges both have a type associated with them The type must exist in the NodeTypes and EdgeTypes tables

  • Correspondingly, the types also exist in the PostgresHelper code
  • Each node can be assigned a particular type, by default it is just element
  • Each edge can be assigned a particular type, containment being the basic type

Some assertions about the graph:

  • It is always the case that each node in the graph has a single containment parent
    • If you have multiple, something wrong happened!
  • Multiple root parents are only possible for not containment type edges
  • There should never be any orphan nodes in the graph
    • Always have either children or parents
  • All elastic references in the graph must exist in ES

5. Graph

Structure of the graph for each "project"

           +---------+
        +--| Commits |
+===+   |  +---------+          +-------------+    +----------+
| P |   |                   +---| Holding bin |----| Elements |
| R |   |  +-------+        |   +-------------+    +----------+
| O |   +--| Nodes |--------|
| J |   |  +-------+        |   +----------+
| E |   |                   +---| Elements |
| C | --|  +-------+            +----------+
| T |   +--| Edges |
|   |   |  +-------+
|   |   |
|   |   |  +----------------+
+===+   +--| Refs           |
           +----------------+

6. Example webscript in new world: modelpost

Create instance of EmsNodeUtil Get all other relevant information, validation, etc. form request Figure out if the elements are to go to the holding bin or not Calculate the qualified name and ID information for each node Add metadata for each element Store elements in ES Update graph Create JSON response and return

7. Example webscript in new world: modelget

Create instance of EmsNodeUtil Get all other relevant information, validation, etc. form request Access PG to get the ElasticSearch IDs for all documents that we are interested in Access ES via ElasticHelper and get those IDs Create JSON response and return

8. General Pattern for WebScripts

Create instance of EmsNodeUtil Get all other relevant information, validation, etc. form request Understand how to:

  • Add information to ES
  • Update the graph with the corresponding information from ES

All the work is to be done here for each webscript. The pre and post should always be the same.

Create JSON response and return

Testing

Initializing Organizations, Projects, and test elements

Use the following curl commands to post an initial organization + project:

curl -w "\n%{http_code}\n" -H "Content-Type: application/json" -u admin:admin --data '{"orgs": [{"id": "vetest", "name": "vetest"}]}' -X POST "http://localhost:8080/alfresco/service/orgs"
curl -w "\n%{http_code}\n" -H "Content-Type: application/json" -u admin:admin --data '{"projects": [{"id": "123456","name": "vetest","type": "Project"}]}' -X POST "http://localhost:8080/alfresco/service/orgs/vetest/projects"

Then you can post some elements. For convenience, there is a json file in runner/src/test/robotframework/JsonData. Using the project from above:

curl -w "\n%{http_code}\n" -H "Content-Type: application/json" -u admin:admin --data @JsonData/PostNewElements.json -X POST "http://localhost:8080/alfresco/service/projects/123456/refs/master/elements"

Make sure the elements went in:

curl -w "\n%{http_code}\n" -H "Content-Type: application/json" -u admin:admin -X GET "http://localhost:8080/alfresco/service/projects/123456/refs/master/elements/123456?depth=-1"

Robotframework test suite

Robot tests can be run with the following maven profiles in the mms-ent directory:

./mvnw install -Prun,robot-tests

Please note that tests should be run on a clean instance, therefore, it may be helpful to run clean.sh before running the tests

The Robotframework tests require the 'requests' and 'robotframework-requests' python modules. Install it as follows:

pip install --target=runner/src/test/robotframework/libraries requests
pip install --target=runner/src/test/robotframework/libraries robotframework-requests

OR:

pip install --target=$HOME/.m2/repository/org/robotframework/robotframework/{ROBOTPLUGINVERSION}/Lib requests
pip install --target=$HOME/.m2/repository/org/robotframework/robotframework/{ROBOTPLUGINVERSION}/Lib robotframework-requests

Changing debug levels on the fly

If you need to change debug levels on the fly, use the following endpoint.

alfresco/service/loglevel

It takes as input JSON that specifies the classes and the log levels. For example:

[
  {
    "classname": "gov.nasa.jpl.view_repo.webscripts.ModelGet",
    "loglevel": "DEBUG"
  }
]

API Documentation

API Documentation is located at the following endpoints:

Swagger CodeGen:

alfresco/mms/index.html

Swagger UI:

alfresco/mms/swagger-ui/index.html

Swagger YAML file:

alfresco/mms/mms.swagger.yaml

Migrations after 3.2

For versions after 3.2, most notably 3.3.0, an automigration step has been included to run necessary migrations automatically during the initial startup of alfresco after the upgrade. Should this migration fail for any reason, you can trigger the migration manually by accessing the following endpoint:

alfresco/service/migrate/{targetVersion}

where {targetVersion} is the version that you are upgrading to. Example:

alfresco/service/migrate/3.3.0

This operation is idempotent and can be safely run multiple times.

Deployment Requirements

For deploying MMS and VE five machines are recommended + 1 optional TeamWorkCloud machine.

The given configuration below are in terms of AWS instances which define required CPU and RAM, assuming CentOS as operating system.

Data is stored using Amazon EBS volumes, where 100GB is a good start.

For Postgres Amazon's RDS service is used, where 10-15 GB is a good start.

The minimal configuration (can handle about 300k elements) is

  • 1x t3.large for MMS (8GB)
  • 1x t3.large for RDS postgres service (8GB)
  • 3x t3.medium for Elastic cluster (4GB), t3.large for better performance.
  • 1x AWS elb service - load balancer for elastic cluster
  • EBS storage for data (100 GB)

For a single machine configuration you need one which is powerful enough to cover the above.

A 64 GB configuration can hold about 2 billion elements but might be slow, so you might want to switch to a powerful CPU configuration:

t3.xlarge -> r5.large -> r5.xlarge

Contributing

To learn how you can get involved in a variety of ways, please see Contibuting to OpenMBEE.

mms-alfresco's People

Contributors

ba-mbse avatar borromeotlhs avatar dlamoris avatar edkarlsson avatar enquier avatar eric2416 avatar gpgreen avatar huijun avatar ivan-gomes avatar jlleitschuh avatar lauraerinmann avatar working-matt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mms-alfresco's Issues

"javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated" when running docker image on localhost

Hi,

I've set up MMS on my local machine, created a local user on Alfresco with appropriate rights (site admin, alfresco admin), and was able to successfully log in to the local MMS instance through MDK. However, after validating a test model, and selecting to create and commit project to server (as per the instructions), I receive a HTTP 500 response upon trying to create a new group for a site during the commit. Upon closer inspection of the logs, I noticed the following exception:

 2019-02-15 01:14:04,438  INFO  [view_repo.webscripts.OrgPost] [http-bio-8080-exec-22] {"orgs":[{"id":"d09fb697-d793-42f8-85fb-5592b6488dcd","name":"Test Org"}],"source":"magicdraw","mdkVersion":"3.4.0"}
 2019-02-15 01:14:04,457  INFO  [webscripts.util.ShareUtils] [http-bio-8080-exec-22] Repo URL: https://localhost:8443/alfresco
 2019-02-15 01:14:04,458  INFO  [webscripts.util.ShareUtils] [http-bio-8080-exec-22] Share URL: https://localhost:8443/share
 2019-02-15 01:14:04,459  INFO  [webscripts.util.ShareUtils] [http-bio-8080-exec-22] Login URL: https://localhost:8443/share/page/dologin
 2019-02-15 01:14:04,459  INFO  [webscripts.util.ShareUtils] [http-bio-8080-exec-22] Create Site URL: https://localhost:8443/share/page/modules/create-site
 2019-02-15 01:14:04,459  INFO  [webscripts.util.ShareUtils] [http-bio-8080-exec-22] Update Group URL: https://localhost:8443/alfresco/service/api/groups
 2019-02-15 01:14:04,479  ERROR [webscripts.util.ShareUtils] [http-bio-8080-exec-22] Failed to Login to Alfresco Share

javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
	at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:440)
	at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:244)
	at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:108)
	at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:149)
	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
	at gov.nasa.jpl.view_repo.webscripts.util.ShareUtils.makeSharePostCall(ShareUtils.java:158)
	at gov.nasa.jpl.view_repo.webscripts.util.ShareUtils.constructSiteDashboard(ShareUtils.java:110)
	at gov.nasa.jpl.view_repo.webscripts.OrgPost.executeImplImpl(OrgPost.java:118)
	at gov.nasa.jpl.view_repo.webscripts.OrgPost.executeImpl(OrgPost.java:78)
	at gov.nasa.jpl.view_repo.webscripts.DeclarativeJavaWebScript.execute(DeclarativeJavaWebScript.java:98)
	at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:512)
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)
	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:580)
	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:649)
	at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:421)
	at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:301)
	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:382)
	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:210)
	at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1139)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)

 2019-02-15 01:14:04,479  ERROR [webscripts.util.ShareUtils] [http-bio-8080-exec-22] Could not login to share site
 2019-02-15 01:14:04,479  INFO  [view_repo.webscripts.AbstractJavaWebScript] [http-bio-8080-exec-22] [INFO]: Failed to create site.

 2019-02-15 01:14:04,480  ERROR [view_repo.webscripts.OrgPost] [http-bio-8080-exec-22] Failed site info: Test Org, , d09fb697-d793-42f8-85fb-5592b6488dcd

I've tried this both with a local project, and with a project on a TWC server. I've also tried this with MDK 3.6.0 and 3.4.0 (the docker image version is 3.4.2). I've also tried it with two separate MagicDraw installs (I have certs configured in one of these for access to a private TWC instance).

My assumption is that SOLR is configured to run using SSL, but there's no appropriate certificate available in the docker container.

I should notice that I'm running all of this on a Mac - Docker on Mac has a few quirks that I already had to work around... hopefully this is not due to one of the limitations of Docker on Mac.

Is there a way to configure SOLR and Alfresco not to use SSL at all (this is a dev machine only)? Or would I have to clone this repo, change the configuration files, and rebuild the docker image? I'm not terribly familiar with docker, so perhaps I've overseen something, too. Any help would be very much appreciated.

Sebastian

Precompiled Amp and War files of latest build

Are there any precompiled amp and war files from the latest build?
We are having issues due to the strict network security at OrbitalATK and are unable to connect from the server on their network when we run the configuration.
Even if the server is set to reach out to the internet, we have certificate issues that prevent the build of the mms.
If we had a precompiled version, artifacts to deploy an instance, this would help greatly.

V/r,
David Blamire
[email protected]

`overwrite=true` query param on POST requests to `/projects/{project_id}/refs/{ref_id}/elements`

I don't believe the query param overwrite=true on POST requests to /projects/{project_id}/refs/{ref_id}/elements is supported by the mms python client. The API docs (https://mms.openmbee.org/alfresco/mms/index.html#api-Element-postElements) also don't include it as a parameter. The swagger generated python client currently rejects the parameter – likely because it is not included in the OpenAPI spec.

Are there plans to update the OpenAPI spec to include this parameter? It has been recommended that we include this parameter in POST requests but are currently unable to via the mms_python_client.

python 3.7
mms_python_client 4.0.0a3
MMS 3.3.0 (I think) - Service URL: https://mms.openmbee.org/alfresco/service

Error after installing the amps to war files and running alfresco

The current setup that the server is using.
Centos 6
Tomcat 7.0.78
Alfresco Community 5.0.d
ActiveMQ 5.14.5
Elasticsearch 5.4.1
PostgresQL-9.3

Issue after installing the amps to war files and running alfresco

2017-06-23 16:50:34,680 ERROR [solr.tracker.AbstractTracker] [SolrTrackerScheduler_Worker-1] Model tracking failed
org.alfresco.error.AlfrescoRuntimeException: 05230000 GetModelsDiff return status is 404
at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1091)
at org.alfresco.solr.tracker.ModelTracker.trackModelsImpl(ModelTracker.java:249)
at org.alfresco.solr.tracker.ModelTracker.trackModels(ModelTracker.java:207)
at org.alfresco.solr.tracker.ModelTracker.ensureFirstModelSync(ModelTracker.java:229)
at org.alfresco.solr.tracker.CoreWatcherJob.registerForCore(CoreWatcherJob.java:131)
at org.alfresco.solr.tracker.CoreWatcherJob.execute(CoreWatcherJob.java:74)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)

"Alfresco Share" link isn't working at /alfresco path

If you try to access the /alfresco path, you will see a page with a bunch of links. The second and third links are "Alfresco share" and "Aflresco webDAV".

I've notice that clicking on the share link fails to resolve, as the url has 'localhost' in it. However, the webDAV link works fine. I think that both should correctly resolve to the whatever IP address or url that webDAV is dynamically calculating.

org.alfresco.error.AlfrescoRuntimeException: 09050000 GetModelsDiff return status is 404 while running the Alfresco

I have imported mms project as a maven project from git hub and followed the instructions given in its README file to run and test Alfresco. While testing the application I have entered http://localhost:8080/share/ for which I am successfully getting the login page for Alfresco. But when I am giving the default username and password (i.e. admin and admin) I am not able to login to the application. Getting an error "Your authentication details have not been recognized or Alfresco may not be available at this time." When I checked the console and the Alfresco log file, I found org.springframework.beans.factory.BeanCreationException followed by org.alfresco.error.AlfrescoRuntimeException: 09050000 GetModelsDiff return status is 404.

Installed the following:

Apache Tomcat 7.0 version

PostgreSQL 9.4

Also installed the dependencies needed for the project(Elastic Search6.4 and ActiveMQ5.0).

Working on Java8.

Can anyone please help me out in solving the problem?

Thanks in advance.

Importing MDK project

Hi,
I am having trouble while setting up the workspace for mdk project. I have imported the project as a java project but I can observe a lot of errors in my workspace. So can you let me know how should I import the project (i.e. as a java project or maven project) as there is no README.md file given for the mdk project.
I couldn't find where can I post my question regarding mdk project as there is no Issues tab for MDK project.
So can you please help me out in resolving the problem?

Also, I have one query regarding the MMS project. How are MMS and Alfresco related to each other?
Because if I log in to the Alfresco with username and password as "admin" and "admin" I cannot find any details regarding the MMS project? Where can I find the details of MMS project after login to Alfresco?

Thanks

Incorrect value for embedded LiteralInteger elements when using REST API

We have found that MMS returns double value in case of LiteralInteger attributes if listing all elements in project ( GET ../elements operation ) but returns the correct value when retrieving only a single element (GET ../elements/{id} operation). This seems to happen only with LiteralInteger in our tests. The issue is reproducible with a project on the public OpenMBEE MMS (see API requests below).

Example

  • Listing all element from the latest commit of IQS4MMS Demos / TMT / master project:
    https://mms.openmbee.org/alfresco/service/projects/PROJECT-0e791c0e-16fe-422f-8f85-462ab035ce99/refs/master/elements contains
{
      "_appliedStereotypeIds": [],
      "documentation": "",
      "type": "Slot",
      "id": "_18_5_2_e64033a_1510706944742_970575_60595-slot-_18_0_5_c0402fd_1475170761179_993827_168566",
      "mdExtensionsIds": [],
      "ownerId": "_18_5_2_e64033a_1510706944742_970575_60595",
      "syncElementId": null,
      "appliedStereotypeInstanceId": null,
      "value": [
        {
          "_appliedStereotypeIds": [],
          "documentation": "",
          "type": "LiteralInteger",
          "id": "_18_5_2_e64033a_1510706944742_970575_60595-slot-_18_0_5_c0402fd_1475170761179_993827_168566-slotvalue-0-literalinteger",
          "mdExtensionsIds": [],
          "ownerId": "_18_5_2_e64033a_1510706944742_970575_60595-slot-_18_0_5_c0402fd_1475170761179_993827_168566",
          "syncElementId": null,
          "appliedStereotypeInstanceId": null,
          "clientDependencyIds": [],
          "supplierDependencyIds": [],
          "name": "",
          "nameExpression": null,
          "visibility": null,
          "templateParameterId": null,
          "typeId": null,
          "value": 1.0
        }
      ],
      "definingFeatureId": "_18_0_5_c0402fd_1475170761179_993827_168566",
      "_projectId": "PROJECT-0e791c0e-16fe-422f-8f85-462ab035ce99",
      "_refId": "master",
      "_inRefIds": [
        "master"
      ],
      "_creator": "ahegedus",
      "_created": "2019-06-06T11:41:13.310+0000",
      "_elasticId": "43cc5b6f-4274-4eeb-9302-3ff1b773b10c",
      "_commitId": "03afd6ed-8180-478d-a13c-2f45973519bc",
      "_modifier": "ahegedus",
      "_modified": "2019-06-06T11:41:13.310+0000",
      "_editable": false
    }
  • Requesting only one of the problematic elements:
    https://mms.openmbee.org/alfresco/service/projects/PROJECT-0e791c0e-16fe-422f-8f85-462ab035ce99/refs/master/elements/_18_5_2_e64033a_1510706944742_970575_60595-slot-_18_0_5_c0402fd_1475170761179_993827_168566
{
  "elements": [
    {
      "_appliedStereotypeIds": [],
      "documentation": "",
      "type": "Slot",
      "id": "_18_5_2_e64033a_1510706944742_970575_60595-slot-_18_0_5_c0402fd_1475170761179_993827_168566",
      "mdExtensionsIds": [],
      "ownerId": "_18_5_2_e64033a_1510706944742_970575_60595",
      "syncElementId": null,
      "appliedStereotypeInstanceId": null,
      "value": [
        {
          "_appliedStereotypeIds": [],
          "documentation": "",
          "type": "LiteralInteger",
          "id": "_18_5_2_e64033a_1510706944742_970575_60595-slot-_18_0_5_c0402fd_1475170761179_993827_168566-slotvalue-0-literalinteger",
          "mdExtensionsIds": [],
          "ownerId": "_18_5_2_e64033a_1510706944742_970575_60595-slot-_18_0_5_c0402fd_1475170761179_993827_168566",
          "syncElementId": null,
          "appliedStereotypeInstanceId": null,
          "clientDependencyIds": [],
          "supplierDependencyIds": [],
          "name": "",
          "nameExpression": null,
          "visibility": null,
          "templateParameterId": null,
          "typeId": null,
          "value": 1
        }
      ],
      "definingFeatureId": "_18_0_5_c0402fd_1475170761179_993827_168566",
      "_projectId": "PROJECT-0e791c0e-16fe-422f-8f85-462ab035ce99",
      "_refId": "master",
      "_inRefIds": [
        "master"
      ],
      "_creator": "ahegedus",
      "_created": "2019-06-06T11:41:13.310+0000",
      "_elasticId": "43cc5b6f-4274-4eeb-9302-3ff1b773b10c",
      "_commitId": "03afd6ed-8180-478d-a13c-2f45973519bc",
      "_modifier": "ahegedus",
      "_modified": "2019-06-06T11:41:13.310+0000",
      "_editable": false
    }
  ]
}
  • Comparing JSON representations of the same element:
    image

Attached logs of solr.aclTracker error.

The current setup that the server is using.
RHEL 6.6
Tomcat 7.0.78
Alfresco Community 5.0.d
ActiveMQ 5.14.5
Elasticsearch 5.4.1
PostgresQL-9.3
Issue after installing the amps to war files and running alfresco

Logs.txt

ERROR [solr.tracker.AclTracker] [SolrTrackerScheduler_Worker-3] First acl transaction was not found with the correct timestamp.
2017-07-19 11:15:00,106 ERROR [solr.tracker.AclTracker] [SolrTrackerScheduler_Worker-2] First acl transaction was not found with the correct timestamp.
2017-07-19 11:15:00,106 ERROR [solr.tracker.AclTracker] [SolrTrackerScheduler_Worker-2] SOLR has successfully connected to your repository however the SOLR indexes and repository database do not match.

No smtp settings option in mms.properties (and associated code to dynamically set this)

I noticed this error when I tried to invite someone to be an admin of an alfresco site (as a backdoor means of getting to the external alfresco URL):
2017-05-10 15:37:46,362 INFO [web.scripts.ImapServerStatus] [http-bio-8080-exec-14] Successfully retrieved IMAP server status from Alfresco: disabled
2017-05-10 15:59:22,936 WARN [security.person.PersonServiceImpl] [http-bio-8080-exec-17] PersonService.getPeopleFilteredByProperty() is being called to find people by {http://www.alfresco.org/model/content/1.0}email. Only PROP_FIRSTNAME, PROP_LASTNAME, PROP_USERNAME are now used in the search, so fewer nodes may be returned than expected of there are more than 100 users in total.
2017-05-10 15:59:23,222 ERROR [action.executer.MailActionExecuter] [http-bio-8080-exec-17] Failed to send email to @.*** : org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.jpl.nasa.gov, 25; timeout -1;
nested exception is:
java.net.UnknownHostException: smtp.jpl.nasa.gov. Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.jpl.nasa.gov, 25; timeout -1;
nested exception is:
java.net.UnknownHostException: smtp.jpl.nasa.gov; message exceptions (1) are:
Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.jpl.nasa.gov, 25; timeout -1;
nested exception is:
java.net.UnknownHostException: smtp.jpl.nasa.gov
2017-05-10 15:59:38,787 WARN [security.person.PersonServiceImpl] [http-bio-8080-exec-17] PersonService.getPeopleFilteredByProperty() is being called to find people by {http://www.alfresco.org/model/content/1.0}email. Only PROP_FIRSTNAME, PROP_LASTNAME, PROP_USERNAME are now used in the search, so fewer nodes may be returned than expected of there are more than 100 users in total.
2017-05-10 15:59:38,868 ERROR [action.executer.MailActionExecuter] [http-bio-8080-exec-17] Failed to send email to [email protected] : org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.jpl.nasa.gov, 25; timeout -1;
nested exception is:
java.net.UnknownHostException: smtp.jpl.nasa.gov. Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.jpl.nasa.gov, 25; timeout -1;
nested exception is:
java.net.UnknownHostException: smtp.jpl.nasa.gov; message exceptions (1) are:
Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.jpl.nasa.gov, 25; timeout -1;
nested exception is:
java.net.UnknownHostException: smtp.jpl.nasa.gov

This makes me realize that 'mms.properites.example' doesn't have a section for IMAP settings, and I can't find the page to alter settings from the admin-console.

solr4 configuration SEVERE error after installing the amps to war files and running alfresco

The current setup that the server is using.
Centos 6
Tomcat 7.0.78
Alfresco Community 5.0.d
ActiveMQ 5.14.5
Elasticsearch 5.4.1
PostgresQL-9.3

Issue after installing the amps to war files and running alfresco

SEVERE: Exception starting filter Office Services Authentication Filter
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'AosAuthenticationFilter' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:575)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1111)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:276)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
at org.alfresco.repo.web.filter.beans.BeanProxyFilter.init(BeanProxyFilter.java:64)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4854)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5542)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Jun 23, 2017 4:49:06 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter Office Services Filter
java.lang.ClassNotFoundException: org.alfresco.enterprise.repo.officeservices.service.ServiceFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4854)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5542)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Jun 23, 2017 4:49:06 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error filterStart

ShareUtils is using alfresco settings for share settings

In file: mms/mms-ent/repo-amp/src/main/java/gov/nasa/jpl/view_repo/webscripts/util/ShareUtils.java the initializeUrls() method is setting the share properties to the alfresco properties.

You can see this in the initializeUrls() code snip here:

`if (SHARE_URL == null) {
SysAdminParams adminParams = services.getSysAdminParams();
// int repoPort = adminParams.getAlfrescoPort();
int repoPort = 8080;
int sharePort = repoPort;
// String protocol = adminParams.getAlfrescoProtocol();
String protocol = "http";
String host = adminParams.getAlfrescoHost();

        REPO_URL = String.format("%s://%s:%s/alfresco", protocol, host, repoPort);
        SHARE_URL = String.format("%s://%s:%s/share", protocol, host, sharePort);` 

This prevents being able to run the share and the repo on different servers.

It appears that there are already methods available to get the share information needed within this file: repo-amp/src/main/java/gov/nasa/jpl/view_repo/webscripts/HostnameGet.java

Created Artifact not returned in GET response

I’m running into an issue with artifacts uploaded to MMS. I am able to create the artifact just fine (it appears) via the POST endpoint but I can’t find it via the ViewEditor search. The GET /projects/{project_id}/refs/{ref_id}/artifacts endpoint also returns an empty list while GET /projects/{project_id}/refs/{ref_id}/artifacts/{artifact_id} does return the artifact - which I am assuming is related to the ViewEditor search issue.

Please note that I’m experiencing this same issue through Swagger-UI.

Response from POST:

{
  "artifacts": [
    {
      "id": "test_image_1",
      "name": "Test Image",
      "type": "Artifact",
      "contentType": "image/png",
      "artifactLocation": "/service/api/node/content/workspace/SpacesStore/a33948a9-6fe2-45b4-97f2-b41148f5451b/test_image_11607644045333..png",
      "checksum": "ae3fc770889a2fbb0319086e1e11959c",
      "_projectId": "PROJECT-3068bfaf-eb2f-4972-8576-4aac1ddcbb79",
      "_refId": "master",
      "_inRefIds": [
        "master"
      ],
      "_creator": "swelsh",
      "_created": "2020-12-10T23:47:25.424+0000",
      "_elasticId": "97edb908-4e70-42a4-b560-a0b643a07d0b",
      "_commitId": "8fb6348e-b2d7-42f7-8d48-113f9eeb1282",
      "_modifier": "swelsh",
      "_modified": "2020-12-10T23:47:25.424+0000",
      "_editable": true
    }
  ],
  "_commitId": "8fb6348e-b2d7-42f7-8d48-113f9eeb1282",
  "_timestamp": "2020-12-10 23:47:25.424",
  "_creator": "swelsh"
}

GET Request and Response [200]:
curl -X GET "https://mms.openmbee.org/alfresco/service/projects/PROJECT-3068bfaf-eb2f-4972-8576-4aac1ddcbb79/refs/master/artifacts" -H "accept: image/png" -H "authorization: Basic REDACTED"

{
  "artifacts": []
}

Syntax error in mms-python-client 3.4.3

Steps to reproduce

  1. Use Python 3.7 or 3.8 (although I think any version after 3.5 will lead to the same problem)
  2. Install mms-python-client 3.4.3 from https://pypi.org/project/mms-python-client/3.4.3/
  3. import mms-python-client

Expected behaviour

Import is successful

Observed behaviour

Syntax error, due to Python keyword async appearing as an identifier in the generated Python code.

  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/mms_python_client/api/artifact_api.py", line 137
    async=params.get('async'),
        ^
SyntaxError: invalid syntax

Triage

Used to work correctly with mms-python-client 3.4.2.1

See also

OpenAPITools/openapi-generator#7119

Elastic: [status] is already used

I have installed like described here: https://hub.docker.com/r/openmbeeguest/mms-repo

I am getting the following Error in elastic container log;
[ERROR][o.e.x.w.e.ExecutionService] [Jow4GKm] failed to update watch record [tU-73A-NQo6r2m_pwwroXQ_elasticsearch_cluster_status_9746187a-4fb2-4d30-ab16-1f216041af98-2020-05-04T08:49:53.352Z] java.lang.IllegalArgumentException: [status] is defined as an object in mapping [doc] but this name is already used for a field in other types at org.elasticsearch.index.mapper.MapperService.checkFieldUniqueness(MapperService.java:570) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:394) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:336) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:260) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$1.execute(MetaDataCreateIndexService.java:383) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:45) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.cluster.service.ClusterService.executeTasks(ClusterService.java:634) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.cluster.service.ClusterService.calculateTaskOutputs(ClusterService.java:612) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.cluster.service.ClusterService.runTasks(ClusterService.java:571) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.cluster.service.ClusterService$ClusterServiceTaskBatcher.run(ClusterService.java:263) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569) [elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:247) ~[elasticsearch-5.6.0.jar:5.6.0] at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:210) ~[elasticsearch-5.6.0.jar:5.6.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_141] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_141] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_141]
How can this be Fixed?

MMS won't build as per instructions in README for tag 3.3.0 any longer

I get the following error when I attempt to build the mms project from source:

[ERROR] Failed to execute goal on project mms-amp: Could not resolve dependencies for project gov.nasa.jpl.mbee:mms-amp:amp:3.3.0: Could not find artifact org.springframework.social:spring-social-facebook:jar:1.0.0.RC1 in alfresco-public (https://artifacts.alfresco.com/nexus/content/groups/public) -> [Help 1]

Is this an issue arising from this code being dependent upon having access to artifactory via a JFrog account (which I don't have at Ford)? Or does it result from the stripping process for builds and releases not running properly to fix the pom when this is distributed to github?

In any case, any help or explanation to help me get the install done would be appreciated. I can't remember how or if I had to fix this issue, but I am fairly certain it could be a proxy issue. I have set up the proxy from eclipse, but perhaps this is a proxy settings issue from maven? It shouldn't be, as eclipse should manage that, right?

INFO:
I am at the latest approved release tag on source of 3.3.0. 3.3.4, I think, is coming, but I wanted to be able to build from source and ensure I am at parity with the binaries being released.

Thanks,
TJ

libffi.so.7 (no such package)

I ran "docker build. -t openmbee/mms" in "Open-MBEE / mms-alfresco / mms-ent / docker".
But the build failed.
Below is the build log.

fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
ERROR: unable to select packages:
so:libffi.so.7 (no such package):
required by: cabal-3.2.0.0-r0[so:libffi.so.7]
The command '/bin/sh -c apk upgrade --update && apk add --no-cache --virtual .build-deps $BUILD_DEPS && apk add --no-cache --virtual .persistent-deps $PERSIST_DEPS && update-ms-fonts && fc-cache -f && curl -fsSL "$PLANTUML_DOWNLOAD_URL" -o /usr/local/plantuml.jar && apk add --no-cache --virtual .edge-deps $EDGE_DEPS -X http://dl-cdn.alpinelinux.org/alpine/edge/community && curl -fsSL "$PANDOC_DOWNLOAD_URL" | tar -xzf - && ( cd pandoc-$PANDOC_VERSION && cabal update && cabal install --only-dependencies && cabal configure --prefix=$PANDOC_HOME && cabal build && cabal copy && cd .. ) && rm -Rf pandoc-$PANDOC_VERSION/ && rm -Rf /root/.cabal/ /root/.ghc/ && rm -Rf /pandoc-build && mkdir -p /var/docs' returned a non-zero code: 3

Please tell me how to avoid failure.

My environment is CentOS7.
I ran the following command.
"sudo ln -s libffi.so.6 /lib64/libffi.so.7"

Migrate MMS to support ACS6

All,

I have started the process of migrating MMS 3.x to ACS6. This is for 2 reasons:

  • Alfresco 5 is broken and has numerous security challenges
  • ACS6 is entirely based in docker which is a much more community friendly installation platform for OpenMBEE

Some of the original documentation for this process is starting to disappear so I have started reproduce some of it in our own wiki:

Migrating An SDK2 Project to ACS6

Search in Alfresco returns error referencing Slingshot

The current setup that the server is using.
Centos 6
Tomcat 7.0.78
Alfresco Community 5.0.d
ActiveMQ 5.14.5
Elasticsearch 5.4.1
PostgresQL-9.3

Attempted to do search in Alfresco which resulted in the following ERROR

Created a site and uploaded 2 image files
19496009_10155354445865502_295378728_o

Ran search for Image files, which autoloaded result successfully
19532887_10155354445545502_902930690_o

Received error
19549506_10155354445380502_902200975_o

Error from logs:

2017-06-26 15:57:41,483 ERROR [extensions.webscripts.AbstractRuntime] [http-apr-8080-exec-6] Exception from executeScript - redirecting to status template error: 05260006 Wrapped Exception (with status template): 05260026 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js': 05260025 TypeError: The processing instruction target matching "[xX][mM][lL]" is not allowed. (classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js#1038)
org.springframework.extensions.webscripts.WebScriptException: 05260006 Wrapped Exception (with status template): 05260026 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js': 05260025 TypeError: The processing instruction target matching "[xX][mM][lL]" is not allowed. (classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js#1038)
at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1127)
at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:482)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:551)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:619)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:399)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:280)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.alfresco.scripts.ScriptException: 05260026 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js': 05260025 TypeError: The processing instruction target matching "[xX][mM][lL]" is not allowed. (classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js#1038)
at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:204)
at org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:212)
at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:174)
at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)
at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1364)
at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
... 34 more
Caused by: org.alfresco.error.AlfrescoRuntimeException: 05260025 TypeError: The processing instruction target matching "[xX][mM][lL]" is not allowed. (classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js#1038)
at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:526)
at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:200)
... 39 more
Caused by: org.mozilla.javascript.EcmaError: TypeError: The processing instruction target matching "[xX][mM][lL]" is not allowed. (classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js#1038)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3687)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3677)
at org.mozilla.javascript.xmlimpl.XmlProcessor$RhinoSAXErrorHandler.throwError(XmlProcessor.java:56)
at org.mozilla.javascript.xmlimpl.XmlProcessor$RhinoSAXErrorHandler.fatalError(XmlProcessor.java:65)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.scanPIData(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unknown Source)
at org.apache.xerces.impl.XMLScanner.scanPI(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.mozilla.javascript.xmlimpl.XmlProcessor.toXml(XmlProcessor.java:225)
at org.mozilla.javascript.xmlimpl.XmlNode.createElement(XmlNode.java:87)
at org.mozilla.javascript.xmlimpl.XMLLibImpl.parse(XMLLibImpl.java:416)
at org.mozilla.javascript.xmlimpl.XMLLibImpl.ecmaToXml(XMLLibImpl.java:452)
at org.mozilla.javascript.xmlimpl.XMLObjectImpl.ecmaToXml(XMLObjectImpl.java:822)
at org.mozilla.javascript.xmlimpl.XML.jsConstructor(XML.java:186)
at org.mozilla.javascript.xmlimpl.XMLObjectImpl.execIdCall(XMLObjectImpl.java:610)
at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
at org.mozilla.javascript.BaseFunction.construct(BaseFunction.java:343)
at org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime.java:2349)
at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_search_search_get_js_6._c_getQueryTemplate_21(classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js:1038)
at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_search_search_get_js_6.call(classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:74)
at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_search_search_get_js_6._c_getSearchResults_20(classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js:1011)
at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_search_search_get_js_6.call(classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_search_search_get_js_6._c_main_22(classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js:1069)
at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_search_search_get_js_6.call(classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:74)
at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_search_search_get_js_6._c_script_0(classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js:1072)
at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_search_search_get_js_6.call(classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_search_search_get_js_6.call(classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_search_search_get_js_6.exec(classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:502)
... 40 more

POST of element after DELETE results in 304 'Is Equivalent' warning

Hello, I'm working on an MMS client for scraping and posting elements from an external tool. During the testing process, I am trying to clean up elements that are no longer needed, and reuse their IDs for future POST requests. I've found that a deleted element seems to persist somewhere that prevents the server from allowing it to be POSTed. I've tried to create a straightforward reproduction in the code below:

import requests

username = ""
password = ""
project_id = ""
branch = "master"

base_url = r"https://mms.openmbee.org/alfresco/service"
elements_url = f"{base_url}/projects/{project_id}/refs/{branch}/elements"

session = requests.Session()
session.auth = (username, password)

payload = {
    "elements": [
        {
            "id": "MMS_some_fake_id_123",
            "name": "test element",
        }
    ],
}

response = session.post(elements_url, json=payload)

<Response [200]>

response = session.post(elements_url, json=payload)

<Response [200]>

response = session.get(elements_url+f"/{response.json()['elements'][0]['id']}")

<Response [410]> # deleted

response = session.post(elements_url, json=payload)
# returns <Response [200]>
response.json()

{
'_creator': 'NAME',
'elements': [],
'rejected': [{'code': 304.0,
'element': {'name': 'test element',
'id': 'MMS_some_fake_id_123',
'_projectId': 'PROJECT_ID',
'_refId': 'master',
'_inRefIds': ['master'],
'ownerId': 'holding_bin_PROJECT_ID'},
'message': 'Is Equivalent',
'severity': 'warn'}]}

response = session.get(elements_url+f"/{response.json()['elements'][0]['id']}")

<Response [410]> # deleted

Is there an appropriate way to get the server to accept the POST, a way to clean up deleted elements, or is this by design? I have managed to create a workaround by modifying the POST payload 'name' so that it tricks the server into thinking the element has been modified, but a cleaner approach would be preferable.

Thanks,
Zach

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.