Foros de discusión

Liferay Sync Upload Error - 404

Sebastian David, modificado hace 11 años.

Liferay Sync Upload Error - 404

New Member Mensajes: 2 Fecha de incorporación: 3/12/12 Mensajes recientes
Hi.
I'm using Liferay Sync, my environment is Windows based (both server and my desktop). When I try to sync the files, it says "Upload Error".
The log says:
19 Dez 2012 10:41:20,815 DEBUG [BaseEvent:122] Failed event class com.liferay.sync.modules.documentlibrary.server.event.GetDLSyncUpdateEvent
19 Dez 2012 10:41:20,830 ERROR [BaseHandler:59] Received Error Code 404
19 Dez 2012 10:41:20,830 DEBUG [BaseEvent:103] Not Found
org.apache.http.client.HttpResponseException: Not Found
at com.liferay.sync.modules.documentlibrary.server.handler.BaseHandler.checkStatusCode(BaseHandler.java:62)
at com.liferay.sync.modules.documentlibrary.server.handler.BaseHandler.handleResponse(BaseHandler.java:40)
at com.liferay.sync.modules.documentlibrary.server.handler.BaseHandler.handleResponse(BaseHandler.java:1)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1070)
at com.liferay.sync.modules.documentlibrary.server.event.BaseEvent.executeRequest(BaseEvent.java:231)
at com.liferay.sync.modules.documentlibrary.server.event.BaseEvent.run(BaseEvent.java:93)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I attached the log also.
Can you help me figure out what is wrong?

Thanks

Archivos adjuntos:

Gail Hernandez, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

Sebastian David, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

New Member Mensajes: 2 Fecha de incorporación: 3/12/12 Mensajes recientes
Hi Gail.
Thanks for your quick answer. Please find attached de log.

Thanks again!
Cheers

Archivos adjuntos:

Gail Hernandez, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

Everton Lupianhez, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

New Member Mensajes: 2 Fecha de incorporación: 14/07/11 Mensajes recientes
Hi Gail, i am working in this problem with Sebastian, and the result for the hit URL: http://{your url}/api/secure/jsonws/dlsync/get-dl-sync-update/company-id/10154/repository-id/10180/last-access-date/1 is:


{"DLSyncs":[{"companyId":10154,"createDate":1355160975100,"description":"home","event":"add","fileId":10903,"fileUuid":"5e1e6a3c-d659-4992-ba60-ad0b76ff9d15","modifiedDate":1355160975100,"name":"home","parentFolderId":0,"repositoryId":10180,"syncId":10904,"type":"folder","version":"-1"},{"companyId":10154,"createDate":1355161005922,"description":"","event":"add","fileId":10906,"fileUuid":"b22b7a11-ccc5-4c21-8394-a7a51cfc9213","modifiedDate":1355161005922,"name":"spacer.png","parentFolderId":10903,"repositoryId":10180,"syncId":10913,"type":"file","version":"1.0"},{"companyId":10154,"createDate":1355161007184,"description":"","event":"add","fileId":10914,"fileUuid":"63b96519-c0b0-491c-ae02-1221cfeb3de9","modifiedDate":1355161007184,"name":"thumbnail.png","parentFolderId":10903,"repositoryId":10180,"syncId":10922,"type":"file","version":"1.0"},{"companyId":10154,"createDate":1355161007584,"description":"","event":"add","fileId":10925,"fileUuid":"143afaf9-f7a7-4772-a551-84d8f1d3ff3f","modifiedDate":1355161007584,"name":"screenshot.png","parentFolderId":10903,"repositoryId":10180,"syncId":10933,"type":"file","version":"1.0"}],"lastAccessDate":1355941889609}


And yes, in the account settings box the Sync says that the connection is successful.

tks
Gail Hernandez, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

Everton Lupianhez, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

New Member Mensajes: 2 Fecha de incorporación: 14/07/11 Mensajes recientes
I was able to use the Liferay Sync with a Tomcat bundle.
I was wondering if the problem is the context, because the bundle runs in the "/"context and my application is installed in the "/PORTAL" context.
You had this kind of problem before?

Tks
Gail Hernandez, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

thumbnail
Peter Hancox, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

Junior Member Mensajes: 45 Fecha de incorporación: 6/07/05 Mensajes recientes
Were you able to resolve this?

I have a similar error under Windows. Also have Liferay running on "/portal" context.

However, working on same site works fine from Android phone and Android tablet. Can make changes on either Android device and on web site and they will sync quite happily. Only a problem with the Windows client!
thumbnail
Peter Hancox, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

Junior Member Mensajes: 45 Fecha de incorporación: 6/07/05 Mensajes recientes
I think I can confirm that this is indeed an issue with the portal context.

The Windows client appears to use the context supplied on the server URL to successfully authenticate and download the list of sites. However, when attempting to synchronise with the Document and Media Library, the context isn't applied. i.e., the URL is "/api/...." rather than "/portal/api/...."

I was able to get the synchronisation to work by routing via Apache HTTPD and using URL rewriting to insert the context at the front of the URL. Hope you can get this fixed in the next Windows client release.

Another issue with the Windows client is that downloaded files lose the extension from the file name.

Also get these log entries when the client starts, though they may well be harmless.

06 Feb 2013 00:22:30,832 DEBUG [aw:122] jarName = rsrc:liferay-sync-wrapper
06 Feb 2013 00:22:30,833 DEBUG [aw:122] systemTempFolder = C:\tmp\
06 Feb 2013 00:22:30,834 DEBUG [aw:122] Unable to alter tmp folder. Trying to use the system one
java.lang.IllegalArgumentException: Cannot create dir: C:\tmp\rsrc:liferay-sync-wrapper.Build.1.6.11736163500
	at com.jniwrapper.aw.<init>(SourceFile:122)
	at com.jniwrapper.aw.<init>(SourceFile:114)</init></init>


Open website from menu also fails. Host, port, and context are correct so the rest of the URL is pointing at the wrong thing:
http://www.xxxxxxxxx.com.au:8080/portal/c/document_library/find_folder?groupId=17457&amp;folderId=0


Still can't get the windows client to upload though download (other than dropping the file extension) seems OK.
Gail Hernandez, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

Gail Hernandez, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

thumbnail
Peter Hancox, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

Junior Member Mensajes: 45 Fecha de incorporación: 6/07/05 Mensajes recientes
Gail Hernandez:
Would you send me your sync logs? Would you change your logging level to trace first? You can do that where the logs are there's a app-log4j.xml file and change the levels for the com.liferay.sync.gui.desktop, com.liferay.sync.modules.documentlibrary and com.liferay.sync.util to TRACE.

Will do later this morning.

If you paste that URL into your browser you won't arrive at the correct location?

That's correct; Tomcat returns "The requested resource was not found". If I remove everything following "...../document_library" then I end up at the home page. This may be related to virtual hosting? Or perhaps the groupId or folderId parameters are not correct. Will investigate that too.

Also I'm not sure I understand your last comment about the windows client uploading through download, or dropping the file extension. Would you provide more details?

Not "upload through download ...", "upload though download ..." :-)

Download works in that, if I create a folder called "test" on the Android phone it will upload to Liferay website and download to Windows client. i.e., after sync I will have a folder called "test" on all devices including Windows. If I create a folder called "test2" on Windows or a file called "test.txt" Windows will show a notification that upload failed and the files / folders will not appear on any other devices.

If I create a file called "test.png" on the website, Windows will download it as "test", i.e., the ".png" extension is missing.

REGARDS
Peter
thumbnail
Peter Hancox, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

Junior Member Mensajes: 45 Fecha de incorporación: 6/07/05 Mensajes recientes
Hi Gail,

I've attached the liferay-sync.log file as requested. First set log level to trace. Then deleted the original download directory and log files. Started Liferay Sync and successfully connected and performed initial synchronisation.

Created folders and files on website and Android devices which were successfully synced to Windows. Tried creating a few files and folders on Windows but upload always fails.

Download to Windows usually works but seems to have problems with downloading files that have been downloaded before. e.g., "Scroll Background" which on early tests following a complete reinstall did download. On this test after deleting the download directory, the file didn't download again until it was republished on the website as a new version. Perhaps Windows client tracks previously downloaded files somewhere outside the download directory???

Remember that download to Windows is only working because I am applying a URL redirect in the Apache gateway in front of Tomcat where Liferay is hosted. This redirect is inserting the missing context from the Liferay Sync client. Although this is working for downloads, I have a suspicion that uploads are checking the HTTP response and treating a redirect code as an error? Whereas the download is treating the redirect as OK?

The issue with losing the file extension may be partly an error in my understanding and partly a "feature" on Android client. There is in fact no file extension!!! If I upload "test.png" and give it a title of "TestImage", Liferay doesn't store anything about the original file name. Windows downloads it as "TestImage" (the title given to the file when it was uploaded) so this is probably working as desired. What caused me to think it was an error was that I knew it was a PNG file and Android downloads it as "TestImage.png". i.e., it appears to create an extension based on the image metadata. The Android behaviour makes it much easier when working on the file locally but the Windows approach of naming the file as the document title is probably more correct? So probably not a bug but a "design choice"?

REGARDS
Peter

Archivos adjuntos:

thumbnail
Peter Hancox, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

Junior Member Mensajes: 45 Fecha de incorporación: 6/07/05 Mensajes recientes
Peter Hancox:
Remember that download to Windows is only working because I am applying a URL redirect in the Apache gateway in front of Tomcat where Liferay is hosted. This redirect is inserting the missing context from the Liferay Sync client. Although this is working for downloads, I have a suspicion that uploads are checking the HTTP response and treating a redirect code as an error? Whereas the download is treating the redirect as OK?


[06/Feb/2013:18:55:26 +1100] "POST /api/secure/jsonws/dlapp/add-folder HTTP/1.1" 302 339 "-" "Apache-HttpClient/4.2.1 (java 1.5)"
[06/Feb/2013:18:55:26 +1100] "POST /api/secure/jsonws/dlapp/add-file-entry HTTP/1.1" 302 343 "-" "Apache-HttpClient/4.2.1 (java 1.5)"
[06/Feb/2013:18:55:26 +1100] "GET /api/secure/jsonws/dlsync/get-dl-sync-update/company-id/10112/repository-id/17457/last-access-date/0 HTTP/1.1" 302 404 "-" "Apache-HttpClient/4.2.1 (java 1.5)"
[06/Feb/2013:18:55:26 +1100] "GET /portal/api/secure/jsonws/dlsync/get-dl-sync-update/company-id/10112/repository-id/17457/last-access-date/0 HTTP/1.1" 401 951 "-" "Apache-HttpClient/4.2.1 (java 1.5)"


The above extract from Apache logs occurs about every 5 seconds (the Liferay Sync update check interval). My simplistic interpretation would be that the first two lines relate to Liferay Sync trying to upload a locally created folder and file. Note the redirect response is not followed by a revised POST URL. Whereas the third line relates to a request to retrieve updates and the redirect response is in this case followed by a revised request to the redirected address.

Hope that helps.

REGARDS
Peter
Gail Hernandez, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

thumbnail
Peter Hancox, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404

Junior Member Mensajes: 45 Fecha de incorporación: 6/07/05 Mensajes recientes
Hi Gail,

Thanks for following through on the inconsistency between Windows client and Android client.

What about the issue with the Windows client not including the portal context when it tries to synchronise? Are you going to raise a ticket on this? If not I can do it, just thought that as Liferay staff you might be in a better position to get it raised in the most appropriate manner with the developers. And you probably have a much better understanding than I on how the product works.

BTW Is Liferay Sync open sourced?

Many thanks for your prompt assistance so far.

REGARDS
Peter
Gail Hernandez, modificado hace 11 años.

RE: Liferay Sync Upload Error - 404