Deploy a maven site into Alfresco through FTP - maven

I'm experiencing some issues at the moment, when deploying maven site into Alfresco.
In my company, we use Alfresco as ECM, in our forge.
Since this tool supports FTP, and index all content of any kind of text document, I'd like to push my maven site into.
But even I'm able to deploy site manually through FTP on Alfresco, or upload it automatically using maven, I'm not able to combine both :
Here my part pom.xml
<distributionManagement>
[...]
<site>
<id>forge-alfresco</id>
<name>Serveur Alfresco de la Forge</name>
<url>ftp://alfresco.mycompany.corp/Alfresco/doc/site</url>
</site>
</distributionManagement>
<build>
<extensions>
<!-- Enabling the use of FTP -->
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>2.2</version>
</extension>
</extensions>
</build>
And here, part of my settings.xml
<servers>
<server>
<id>forge-alfresco</id>
<username>jrrevy</username>
<password>xxxxxxxx</password>
</server>
</servers>
When I try to deploy using site:deploy, I facing to this :
[INFO] [site:deploy {execution: default-cli}]
Reply received: 220 FTP server ready
Command sent: USER jrrevy
Reply received: 331 User name okay, need password for jrrevy
Command sent: PASS xxxxxx
Reply received: 230 User logged in, proceed
Command sent: SYST
Reply received: 215 UNIX Type: Java FTP Server
Remote system is UNIX Type: Java FTP Server
Command sent: TYPE I
Reply received: 200 Command OK
ftp://alfresco.mycompany.corp/Alfresco/doc/site/ - Session: Opened
[INFO] Pushing D:\project\workspaces\yyyyy\myproject\target\site
[INFO] >>> to ftp://alfresco.mycompany.corp/Alfresco/doc/site/./
Command sent: CWD /Alfresco/doc/site/
Reply received: 250 Requested file action OK
Recursively uploading directory D:\project\workspaces\yyyyy\myproject\target\site as ./
processing = D:\project\workspaces\yyyyy\myproject\target\site as ./
Command sent: CWD ./
Reply received: 550 Invalid path ./
Command sent: MKD ./
Reply received: 250 /Alfresco/doc/site/.
Command sent: CWD ./
Reply received: 550 Invalid path ./
ftp://alfresco.mycompany.corp/Alfresco/doc/site/ - Session: Disconnecting
ftp://alfresco.mycompany.corp/Alfresco/doc/site/ - Session: Disconnected
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error uploading site
Embedded error: Unable to change cwd on ftp server to ./ when processing D:\project\workspaces\yyyyy\myproject\target\site
I can't figure out what the problem. Maybe the plugin version is not compatible... Maybe Alfresco's implementation is not full compatible (forgive me for this outrage ;)), maybe there is a configuration in the server properties I missed.
I don't really know where to look for, and after some time googlin', I can't find what the matter.
I have already some workarounds. I'll try to upload the website using webdav protocol, and I can use some extra features (like deploy artifatcts of Jenkins) on our CI plateform, but I really want to know what's the problem.
Can someone help me ?

Indeed, it looks like an Alfresco issue : issues.alfresco.com/jira/browse/ALF-4724.
I'm running under Alfresco 3.1, and this issue seems to be solved in 3.3.5 and above.

Related

JFrog Artifactory Cloud Configurate Remote Repository

I'm struggling with a simple test using JFrog Artifactory Cloud when creating a remote repository to adobe public one.
I configure a remote as maven repository, on URL I've inserted https://repo.adobe.com/nexus/content/repositories/public and test ok on name just give a adobe-public name and click on save and finish.
After that I'm trying to obtain a existing (in repo.adobe.com) pom from https://xxxx/artifactory/adobe-public/com/day/jcr/vault/... but I can't get any pom.
I've tried to change several cache settings or offline settings but issue is always ""message" : "adobe-public: is offline". status 404.
On Logs, https://cccc/ui/admin/artifactory/advanced/system_logs there isn't also anything useful.
Thank you in advanced.
This is caused by global offline mode being active.
I had same issue.
Solved in: "https://.../ui/admin/artifactory/configuration/artifactory_general" - turn off "Global Offline Mode" and save.
Have a similar setup with Maven repository pointing to https://repo.adobe.com/nexus/content/repositories/public and was successfully able to download the pom files, refer the below snippet,
$ wget --user=admin --password=Password https://myartifactory/artifactory/adobe-repo/ant/ant/1.5.1/ant-1.5.1.pom
--2020-11-01 10:27:54-- https://myartifactory/artifactory/adobe-repo/ant/ant/1.5.1/ant-1.5.1.pom
Resolving myartifactory (myartifactory)... 1.2.3.4, 2.1.3.5, 3.7.7.4
Connecting to myartifactory (myartifactory)|1.2.3.6|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Basic realm="Artifactory Realm"
Reusing existing connection to myartifactory:443.
HTTP request sent, awaiting response... 200 OK
Length: 140 [application/x-maven-pom+xml]
Saving to: ‘ant-1.5.1.pom’
ant-1.5.1.pom 100%[====================================>] 140 --.-KB/s in 0s
2020-11-01 10:27:59 (5.14 MB/s) - ‘ant-1.5.1.pom’ saved [140/140]
Use wget and try to download the file as I did. Also, the error "offline" says that the repository is offline and cannot be downloaded, goto to the repository's configuration page under Artifactory UI --> Admin --> Repositories | Adobe-public and under the Basic tab, scroll down and look for "offline", if this "offline" is checked, uncheck it and try again.

Using pact broker with a path

I am trying to get my pact broker working on my environment. I have the broker running in K8S under https://mydomain/pactbroker (image; dius/pactbroker).
I am able to send to the broker with the maven plugin (publish). However when I try to verify I get an error; Request to path '/' failed with response 'HTTP/1.1 401 Unauthorized'
Can someone help me out?
<build>
<plugins>
<plugin>
<groupId>au.com.dius</groupId>
<artifactId>pact-jvm-provider-maven</artifactId>
<version>4.0.10</version>
<configuration>
<serviceProviders>
<!-- You can define as many as you need, but each must have a unique name -->
<serviceProvider>
<name>FaqService</name>
<protocol>http</protocol>
<host>localhost</host>
<port>8080</port>
<pactBroker>
<url>https://mydomain/pactbroker/</url>
<authentication>
<scheme>basic</scheme>
<username>user</username>
<password>pass</password>
</authentication>
</pactBroker>
</serviceProvider>
</serviceProviders>
</configuration>
</plugin>
</plugins>
</build>
Added information (Jun 18, 12:52 CET):
When trying to go through the logs it seems it tries to fetch the HAL root information via path "/". However responds with;
[WARNING] Could not fetch the root HAL document
When I enable PreEmptive Authentication i can see that ot give a Warning like
[WARNING] Using preemptive basic authentication with the pact broker at https://mydomain so without the path.
Have you confirmed you can use the broker correctly outside of Maven?
e.g. can you curl --user user:pass https://mydomain/pactbroker/ and get back an API result? Can you visit it in the browser?
You may also need to make sure all relative links etc. work. See https://docs.pact.io/pact_broker/configuration#running-the-broker-behind-a-reverse-proxy and docs for whatever proxy you have in front of it.
The issue was with pact. An issue was raised and should be merged to the next release soon (4.1.4)

SSH-deployer fails with auth fail error message - Teamcity for scp?

I have a build in Teamcity with the SSH-deployer, but it fails with Auth fail. I am using password authentication, don't wanna use private/public key authentication as it won't be robust approach for us.
Idea is to authenticate via user name and password.
Attached the screenshot for the configuration.
Thanks
Error message:
[06:16:14]Collecting changes in 1 VCS root
[06:16:14][Collecting changes in 1 VCS root] VCS Root details
[06:16:14][VCS Root details] "DE_Automation" {instance id=40631, parent internal id=7496, parent id=Abc_DeAutomation, description: "ssh://git#<server_name>/abc/puppet.git#refs/heads/master"}
[06:16:15]Clearing temporary directory: /opt/teamcity/temp/buildTmp
[06:16:15]Publishing internal artifacts
[06:16:15][Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[06:16:15][Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher]
[06:16:15]Checkout directory: /opt/teamcity/work/376a4e836d9c66e4
[06:16:15]Updating sources: server side checkout
[06:16:15][Updating sources] Using vcs information from agent file: 376a4e836d9c66e4.xml
[06:16:16][Updating sources] Building incremental patch for VCS root: DE_Automation; checkout rules: =>; revision: d88b7e07953108a1a4c392887c28e9b97ce31a5b --> d88b7e07953108a1a4c392887c28e9b97ce31a5b
[06:16:16][Updating sources] Repository sources transferred
[06:16:16]Step 1/3: Command Line
[06:16:16][Step 1/3] Disabled build step Command Line is skipped
[06:16:16]Step 2/3: SFTP (FTP Deployer)
[06:16:16][Step 2/3] Disabled build step SFTP (FTP Deployer) is skipped
[06:16:16]Step 3/3: SCP (SSH Deployer)
[06:16:16][Step 3/3] com.jcraft.jsch.JSchException: Auth fail
[06:16:16]
[Step 3/3] com.jcraft.jsch.JSchException: Auth fail
at com.jcraft.jsch.Session.connect(Session.java:512)
at com.jcraft.jsch.Session.connect(Session.java:183)
at jetbrains.buildServer.deployer.agent.ssh.SSHSessionProvider.<init>(SSHSessionProvider.java:102)
at jetbrains.buildServer.deployer.agent.ssh.SSHDeployerRunner.getDeployerProcess(SSHDeployerRunner.java:44)
at jetbrains.buildServer.deployer.agent.base.BaseDeployerRunner.createBuildProcess(BaseDeployerRunner.java:47)
at jetbrains.buildServer.agent.impl.runner.CallRunnerService.doCreateBuildProcess(CallRunnerService.java:71)
at jetbrains.buildServer.agent.impl.runner.CallRunnerService.createBuildProcess(CallRunnerService.java:47)
at jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.CallRunnerStage.doBuildStage(CallRunnerStage.java:47)
at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:25)
at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:18)
at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:78)
at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:37)
at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor.doStages(RunnerStagesExecutor.java:18)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.RunnerContextExecutor.callRunnerStages(RunnerContextExecutor.java:43)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.StepExecutor.processNextStep(StepExecutor.java:25)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeRunnerStep(ForEachBuildRunnerStage.java:138)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.runStep(ForEachBuildRunnerStage.java:123)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeBuildRunners(ForEachBuildRunnerStage.java:83)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.doBuildStage(ForEachBuildRunnerStage.java:44)
at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:31)
at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:24)
at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:78)
at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:37)
at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor.doStages(BuildStagesExecutor.java:24)
at jetbrains.buildServer.agent.impl.BuildRunActionImpl.doStages(BuildRunActionImpl.java:70)
at jetbrains.buildServer.agent.impl.BuildRunActionImpl.runBuild(BuildRunActionImpl.java:50)
at jetbrains.buildServer.agent.impl.BuildAgentImpl.doActualBuild(BuildAgentImpl.java:288)
at jetbrains.buildServer.agent.impl.BuildAgentImpl.access$100(BuildAgentImpl.java:53)
at jetbrains.buildServer.agent.impl.BuildAgentImpl$1.run(BuildAgentImpl.java:252)
at java.lang.Thread.run(Thread.java:748)
[06:16:16][Step 3/3] Step SCP (SSH Deployer) failed with unexpected error
[06:16:16]Publishing internal artifacts
[06:16:16][Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[06:16:16][Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher]
[06:16:16]Build finished
In my case, the problem was not related to SCP (even when TC was saying it is) at all:
My steps:
compile
SCP deploy
some cleanup
shh script on remote server
And step 2 was failing with the same error message as you (but when i SSH to remote server, the file was here)
But, the problem was not in failing step #2 but two steps ahead - i had wrong user in step #4!
Looks like some sort of async bug.

mvn deploy to artifactory (large size artifact) gives broken pipe error

I am trying to deploy a large zip file (305 MB) to artifactory using the mvn deploy command, but i am getting broken pipe errors. I tried to upload the same file via the browser's "Deploy" button, and it worked fine.
Is there a setting that i can use to increase the socket timeout, or force maven/artifactory to wait until the package is uploaded?
Any help on how to resolve this is appreciated. Here are the log entries and stack trace:
May 09, 2016 11:16:32 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {}->http://mvnrepo.dev.xyz.myorg.net:8080
May 09, 2016 11:17:02 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://mvnrepo.dev.xyz.myorg.net:8080: Broken pipe
May 09, 2016 11:17:02 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {}->http://mvnrepo.dev.xyz.myorg.net:8080
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.myorg.xyz.myapp:my-app-package:zip:0.1-svc20160509.151532-7 from/to xyz-service-snapshots (http://mvnrepo.dev.xyz.myorg.net:8080/artifactory/xyz-service-local): Broken pipe
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.put(BasicRepositoryConnector.java:274)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311)
... 26 more
Caused by: org.apache.maven.wagon.TransferFailedException: Broken pipe
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:662)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:557)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:539)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:533)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:513)
at org.eclipse.aether.transport.wagon.WagonTransporter$PutTaskRunner.run(WagonTransporter.java:644)
at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
at org.eclipse.aether.transport.wagon.WagonTransporter.put(WagonTransporter.java:410)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$PutTaskRunner.runTask(BasicRepositoryConnector.java:510)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
... 28 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:123)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:135)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:164)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:115)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon$RequestEntityImplementation.writeTo(AbstractHttpClientWagon.java:204)
at org.apache.maven.wagon.providers.http.httpclient.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:155)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:149)
at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:236)
I managed to fix the issue by downgrade maven version from 3.5.2 to 3.0.4
Artifactory - open source 7.12.6
General
A Broken pipe error typically indicates a network issue. Deploying an artifact on Artifactory may fail with this error either if you have network issues (lost packets during deployment) or if your Artifactory repository has ran out of space (physical memory on the repository). Check Case 1 and Case 2 for troubleshooting.
Tip: Run mvn deploy -X. The -X option will log further information related with your error (sets log-level to debug)
Case 1: Network Issue
Solution: Just retry it :)
Issue Details
Maven's source code seems to be using apache's Validate method, (throws an IllegalArgumentException on validation error) to compare and validate the size of the deployed artifact with the artifact that was built locally. Note: On deploy, maven builds the artifact locally, and then uploads it to the configured repository (could be Artifactory, Maven Central etc) which in your case is Artifactory.
The error should look like this:
[DEBUG] Failed to dispatch transfer event 'PUT PROGRESSED [ARTIFACT_SERVER_URL]/artifact.jar <> [LOCAL_PATH]/artifact.jar
java.lang.IllegalArgumentException: progressed file size cannot be greater than size: 117964800 > 116927216
at org.apache.commons.lang3.Validate.isTrue (Validate.java:158)
at org.apache.maven.cli.transfer.AbstractMavenTransferListener$FileSizeFormat.formatProgress (AbstractMavenTransferListener.java:195)
at org.apache.maven.cli.transfer.ConsoleMavenTransferListener.getStatus (ConsoleMavenTransferListener.java:117)
at org.apache.maven.cli.transfer.ConsoleMavenTransferListener.transferProgressed (ConsoleMavenTransferListener.java:90)
...
Case 2: No space left on Artifactory repository
Solution: Free up space on Artifactory repository
Issue Details
For any erros related with deployment to artifactory, you can always check Artifactory's log from Web Application.
Just Navigate (from Sidebar) to Admin/Advanced/System Logs. Check for any error or warning in the log file.
An error related with the available space could be like the following:
2021-08-18 11:20:43,339 [http-nio-8081-exec-19] [WARN ] (o.a.w.s.RepoFilter :252) - Sending HTTP error code 404: No space left on device
2021-08-18 11:20:43,346 [http-nio-8081-exec-16] [WARN ] (o.a.r.s.RepositoryServiceImpl:1739) - Datastore disk is too high: Warning limit: 80%, Used: 94%, Total: 688.01 GB, Used: 652.97 GB, Available: 35.04 GB
2021-08-18 11:20:43,346 [http-nio-8081-exec-16] [INFO ] (o.a.e.UploadServiceImpl:386) - Deploy to 'libs-snapshot-local:artifact.jar' Content-Length: 170019165
2021-08-18 11:20:44,086 [http-nio-8081-exec-16] [ERROR] (o.a.w.s.RepoFilter :251) - Upload request of libs-snapshot-local:artifact.jar failed due to {}
java.io.IOException: No space left on device
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:326)
...
In case you do identify such errors, try to remove some old artifacts to free up space, and retry your deployment later
Tip: It's a good practise to set some purging policies for old artifacts/snapshots on your Artifactory.

Apache Spark: Unable to build: [error] Server access Error..jetty

I have downloaded spark-1.4.1.tgz, unzipped it.
Now, when i try to build as follows, it gets stuck:
$ ./sbt/sbt assembly
Invoking 'build/sbt assembly' now
[info] Loading project definition...
[warn] Multiple resolvers having different access mechanism configured with same name 'sbt-plugin-releases'.
...
[info] Resolving org.eclipse.jetty#jetty-parent;18
[error] Server access Error: Connection reset url=http://download.eclipse.org/jgit/maven/org/eclipse/jetty/jetty-parent/18/jetty-parent-18.jar
[error] Server access Error: Server redirected too many times (20) url=http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/org.eclipse.jetty.orbit/jetty-orbit/1/jars/jetty-orbit.jar
The build gets stuck at this point. Am i missing any configuration/libraries?
You have a network connectivity issue and probably need to retry.

Resources