Foros

Inicio » Liferay Sync

Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Sebastian David
Liferay Sync Upload Error - 404
19 de diciembre de 2012 4:44
Respuesta

Sebastian David

Ranking: New Member

Mensajes: 2

Fecha de incorporación: 3 de diciembre de 2012

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: liferay-sync.log (231,1k)
Anónimo
RE: Liferay Sync Upload Error - 404
19 de diciembre de 2012 8:41
Respuesta

Anónimo

How do you have your portal set up? Are you using a proxy?

I would like you to rerun the test with a higher logging level:

1) Stop Sync
2) Go to the C:\Users\{you user name}\.liferay-sync folder
3) Delete out the logs folder
4) Open the app-log4j.xml in a text editor
And change the following items:

<category name="com.liferay.sync.gui.desktop">
<priority value="TRACE" />
</category>

<category name="com.liferay.sync.modules.documentlibrary">
<priority value="TRACE" />
</category>

<category name="com.liferay.sync.util">
<priority value="TRACE" />
</category>

<root>
<priority value="TRACE" />
<appender-ref ref="FILE" />
</root>

Please restart sync, allow it to run for a minute or so, stop sync and attach the logs.

Thanks!

Gail
Sebastian David
RE: Liferay Sync Upload Error - 404
19 de diciembre de 2012 10:14
Respuesta

Sebastian David

Ranking: New Member

Mensajes: 2

Fecha de incorporación: 3 de diciembre de 2012

Mensajes recientes

Hi Gail.
Thanks for your quick answer. Please find attached de log.

Thanks again!
Cheers
archivos adjuntos: liferay-sync.log (18,4k)
Anónimo
RE: Liferay Sync Upload Error - 404
19 de diciembre de 2012 10:27
Respuesta

Anónimo

Would you do a test for me...

Let me know what you get if you try to hit this URL: http://{your url}/api/secure/jsonws/dlsync/get-dl-sync-update/company-id/10154/repository-id/10180/last-access-date/1

Also bring up the liferay sync properties window and let me know if you you see the message in the account settings box that says Test Connection Successful with a green check mark.
Everton Lupianhez
RE: Liferay Sync Upload Error - 404
19 de diciembre de 2012 14:02
Respuesta

Everton Lupianhez

Ranking: New Member

Mensajes: 2

Fecha de incorporación: 14 de julio de 2011

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:


1{"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
Anónimo
RE: Liferay Sync Upload Error - 404
20 de diciembre de 2012 8:36
Respuesta

Anónimo

Do you have a list of sites to choose to sync with on the UI? Are you able to select one of those?

Would you send me your *.db files? They are where the log files are. You can either send them to me directly or attach them to the post.
Everton Lupianhez
RE: Liferay Sync Upload Error - 404
20 de diciembre de 2012 11:26
Respuesta

Everton Lupianhez

Ranking: New Member

Mensajes: 2

Fecha de incorporación: 14 de julio de 2011

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
Anónimo
RE: Liferay Sync Upload Error - 404
20 de diciembre de 2012 11:31
Respuesta

Anónimo

No we haven't run into this problem before. That makes sense for the 404 issue. What we are wondering is why you are able to get the successful connection and list of user sites. So we want to do a bit more investigation on this issue.
Peter Hancox
RE: Liferay Sync Upload Error - 404
5 de febrero de 2013 3:47
Respuesta

Peter Hancox

Ranking: Junior Member

Mensajes: 31

Fecha de incorporación: 5 de julio de 2005

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!
Peter Hancox
RE: Liferay Sync Upload Error - 404
5 de febrero de 2013 5:32
Respuesta

Peter Hancox

Ranking: Junior Member

Mensajes: 31

Fecha de incorporación: 5 de julio de 2005

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.

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


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


Still can't get the windows client to upload though download (other than dropping the file extension) seems OK.
Anónimo
RE: Liferay Sync Upload Error - 404
5 de febrero de 2013 6:46
Respuesta

Anónimo

Peter Hancox:

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


.


This one is a harmless issue. It's error messages as it tries a few way to load a library. It eventually will succeed. You will get that one on every start up.
Anónimo
RE: Liferay Sync Upload Error - 404
5 de febrero de 2013 6:51
Respuesta

Anónimo

Peter Hancox:


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


Still can't get the windows client to upload though download (other than dropping the file extension) seems OK.


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.

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

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?

Thanks!

Gail
Peter Hancox
RE: Liferay Sync Upload Error - 404
5 de febrero de 2013 14:22
Respuesta

Peter Hancox

Ranking: Junior Member

Mensajes: 31

Fecha de incorporación: 5 de julio de 2005

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
Peter Hancox
RE: Liferay Sync Upload Error - 404
5 de febrero de 2013 16:22
Respuesta

Peter Hancox

Ranking: Junior Member

Mensajes: 31

Fecha de incorporación: 5 de julio de 2005

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: liferay-sync.log (188,9k)
Peter Hancox
RE: Liferay Sync Upload Error - 404
6 de febrero de 2013 0:08
Respuesta

Peter Hancox

Ranking: Junior Member

Mensajes: 31

Fecha de incorporación: 5 de julio de 2005

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?


1[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)"
2[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)"
3[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)"
4[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
Anónimo
RE: Liferay Sync Upload Error - 404
6 de febrero de 2013 6:37
Respuesta

Anónimo

Peter Hancox:


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"?


This is a difference in how the android client and the desktop client behave. I will write a ticket for this so that we can make it consistent across the applications, SYNC-789 and SYNC-790.
Peter Hancox
RE: Liferay Sync Upload Error - 404
7 de febrero de 2013 13:41
Respuesta

Peter Hancox

Ranking: Junior Member

Mensajes: 31

Fecha de incorporación: 5 de julio de 2005

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
Anónimo
RE: Liferay Sync Upload Error - 404
7 de febrero de 2013 13:51
Respuesta

Anónimo

Peter Hancox:

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?

r


For the synchronize issue..Dennis was looking into it and found the issue. And we wrote a ticket http://issues.liferay.com/browse/SYNC-791. It won't be in this release this Friday but will be in the next release which is planned for very soon.

And no Sync is not open source.

Gail