Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alfresco.SurfRequestError #8

Open
x-itec opened this issue Dec 27, 2014 · 7 comments
Open

alfresco.SurfRequestError #8

x-itec opened this issue Dec 27, 2014 · 7 comments

Comments

@x-itec
Copy link

x-itec commented Dec 27, 2014

Exporting a site (Alfresco 4.0)

python export-site.py http://127.0.0.1:8080/share/page/site/unternehmenshandbuch/dashboard bla.json --username=x--password=x --export-content

Log in (admin)
Get site information
Export all site content
Export documentLibrary
Log out (admin)
Traceback (most recent call last):
File "export-site.py", line 254, in
main(sys.argv[1:])
File "export-site.py", line 214, in main
results = sc.exportAllSiteContent(sitename, siteContainers, includePaths, tempContainerName, async)
File "/Volumes/DMS/xp/share-import-export/shareclient/alfresco.py", line 810, in exportAllSiteContent
self.exportSiteContent(siteId, child['name'], includePaths, tempContainerName, async)
File "/Volumes/DMS/xp/share-import-export/shareclient/alfresco.py", line 775, in exportSiteContent
self.doJSONPost('proxy/alfresco/api/actionQueue?async=%s' % (str(async).lower()), json.dumps(actionDef))
File "/Volumes/DMS/xp/share-import-export/shareclient/alfresco.py", line 163, in doJSONPost
resp = self.doPost(path, dataStr, 'application/json; charset=UTF-8', method)
File "/Volumes/DMS/xp/share-import-export/shareclient/alfresco.py", line 144, in doPost
return self.doRequest(method, path, data, dataType)
File "/Volumes/DMS/xp/share-import-export/shareclient/alfresco.py", line 132, in doRequest
raise SurfRequestError(method, e.url, e.code, e.msg, e.hdrs, e.fp)
alfresco.SurfRequestError

@wabson
Copy link
Owner

wabson commented Dec 27, 2014

Are you able to give a more detailed description of what happens, exactly? e.g. does the failure happen straight away or does it take a while, indicating a time-out?

As you might be able to guess there is not much to go on from the exception itself but you add -d to the options then it will output a bit more on what is going on.

@x-itec
Copy link
Author

x-itec commented Dec 27, 2014

adding -d

Log in (admin)
Get site information
Export all site content
Export documentLibrary
Log out (admin)
Traceback (most recent call last):
File "export-site.py", line 254, in
main(sys.argv[1:])
File "export-site.py", line 214, in main
results = sc.exportAllSiteContent(sitename, siteContainers, includePaths, tempContainerName, async)
File "/Volumes/DMS/xp/share-import-export/shareclient/alfresco.py", line 810, in exportAllSiteContent
self.exportSiteContent(siteId, child['name'], includePaths, tempContainerName, async)
File "/Volumes/DMS/xp/share-import-export/shareclient/alfresco.py", line 775, in exportSiteContent
self.doJSONPost('proxy/alfresco/api/actionQueue?async=%s' % (str(async).lower()), json.dumps(actionDef))
File "/Volumes/DMS/xp/share-import-export/shareclient/alfresco.py", line 163, in doJSONPost
resp = self.doPost(path, dataStr, 'application/json; charset=UTF-8', method)
File "/Volumes/DMS/xp/share-import-export/shareclient/alfresco.py", line 144, in doPost
return self.doRequest(method, path, data, dataType)
File "/Volumes/DMS/xp/share-import-export/shareclient/alfresco.py", line 132, in doRequest
raise SurfRequestError(method, e.url, e.code, e.msg, e.hdrs, e.fp)
alfresco.SurfRequestError

Error comes up after approx 2 minutes

@rr8779
Copy link

rr8779 commented Feb 5, 2015

Hi, 2 minutes is the default http.socket.timeout.

if you take a look at your catalina.out, you should find a similar error :
webscripts.connector.RemoteClient
Error status 408 Read timed out
java.net.SocketTimeoutException: Read timed out

You will find this parameter if you look into the jar :
tomcat/webapps/alfresco/WEB-INF/lib/spring-webscripts-1.2.0-SNAPSHOT.jar
into :
org/springframework/extensions/webscripts/spring-webscripts-application-context.xml

  • bean id="connector.remoteclient.abstract"
  • property name="readTimeout"
  • value = 120000 milliseconds = 2 minutes

You can simply modify the value into the jar file but a better approach is to override the bean setting by creating a file called :
tomcat/shared/classes/alfresco/web-extension/custom-slingshot-application-context.xml

Simply copy the content of spring-webscripts-application-context.xml and change the readTimeout value.

Don't forget to restart tomcat.

Regards,
Renaud

@ruria
Copy link

ruria commented Feb 23, 2015

I had the same error, but after changing timeout value for alfresco webscripts, another timeout exception, now from alfresco.py script line 262 in share-import-export:

return self.opener.open(req, timeout=self.timeout)

I´ve changed default timeout in ShareClient.init to something higher, and it worked.

@ehexin
Copy link

ehexin commented Apr 6, 2015

Exporting a site (Alfresco 4.2)
python export-site.py swsdp /opt2/share-import-export-master/115/swsdp.json --username=admin --password=admin --export-content

Log in (admin)
Get site information
Log out (admin)
Traceback (most recent call last):
File "export-site.py", line 257, in
main(sys.argv[1:])
File "export-site.py", line 193, in main
sdata = sc.getSiteInfo(sitename, getMetaData, getMemberships, getPages, getDashboardConfig)
File "/opt2/share-import-export-master/shareclient/alfresco.py", line 417, in getSiteInfo
siteData['memberships'] = self.doJSONGet('proxy/alfresco/api/sites/%s/memberships' % (urllib.quote(unicode(siteId))))
File "/opt2/share-import-export-master/shareclient/alfresco.py", line 279, in doJSONGet
resp = self.doGet(path)
File "/opt2/share-import-export-master/shareclient/alfresco.py", line 271, in doGet
return self.doRequest("GET", path)
File "/opt2/share-import-export-master/shareclient/alfresco.py", line 263, in doRequest
raise SurfRequestError(method, e.url, e.code, e.msg, e.hdrs, e.fp)
alfresco.SurfRequestError: Spring Surf Error 500 (Internal Server Error)
...
...
...

wabson, can you help me....?

@ehexin
Copy link

ehexin commented Apr 6, 2015

java.lang.NullPointerException
at com.atolcd.alfresco.ProxyAuditFilter.doFilter(ProxyAuditFilter.java:372)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:1810)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

Hi wabson
Can you help me?

@ehexin
Copy link

ehexin commented Apr 6, 2015

-d

header: Content-Length: 1967
header: Connection: close
GET http://localhost:8080/share/proxy/alfresco/api/sites/swsdp/memberships
send: u'GET /share/proxy/alfresco/api/sites/swsdp/memberships HTTP/1.1\r\nAccept-Encoding: identity\r\nAccept-Language: en-gb,en;q=0.5\r\nConnection: close\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8\r\nUser-Agent: ShareImportExport/1.0\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nHost: localhost:8080\r\nCookie: JSESSIONID=8B7E6BE08252B678D9C7277F0BD2DDCD; alfLogin=1428296551; alfUsername3=admin\r\n\r\n'
reply: 'HTTP/1.1 500 Internal Server Error\r\n'
header: Server: Apache-Coyote/1.1
header: Content-Type: text/html;charset=ISO-8859-1
header: Transfer-Encoding: chunked
header: Date: Mon, 06 Apr 2015 05:02:31 GMT
header: Connection: close
Log out (admin)
GET http://localhost:8080/share/page/dologout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants