nokia / RED

RED - Robot Editor
Other
339 stars 112 forks source link

RED Unable to start XML-RPC Server #244

Closed alejandro-serrano closed 5 years ago

alejandro-serrano commented 6 years ago

Hi RED Team,

This is my first time trying to use RED and I'm getting the following issue when I try to setup my Robot Framework environment within the tool. unable to start xml-rpc server

If I try to add manually the location of Python interpreter with Robot Framework installation through the Add... button in the same window, it doesn't work either.

My environment is configured as follows:

Any assistance would be appreciated. Thanks!

KrzysztofJozefowicz commented 6 years ago

Hi are you running win7? If so, there is bug for checking files (xml server is an python server running in background which gives back information about robot stuff) - https://stackoverflow.com/questions/919918/file-exists-returns-false-when-file-exists

What I can propose, try to restart RED and see if this fix itself, if not , change interpreter from Windows -> Preferences -> Robot Framework -> Interpreters and check if this changes anything.

Last resort: please copy following files to local: https://github.com/nokia/RED/tree/master/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts

in RED.ini , at the end of the file, include following line: -Dred.connectToServerAt=127.0.0.1:15000 This will tell RED to connect to running server on localhost under 15000 port,

first start: robot_session_server.py 15000 than RED

We would be glad to hear about the outcome.

alejandro-serrano commented 6 years ago

I am running on Windows 10 64-bit Operating System. Additionally, I'm using the eclipse plugin rather than RED standalone application.

Restarting Eclipse is not working. I have downloaded latest version of RED standalone app and when I try to execute Red.exe I get the following error:

image

I have started the robot_session_server and added the JVM argument as mentioned in the post above. Still not working.

Further information, I am running with Java 8 32-bit, Python 2.7.14 32-bit.

michalanglart commented 6 years ago

As you can see here https://github.com/nokia/RED/releases/tag/0.8.7 we do not provide standalone 32-bit RED. Either you need 64-bit Java or alternatively you may install 32-bit eclipse and install RED feature in it.

michalanglart commented 6 years ago

Can you please provide errors logged into .log file from your eclipse installation? The file is located in workspace/metadata folder

alejandro-serrano commented 6 years ago

Got it. Thanks for the clarification.

Using RED feature in a 32-bit eclipse lead us to the original problem where I am getting the "Unable to start XML-RPC Server" error message.

1.- Does it means even using 32-bit eclipse which is going to need Java 32-bit version is not going to work either way?

2.- Is RED Eclipse plugin only supported for Eclipse 64-bit only too?

alejandro-serrano commented 6 years ago

.log

michalanglart commented 6 years ago

RED is supported for 32-bits eclipse too. The only thing is that we do not release standalone package for such systems. We always release 4 zips:

However you may have 32-bits JVM, install 32-bits eclipse based application and inside it you may install RED either from feature zip, eclipse Marketplace or our update site.

I've looked into .log file and the exception you're experiencing is thrown from this line of code: https://github.com/nokia/RED/blob/5306bf8ae55c12631e39329258bb49ad3fc8d5f3/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/executor/PythonInterpretersCommandExecutors.java#L96

When RED needs to start robot_session_server it copies the file to directory created in your local %TEMP% directory. In your case the copying failed for some reason and as a result this exception is thrown. What could possibly be wrong:

By the way - yo can still try @KrzysztofJozefowicz hint but edit eclipse.ini file instead of RED.ini

alejandro-serrano commented 6 years ago

In fact, Eclipse is able to create a RobotTemDir in the %TEMP% folder with no issues.

image

For what is worth it, I have replicated my environment in a different machine except that I am using Windows 7 instead of Windows 10:

Guess what? It is working fine in the Windows 7 machine!

At this point, it seems that something on my Windows 10 machine is making the RED Eclipse plugin to fail. Having said that, I will let you guys decide whether to close this issue and have it just as a reference if some else experiments the same issue in the future, or in case you want to dig more I can provide you as much information as you request.

This can be considered as a very very very edge case.

Thanks for all your support on this.

NOTE: I have been working with Robot Framework since 7 years and a half ago, this is my first attempt to use RED and I can tell you at least that on my Windows 7 machine it is working fine and it looks promising, really cool!

alex473x commented 5 years ago

Hi RED Team, I have a similar issue when trying to "automatically discover and add libraries to red.xml" It takes very long time and at the end, i have got following error messsage: An internal error occurred during : "Discovering libraries". Unable to communicate with XML-RPC server Here is log file: .log).

I'm under Windows 7 and the problem occurs on RED 0.8.7 / RED 0.8.2 / Eclipse Photon with Plugin. It was working well for 6 month but now it fails every time and I don't see what changed on my PC.

I tried solution proposed in previous post, i.e. launching robot_session_server.py. The error disapears. But it does not discover any libraries: in Project Explorer, I get [???] for "Robot Standard Library "

Thanks for you help

michalanglart commented 5 years ago

It looks like you're having problems with connectivity over HTTP.

RED starts in background a small server in python with which it communicates on localhost using XML-RPC over HTTP. In your .log file there are exceptions visible that RED was unable to connect (Connection refused).

However there are also different exceptions coming from eclipse (it seems trying to check for updates) with the same reason: connection refused when trying to connect over HTTP. For example:

!ENTRY org.eclipse.equinox.p2.transport.ecf 2 0 2018-09-26 15:14:50.069
!MESSAGE Connection to http://download.eclipse.org/releases/oxygen/p2.index failed on Connection refused: connect. Retry attempt 0 started
!STACK 0
java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at org.eclipse.ecf.internal.provider.filetransfer.httpclient4.ECFHttpClientProtocolSocketFactory.connectSocket(ECFHttpClientProtocolSocketFactory.java:86)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:179)
    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144)
    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:134)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:612)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:447)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer.performConnect(HttpClientRetrieveFileTransfer.java:1084)
    at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer.access$0(HttpClientRetrieveFileTransfer.java:1075)
    at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer$1.performFileTransfer(HttpClientRetrieveFileTransfer.java:1071)
    at org.eclipse.ecf.filetransfer.FileTransferJob.run(FileTransferJob.java:74)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

Maybe this is some firewall issue?

alex473x commented 5 years ago

Is there a way to check connexion to XML-RPC server via command line ?

KrzysztofJozefowicz commented 5 years ago

I wonder if this is not related wit ownership of Temp folder or anti-virus as discussed here: https://superuser.com/questions/642626/cant-execute-from-temp-folder-in-windows-7

We should discuss if robot server could be copied to workspace metadata folder instead of Temp

śr., 26 wrz 2018, 16:11 użytkownik alex473x notifications@github.com napisał:

Is there a way to check connexion to XML-RPC server via command line ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nokia/RED/issues/244#issuecomment-424730067, or mute the thread https://github.com/notifications/unsubscribe-auth/AD0H9WASX01EXrFmpgD3sHDYDRYMvn_Cks5ue4r5gaJpZM4WnMlW .

michalanglart commented 5 years ago

This could be a potential reason for RED session server problem. But temporary folder issues does not explain exceptions thrown when eclipse is contacting update sites in order to see if something can be updated.

alex473x commented 5 years ago

Eclipse network configuration (especially Proxy) is not configured on my computer, which explain exceptions thrown when eclipse is contacting update sites.

Same execution(with same issue) connected on a network without proxy: .log

alex473x commented 5 years ago

I wonder if this is not related wit ownership of Temp folder or anti-virus as discussed here: https://superuser.com/questions/642626/cant-execute-from-temp-folder-in-windows-7 We should discuss if robot server could be copied to workspace metadata folder instead of Temp śr., 26 wrz 2018, 16:11 użytkownik alex473x notifications@github.com napisał: Is there a way to check connexion to XML-RPC server via command line ? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#244 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AD0H9WASX01EXrFmpgD3sHDYDRYMvn_Cks5ue4r5gaJpZM4WnMlW .

I tried to copy an executable in %TEMP% and i do not have any problem to run it by double click on it or by calling it in command line. It worked well (with RED or with Eclipse + Robot plugin) for many months and one day, this problem appears. Side effect of Java/Python/other tool update ?

michalanglart commented 5 years ago

Maybe - what have you updated recently?

alex473x commented 5 years ago

Not easy to say as I have to install several tools for my job. What I can say is that previous tests were done on following configuration:

KrzysztofJozefowicz commented 5 years ago

Thanks for feedback, there were already reports about connection refused but we are unable to reproduce it in our regression as this may be connected with OS/env itself.

alex473x commented 5 years ago

With a clean virtualenv the problem disappears !

michalanglart commented 5 years ago

You can perform some experiment which would tell us if this is temporary folder issue or connectivity issue. Normally RED starts this small server in python and connects to it asking about some robot-related data. You can however start it manually and tell RED to connect to it. In order to do it:

  1. When RED is running go to %TEMP% folder and find a directory with name starting from RobotTempDir
  2. copy *.py files from this directory to some other place on your disc
  3. exit RED (this should remove RobotTempDir from %TEMP%)
  4. start the server manually from console:
    python robot_session_server.py 12345
  5. this will start the server on you localhost listening on port 12345
  6. edit RED.ini (or eclipse.ini if you have RED installed in eclipse) file; add following line:
    -Dred.connectToServerAt=127.0.0.1:12345
  7. save the file and start RED/eclipse

If you don't observe those problems you had earlier then it looks like we have some temporary folder issue; otherwise it would mean that there is connectivity problem.

EDIT: It's important that the line in *.ini file has to be insterted after vmargs line.

KrzysztofJozefowicz commented 5 years ago

ok, there should not be difference between clean python and venv from python point of view.

Apart from Michal suggestions, my wild guess is that your python installation folder may have different privileges/ownership than venv ( python folder is usually on C:\ with some restrictions but venv is created by you in preferable location). Could you verify what would happen:

alex473x commented 5 years ago

Sorry, I was not clear. I have now 2 venv:

So I think the problem does not come from privileges/ownership but on something which goes wrong in my venv

alejandro-serrano commented 5 years ago

I have upgraded RED plugin to the latest version. It is working fine now no my Win10 Machine. I'm not seeing the original issue posted here anymore.

Thanks for your support!

michalanglart commented 5 years ago

I'm closing this one as it seems that both of you guys @alex473x and @alejandro-serrano are able to work with RED and additionally we do not have clear understanding if this was something wrong with RED or with the environment.

alsido commented 5 years ago

After updating to 0.8.12 the solution from this comment should be reverted:

Last resort: please copy following files to local: https://github.com/nokia/RED/tree/master/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts

in RED.ini , at the end of the file, include following line: -Dred.connectToServerAt=127.0.0.1:15000 This will tell RED to connect to running server on localhost under 15000 port,

The line -Dred.connectToServerAt=127.0.0.1:15000 must be removed from RED.ini, otherwise RED won't work neither with nor without starting robot_session_server.py.

michalanglart commented 5 years ago

RED won't work neither with nor without starting robot_session_server.py

robot_session_server script was updated in version 0.8.12 so one has to update the script sources in case of server started manually

code4happylife commented 4 years ago

still can not solve this issue

michalanglart commented 4 years ago

Hi,

can you provide any detalis? Your operating system, python and RF versions, errors logged, content of /metadata/.log file?

mei98 commented 2 years ago

"Unable to start XML-RPC server using command: C:\Users\meimei\AppData\Local\Microsoft\WindowsApps\python3.exe "

Hi, I got a problem. My Robot project which I create on Eclipse doesn't recognized its libraries, instead of loading the lib automatically, it created an linspecs folder, I try to check and it show the message above. And also, I don't have any options look like "Interpreters" in "Robot framework". Is it the cause of my problems and how can I fix it?

MiladZarour commented 2 years ago

image I got the same here as well I don't know how to solve it

eugenewango commented 2 years ago

Same problem,someone please assist!

image

devanshcache commented 2 years ago

@MiladZarour @eugenewango Hi, I am having the same error. could you guys solve it?

tonyparsa commented 2 years ago

I am seeing the same issue, can anyone help? image

java version "1.8.0_202" Robot Framework 5.0 Python 3.10.4 Ellipse Version: 2022-03 (4.23.0) Build id: 20220310-1457 Win 10 64 bit

natashanugrah commented 2 years ago

Hi, I have same issue like you guys @tonyparsa @eugenewango @MiladZarour. have you guys know how to solve it? thank you error_red

kmraoui2 commented 2 years ago

hi, I had the same issue, it seems to be fixed. here is what I did:

  1. open your cmd line as an admin
  2. uninstall robotframework 5
  3. install robotframework version 3.2.1
  4. be careful if you reinstall another robotframework-* library, it did upgrade my robotframework back to version5 (just redo 2 and 3).
  5. restart eclipse

I hope this helps someone.

payam77 commented 2 years ago

hi, I had the same issue, it seems to be fixed. here is what I did:

  1. open your cmd line as an admin
  2. uninstall robotframework 5
  3. install robotframework version 3.2.1
  4. be careful if you reinstall another robotframework-* library, it did upgrade my robotframework back to version5 (just redo 2 and 3).
  5. restart eclipse

I hope this helps someone.

Thanks, it's now working for me, I guess the latest Robot framework is not supported yet.

payam77 commented 2 years ago

It was working okay until I installed the latest Seleniumlibrary and phythonlibcore, then I started receiving build errors. I tried uninstalled Red and installed it again and the robot framework was updated to 5.0 again.

lleen12 commented 2 years ago

I had the same problem,I try to some ways ,but no work. Have some guys solve the problem?please give some advices,thank you very much. WIN10 64bit Eclipse IDE for Eclipse Committers (includes Incubating components) Version: 2022-03 (4.23.0) Build id: 20220310-1457

Robot Framework 5.0.1

java version "1.8.0_333" Java(TM) SE Runtime Environment (build 1.8.0_333-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.333-b02, mixed mode)

Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Warning: This Python interpreter is in a conda environment, but the environment has not been activated. Libraries may fail to load. To activate this environment please see https://conda.io/activation image image

ravidon2 commented 1 year ago

Run these command to solve @ internal error occured during: "Building". Unable to communicate with XML-RPC server ERROR

  1. pip uninstall robotframework
  2. pip install --no-cache-dir robotframework==3.2.2
  3. robot --version or pip -list