This chapter covers troubleshooting procedures with this module. While we don’t expect you to have trouble,
there are some cases where you might not have everything working right. We’ve tried to provide an easy reference
for diagnosing and fixing those issues here.
Connection and configuration issues¶
Although setup and configuration is pretty simple, if you do have something not quite right, it
may be hard to figure out what’s wrong. That’s when you come to this chapter.
We’ve added quite a bit of self diagnostics and error messages for many of the likely issues that can
happen trying to start up a connection to SAS. Each access method has its own set of usual suspects. With a
little help and explaination here, you can probably diagnose and correct any issue you might have.
Problems in this category will be when using the saspy.SASsession() method to connect to a SAS session.
The very first thing to look at is your sascfg_personal.py file (based off the examples in sascfg.py in
the installation directory). This is where the configurations definition are. The sample file itself has
documentation and so does Installation.
Common diagnostics¶
Although each access method has its own ways something can go wrong, there are some common diagnostics
you will get and can use to track down the issue.
The first is that if the SASsession() method fails, it will return any erros it can, as well as the
actual command it was trying to run to connect to SAS. That will vary with access method, but in each
case, you can cut-n-paste that command into a shell on the machine where Python is running
and that may provide more diagnostics and error messages then may have been displayed from SASsession().
For instance, here’s a very simple case using the STDIO access method on a local linux machine. The
Configuration Definition is nothing but a valid path which should work.
default = {'saspath': '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8'}
When I try to run I get the following:
Linux-1> python3.5 >>> import saspy >>> sas = saspy.SASsession() SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file. Attempted to run program /opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8 with the following parameters: ['/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8', '-nodms', '-stdio', '-terminal', '-nosyntaxcheck', '-pagesize', 'MAX', ''] Try running the following command (where SASPy is running) manually to see if you can get more information on what went wrong: /opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8 -nodms -stdio -terminal -nosyntaxcheck -pagesize MAX No SAS process attached. SAS process has terminated unexpectedly.
I can see from that error it didn’t work, but it didn’t really tell me why or what to do about it. Well,
it did say I should try running that command to see if I could get better diagnostics. What the heck, let’s try:
Linux-1> /opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8 -nodms -stdio -terminal -nosyntaxcheck -pagesize MAX ERROR: The current date of Tuesday, March 14, 2017 is past the final ERROR: expiration date for your SAS system, which is Monday, January 2, 2017. ERROR: Please contact your SAS Installation Representative to obtain your ERROR: updated SAS Installation Data (SID) file, which includes SETINIT ERROR: information. To locate the name of your SAS Installation Representative go to http://support.sas.com/repfinder and provide your site number 70068118 and company name as Linux for x64 All Compatible Non-Planning Products. On the SAS REP list provided, locate the REP for operating system LIN X64. ERROR: Initialization of setinit information from SASHELP failed. NOTE: Unable to initialize the options subsystem. ERROR: (SASXKINI): PHASE 3 KERNEL INITIALIZATION FAILED. ERROR: Unable to initialize the SAS kernel.
Well go figure. My SAS license has expired.
The same process can be used with other access methods. Now we’ll look at what can be misconfigured for the
various connection methods, see what the errors look like, and how you can determine what the problem is.
STDIO¶
There are only a couple of things that can go wrong here. First, this only works on Unix, not Windows,
so if you’re having problems getting to to work from Windows, well there you go.
Second, the only thing you really need to have right is the path to the SAS startup script in your SAS
installation. The ‘saspath’ value in your configuration definition needs to be correct and accessible.
If, for instance, you just installed SASPy on your PC and then tried to use it, without configuring it,
you will see the following error, since the example config only has one configuration definition which
can’t work on Windows.
>>> import saspy >>> sas = saspy.SASsession() Using SAS Config named: default Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:UserssastpwAppDataLocalProgramsPythonPython311Libsite-packagessaspysasbase.py", line 556, in __init__ raise SASIONotSupportedError(self.sascfg.mode, alts=['IOM']) saspy.sasexceptions.SASIONotSupportedError: Cannot use STDIO I/O module on Windows. Try the following: IOM >>>
If you see that error, go read the configuration doc here: Configuration
STDIO over SSH¶
The same issues in STDIO above are true here, with one extra component: ssh. The ‘saspath’ value has to be right, and
it has to be right on the remote Linux machine that you are ssh’ing to. That might not be the same path
as might be on your local SAS deployment.
Secondly, this requires that you have passwordless SSH configured and working for each user that will be connecting
between the local and remote machines, or or you can use sshpass. That can be diagnosed independant of this module and
Python. If the connection cannot be made, you should see that error message with the command that was
trying to be executed, and you can run it to get better diagnostic error messages that can tell you if its
a problem with your SSH credentials, the machine you’re trying to reach isn’t listening, or any other
problem there might be.
>>> import saspy >>> sas = saspy.SASsession(cfgname='ssh') SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file. Attempted to run program /usr/bin/ssh with the following parameters:['/usr/bin/ssh', '-t', 'tom64-2', '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_en', '-fullstimer', '-nodms', '-stdio', '-terminal', '-nosyntaxcheck', '-pagesize', 'MAX', ''] Try running the following command (where saspy is running) manually to see if you can get more information on what went wrong: /usr/bin/ssh -t tom64-2 /opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_en -fullstimer -nodms -stdio -terminal -nosyntaxcheck -pagesize MAX No SAS process attached. SAS process has terminated unexpectedly.
So, running that command can tell me what the problem is.
Linux-1> /usr/bin/ssh -t Linux-2 /opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_en -fullstimer -nodms -stdio -terminal -nosyntaxcheck -pagesize MAX ssh: Could not resolve hostname Linux-2: Name or service not known or maybe another problem: Linux-1> /usr/bin/ssh -t Linux-2 /opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_en -fullstimer -nodms -stdio -terminal -nosyntaxcheck -pagesize MAX ssh: connect to host Linux-2 port 22: Connection refused or if it is that you do not have passwordless ssh set up, even though you can connect to that machine, you might see this (prompting you for pw) Linux-1> /usr/bin/ssh -t Linux-2 /opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_en -fullstimer -nodms -stdio -terminal -nosyntaxcheck -pagesize MAX user@Linux-2's password: Permission denied, please try again. user@Linux-2's password: Permission denied, please try again. user@Linux-2's password: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
To diagnose ssh further, you can ad -v (-vv, -vvv) to the command line to see more diagnostic information.
For instance, everything seems set up correctly but after running ssh it just says ‘Connection closed by 10.17.12.14’
Linux-1> /usr/bin/ssh -t Linux-2 /opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_en -fullstimer -nodms -stdio -terminal -nosyntaxcheck -pagesize MAX Connection closed by 10.17.12.14 adding in -v[v[v]] can show that in this case, I just didn't have permission to get to this host via any authentication method Linux-1> /usr/bin/ssh -vvv -t Linux-2 /opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_en -fullstimer -nodms -stdio -terminal -nosyntaxcheck -pagesize MAX [lot's of output removed. just showing some of it here] debug1: Host 'Linux-2' is known and matches the RSA host key. debug1: Found key in /usr/home/.ssh/known_hosts:480 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password debug1: Next authentication method: gssapi-keyex debug1: No valid Key exchange context debug1: Next authentication method: gssapi-with-mic debug1: Unspecified GSS failure. Minor code may provide more information Credentials cache file '/tmp/krb5cc_894' not found debug1: Unspecified GSS failure. Minor code may provide more information Credentials cache file '/tmp/krb5cc_894' not found debug1: Next authentication method: publickey debug1: Trying private key: /usr/home/.ssh/identity debug1: Offering public key: /usr/home/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 277 debug1: read PEM private key done: type RSA Connection closed by 10.17.12.14 As you can see, it tried multiple authentication methods, and although I have keys set up and the host is known, I just don't have a valid key for that system.
IOM¶
This access method has the most possibilities of having something misconfigured, because it has more
components that all have to connect together. But, it also has the most diagnostics to help you out.
There are basically two possibilities where something can go wrong: Java or IOM. Let’s look at Java first.
There are three things that are likely to be the problem.
Java isn’t installed or configured right, or you don’t have the right Java command for ‘java’ in your configuration definition.
You don’t have your classpath right, or don’t have the right JAR files.
An IOM specific issue like host/port aren’t right, user/pw or Windows path issues
Java problems¶
This error is descibed below:
-
The system cannot find the file specified
Java startup problems will be caught and whatever system error(s) there were will be returned. And, like in the cases above,
you will still get the exact command trying to be run, so you can always run it too and see if there are any more diagnostics
and error messages.
Here an example of the first case, a bad path to the Java command. This example is from Jupyter Notebook on Windows.
sas = saspy.SASsession(cfgname='winlocal', results='HTML', java='c:java')
The OS Error was: The system cannot find the file specified SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file. Attempted to run program c:java with the following parameters:['c:java', '-classpath', 'C:javasas.svc.connection.jar;C:javalog4j.jar; C:jarssas.security.sspi.jar;C:jarssaspyiom.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '59110', '-stdoutport', '59111', '-stderrport', '59112', '-zero', ''] If no OS Error above, try running the command (where saspy is running) manually to see what is wrong: c:java -classpath "C:javasas.svc.connection.jar;C:javalog4j.ja;C:jarssas.security.sspi.jar;C:jarssaspyiom.jar" pyiom.saspy2j -host localhost -stdinport 59107 -stdoutport 59108 -stderrport 59109 -zero No SAS process attached. SAS process has terminated unexpectedly.
And if we submit that command, we get a slightly different error message than SASPy received, but it shows the same problem:
there is no c:java command to execute.
C:> c:java -classpath "C:jarssas.svc.connection.jar;C:jarslog4j.jar;C:jarssas.security.sspi.jar;C:jarsas.core.jar;C:jarssaspyiom.jar" pyiom.saspy2j -host localhost -stdinport 52061 -stdoutport 52062 -stderrport 52063 -zero 'c:java' is not recognized as an internal or external command, operable program or batch file.
Classpath problems¶
So what about CLASSPATH problems? Here are three cases. The first is just the wrong path, so Java won’t be able to find the main class to run.
The second case has a valid classpath, but is missing one of the IOM jars. The third is a case with EG versions of the jars, not from a SAS 9 install.
These errors are descibed below:
-
Error: Could not find or load main class pyiom.saspy2j
-
Error: Unable to initialize main class pyiom.saspy2j
Caused by: java.lang.NoClassDefFoundError: org/omg/CORBA/UserException -
Java Error:
java.lang.NoClassDefFoundError: com/sas/services/connection/ConnectionFactoryException -
The ‘correct’ error when your classpath is ok
-
Just what a bad classpath might look like:
sas = saspy.SASsession(cfgname='winlocal', results='HTML', classpath='.')
Java Error: Error: Could not find or load main class pyiom.saspy2j Subprocess failed to start. Double check your settings in sascfg_personal.py file. Attempted to run program java with the following parameters:['java', '-classpath', '.', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '59102', '-stdoutport', '59103', '-stderrport', '59104', '-zero', ''] If no Java Error above, try running the following command (where saspy is running) manually to see if it's a problem starting Java: java -classpath "." pyiom.saspy2j -host localhost -stdinport 59102 -stdoutport 59103 -stderrport 59104 -zero No SAS process attached. SAS process has terminated unexpectedly.
And if we submit that command, we see the same error that was reported.
C:>java -classpath "." pyiom.saspy2j -host localhost -stdinport 59102 -stdoutport 59103 -stderrport 59104 -zero Error: Could not find or load main class pyiom.saspy2j
To demonstate the error for a missing JAR file, let’s comment out one of the IOM JAR files:
cp = "C:jarssas.svc.connection.jar" cp += ";C:jarslog4j.jar" cp += ";C:jarssas.security.sspi.jar" #cp += ";C:jarssas.core.jar" cp += ";C:jarssaspyiom.jar" sas = saspy.SASsession(cfgname='winlocal', classpath=cp) Java Error: java.lang.NoClassDefFoundError: com/sas/util/ChainedExceptionInterface at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.privateGetMethodRecursive(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod(Unknown Source) at sun.launcher.LauncherHelper.validateMainClass(Unknown Source) at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Caused by: java.lang.ClassNotFoundException: com.sas.util.ChainedExceptionInterface at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 19 more Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" Subprocess failed to start. Double check your settings in sascfg_personal.py file. Attempted to run program java with the following parameters:['java', '-classpath', 'C:\java\sas.svc.connection.jar;C:\java\log4j.jar;C:\jars\sas.security.sspi.jar;C:\jars\saspyiom.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '59110', '-stdoutport', '59111', '-stderrport', '59112', '-zero', ''] If no Java Error above, try running the following command (where saspy is running) manually to see if it's a problem starting Java: java -classpath "C:javasas.svc.connection.jar;C:javalog4j.jar;C:jarssas.security.sspi.jar;C:jarssaspyiom.jar" pyiom.saspy2j -host localhost -stdinport 59110 -stdoutport 59111 -stderrport 59112 -zero No SAS process attached. SAS process has terminated unexpectedly.
And if we run that command ourselves… Same error as was reported.
C:> java -classpath "C:javasas.svc.connection.jar;C:javalog4j.jar;C:jarssas.security.sspi.jar;C:jarssaspyiom.jar" pyiom.saspy2j -host localhost -stdinport 59110 -stdoutport 59111 -stderrport 59112 -zero Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: com/sas/util/ChainedExceptionInterface at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.privateGetMethodRecursive(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod(Unknown Source) at sun.launcher.LauncherHelper.validateMainClass(Unknown Source) at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Caused by: java.lang.ClassNotFoundException: com.sas.util.ChainedExceptionInterface at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 19 more
-
The problem with versions 9 Java, not having CORBA available.
This problem has now been solved in a different way. I’ll leave the original below for reference, but here is the
solution to this problem, along with Java 10, 11 … which was not able to be solved that way as they no longer
even had CORBA available. As of version 3.1.1, saspy now includes the following 5 jars in the java/thirdparty directory.
Just add these jars into your classpath (as shown in the onfiguration doc for IOM) and this will work for any Java
version.
glassfish-corba-internal-api.jar
glassfish-corba-omgapi.jar
glassfish-corba-orb.jar
NOTICE.md
pfl-basic.jar
pfl-tf.jar
Old answer, no longer the solution:
A new issue has been reported when using Java9. The java IOM client is dependant on CORBA, which is in Java9 but no longer in its default search path.
This can be resolved by adding it back in, using the ‘javaparms’ key of your configuration definition as shown below.
Version 11 Java doesn’t even ship CORBA, so the Java IOM client won’t yet work with that version. The IOM group is currently investigating a solution to this.
If you see an error like this:
Using SAS Config named: winiomwin Java Error: Error: Unable to initialize main class pyiom.saspy2j Caused by: java.lang.NoClassDefFoundError: org/omg/CORBA/UserException
Then you can add CORBA back into the search path via the ‘javaparms’ key (there may be other ways you can do this, but this has been reported to work):
winiomwin = {"java" : "java", "encoding" : "windows-1252", "classpath": cpW, "javaparms": ["--add-modules=java.corba"], }
-
There can be an issue using some versions of these jars that aren’t from a SAS9 instalation. Some EG client jars don’t have all the necessary classes in them.
Although I don’t have any of those jars to run an actual test for this, I’ve copied the following traceback from one of the issues where this was reported.
The NoClassDefFounfError is the clue here, referring to a com/sas/… class that isn’t defined.
Java Error: java.lang.NoClassDefFoundError: com/sas/services/connection/ConnectionFactoryException at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.privateGetMethodRecursive(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod(Unknown Source) at sun.launcher.LauncherHelper.validateMainClass(Unknown Source) at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Caused by: java.lang.ClassNotFoundException: com.sas.services.connection.ConnectionFactoryException at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 7 more Error: A JNI error has occurred, please check your installation and try again Exception in thread "main"
-
When you run the java command yourself and the classpath is ok, you still get an error.
If you run the Java command and you see an error similar to the following, about a socket connection failure, that suggests that your CLASSPATH is correct
and that the problem might be connecting to the IOM server. That error shows that java came up and is running code from saspyiom.jar. It is trying to connect
back to the python process, which isn’t running, thus the connection error. But it means, at least, saspyiom.jar was found and the other SAS jars too.
java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:211) at pyiom.saspy2j.main(saspy2j.java:109) Exception in thread "main" java.lang.NullPointerException at pyiom.saspy2j.main(saspy2j.java:116)
IOM specific errors¶
So if Java is coming up, but you still fail to connect, then it is a problem connecting to IOM.
The IOM Error message will be reported, followed by the command that was trying to be run. Below
are the usual IOM errors and what to do about them.
There are a few obvious misconfigurations that can happen here, and these are the likely error you may see.
Scroll down based upon the number to see an example of that error and help on why that may occur and what to do about it.
-
The application could not log on to the server “host:port”. No server is available at that port on that machine.
-
The application could not log on to the server “host:port”. The user ID “wrong_user” or the password is incorrect.
-
The native implementation module for the security package could not be found in the path.
-
The application could not find a command to launch a SAS Workspace Server.
-
The application could not log on to the server. The server process did not start.
-
The application could not log on to the server “localhost:0”. Integrated Windows authentication failed. OR
The security package failed while authenticating a user.
-
The application could not create a tunnel to the server “127.0.0.1:55517”.
-
None of the requested encryption algorithms are supported by both peers: xxx.
-
An exception was thrown during the encryption key exchange.
Here are examples of each of the above problems:
-
The application could not log on to the server “Linux-1:333”. No server is available at that port on that machine.
For this error, either the ‘iomhost’ or ‘iomport’ you’ve specified aren’t right, or the server isn’t up and available to be connected to.
You may have specified the host or port for the metadata server instead of the host of the object spawner and
port for theworkspace server.
>>> sas = saspy.SASsession(iomport=333) # clearly the wrong port The application could not log on to the server "Linux-1:333". No server is available at that port on that machine. SAS process has terminated unexpectedly. Pid State= (11195, 64000) SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file. Attempted to run program /usr/bin/java with the following parameters:['/usr/bin/java', '-classpath', '/jars/sas.svc.connection.jar:/jars/log4j.jar:/jars/sas.security.sspi.jar:/jars/sas.core,jar: /jars/saspyiom.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '45757', '-stdoutport', '57809', '-stderrport', '33153', '-iomhost', 'Linux-1', '-iomport', '333', '-user', 'user', ''] No SAS process attached. SAS process has terminated unexpectedly.
-
The application could not log on to the server “Linux-1:8591”. The user ID “wrong_user” or the password is incorrect.
Your credentials were specifed wrong, or you don’t have permission to connect. This can also happen when there are more than one
App Server and you didn’t specify which one to connect to. The object spawner will only try the first one in its list, so it might
be trying to connect you to the wrong App Serever.
>>> sas = saspy.SASsession(omruser='wrong_user') The application could not log on to the server "Linux-1:8591". The user ID "wrong_user" or the password is incorrect. SAS process has terminated unexpectedly. Pid State= (11449, 64000) SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file. Attempted to run program /usr/bin/java with the following parameters:['/usr/bin/java', '-classpath', '/jars/sas.svc.connection.jar:/jars/log4j.jar:/jars/sas.security.sspi.jar:/jars/sas.core,jar: /jars/saspyiom.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '49660', '-stdoutport', '46794', '-stderrport', '51907', '-iomhost', 'Linux-1', '-iomport', '8591', '-user', 'wrong_user', ''] No SAS process attached. SAS process has terminated unexpectedly.
-
The native implementation module for the security package could not be found in the path.
For Windows Local connection (and remote connections using IWA via {‘sspi’ : True}), you don’t have the path to the sspiauth.dll in yout System Path variable. See the configuration doc
to see how to specify this: https://sassoftware.github.io/saspy/install.html#local
>>> import saspy >>> sas = saspy.SASsession() The native implementation module for the security package could not be found in the path. SAS process has terminated unexpectedly. RC from wait was: 4294967290 SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file. Attempted to run program java with the following parameters:['java', '-classpath', 'C:\java\sas.svc.connection.jar;C:\java\log4j.jar;C:\jars\sas.security.sspi.jar;C:\jars\saspyiom.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '59110', '-stdoutport', '59111', '-stderrport', '59112', '-zero', ''] Be sure the path to sspiauth.dll is in your System PATH No SAS process attached. SAS process has terminated unexpectedly.
-
The application could not find a command to launch a SAS Workspace Server.
For Windows Local connection, the registry doesn’t have the right path to the SAS start up command.
>>> sas = saspy.SASsession() The application could not find a command to launch a SAS Workspace Server. SAS process has terminated unexpectedly. RC from wait was: 4294967290 SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file. Attempted to run program java with the following parameters:['java', '-classpath', 'C:\java\sas.svc.connection.jar;C:\java\log4j.jar;C:\jars\sas.security.sspi.jar;C:\jars\saspyiom.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '59110', '-stdoutport', '59111', '-stderrport', '59112', '-zero', ''] Be sure the path to sspiauth.dll is in your System PATH No SAS process attached. SAS process has terminated unexpectedly.
If you get this error: The application could not find a command to launch a SAS Workspace Server.
There is a workaround you can use. Oh course, having a clean SAS install should keep this from happening, but this error has been reported a couple times.
The work around for this is to use the ‘javaparms’ option on the configuration definition to specify the command manually as follows (use the right path on your system, of course):
'javaparms' : ['-Dcom.sas.iom.orb.brg.zeroConfigWorkspaceServer.sascmd="C:PROGRA~1SASHomeSASFOU~19.4SAS.EXE"']
-
The application could not log on to the server. The server process did not start.
For Windows Local connection, the start up command in the registry isn’t formated just right. Blanks, quotes, other.
>>> sas = saspy.SASsession() The application could not log on to the server. The server process did not start. SAS process has terminated unexpectedly. RC from wait was: 4294967290 SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file. Attempted to run program java with the following parameters:['java', '-Dcom.sas.iom.orb.brg.zeroConfigWorkspaceServer.sascmd=C:\PROGRA~1\SASHome\SASFOU~1\9.4\SAS.EXE -config C:\PROGRA~1\SASHome\SASFOU~1\9.4\sasv9.cfg -objectserver -nologo -noinal -noprngetlist', '-classpath', 'C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94485__prt__xx__sp0__1\deploywiz\sas.svc.connection.jar; C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94485___xx__sp0__1\deploywiz\log4j.jar; C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94485__prt__xx__sp0__1\deploywiz\sas.security.sspi.jar; C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94485__pxx__sp0__1\deploywiz\sas.core.jar; C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '57425', '-stdoutport', '57426', '-stderrport', '57427', '-zero', ''] Be sure the path to sspiauth.dll is in your System PATH No SAS process attached. SAS process has terminated unexpectedly.
If you get this error: The application could not log on to the server. The server process did not start.
And you have what seems to be the correct start up command in your registry; key=HKEY_CLASSES_ROOTCLSID{440196D4-90F0-11D0-9F41-00A024BB830C}LocalServer32.
It may still not be formatted exactly right regaring quoted paths, or blanks in the paths, or the char8 ‘~’ parts.
There is a easy way to have SAS re-register this in the Windows Registry that should clean this up and make it correct.
Run your sas.exe (you can do this from a CMD Prompt; may need fully qualified path for sas.exe) with the following option: /regserver
[C:...]sas.exe /regserver
If this doesn’t fix the issue, you can try the same workaround as #4 above, using the javaparms to specify the command.
The best option is to quote all paths in that command. In the error message above, you can see that javaparms was used to specify the command,
which failed. If I quote both of the paths in that parameter, then it works.
'-Dcom.sas.iom.orb.brg.zeroConfigWorkspaceServer.sascmd="C:\PROGRA~1\SASHome\SASFOU~1\9.4\SAS.EXE" -config "C:\PROGRA~1\SASHome\SASFOU~1\9.4\sasv9.cfg" -objectserver -nologo -noinal -noprngetlist'
-
The application could not log on to the server “localhost:0”. Integrated Windows authentication failed. OR
The security package failed while authenticating a user.
These errors imply that your hosts file doesn’t have ‘localhost’ set as an alias for ip 127.0.0.1. Tech Support note
55227 (http://support.sas.com/kb/55/227.html) identifies this issue.
>>> sas = saspy.SASsession(cfgname='winlocal') We failed in getConnection The application could not log on to the server "localhost:0". Integrated Windows authentication failed. SAS process has terminated unexpectedly. RC from wait was: 4294967290 SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file. Attempted to run program java with the following parameters:['java', '-classpath', 'C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94508__prt__xx__sp0__1\deploywiz\sas.svc.connection.jar; C:\Program Files\SASHome\SASDepentManager\9.4\products\deploywiz__94508__prt__xx__sp0__1\deploywiz\log4j.jar; C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94508__prt__xx__sp0__1\deploywiz\sas.security.sspi.jar; C:\Program Files\SASHome\SASDeplotManager\9.4\products\deploywiz__94508__prt__xx__sp0__1\deploywiz\sas.core.jar; C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar; C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil_904500.0.0.0816190000_v940m5\sas.rutil.jar; C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sas.rutil.nls_904500.0.0.20170816190000_v940m5\sas.rutil.nls.jar; C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\sastpj.l_6.1.0.0_SAS_20121211183517\sastpj.rutil.jar', 'pyiom.saspy2j', '-host', '127.0.0.1', '-stdinport', '49207', '-stdoutport', '49208', '-stderrport', '49209', '-zero', '-lrecl', '1048576', ''] Be sure the path to sspiauth.dll is in your System PATH No SAS process attached. SAS process has terminated unexpectedly.
-
The application could not create a tunnel to the server “127.0.0.1:55517” (the port number will vary)
This is an error that can occur trying to make a Local IOM connection to local SAS on your Windows machine.
This one was recently reported in issue 354. Turns out it’s a problem with having the SAS_IOM_PROXYLIST environment variable set.
This is needed sometimes for connecting to remote IOM servers when there are firewalls in the way, or something about that. Either
way, it’s not needed and can cause a failure trying to use a local SAS install over IOM Local saspy connection. Luckilly it’s easy
to resolve. You can simply unset that variable in your Python session before trying to get your SASsession. You can do this inline
if you need this set for remote IOM connections from saspy, or put it in your sascfg_personal.py file if you only connect to local
SAS from saspy but need the variable set for other applications that need it.
>>> import os >>> os.environ['SAS_IOM_PROXYLIST']='https://www.sas.com' >>> os.environ['SAS_IOM_PROXYLIST'] 'https://www.sas.com' >>> >>> import saspy; sas = saspy.SASsession(cfgname='winlocal'); sas We failed in getConnection The application could not create a tunnel to the server "127.0.0.1:54243". SAS process has terminated unexpectedly. RC from wait was: 4294967290 >>> # unset the variable here now. You can do this in your config file it you need it all the time >>> del(os.environ['SAS_IOM_PROXYLIST']) >>> os.environ['SAS_IOM_PROXYLIST'] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:ProgramDataAnaconda3libos.py", line 669, in __getitem__ raise KeyError(key) from None KeyError: 'SAS_IOM_PROXYLIST' >>> # it's been unset now >>> >>> import saspy; sas = saspy.SASsession(cfgname='winlocal'); sas SAS Connection established. Subprocess id is 37100 Access Method = IOM SAS Config name = winlocal SAS Config file = C:ProgramDataAnaconda3libsite-packagessaspysascfg_personal.py WORK Path = C:UserssastpwAppDataLocalTempSAS Temporary Files_TD17980_d10a626_Prc2 SAS Version = 9.04.01M5P09132017 SASPy Version = 3.6.2 Teach me SAS = False Batch = False Results = Pandas SAS Session Encoding = wlatin1 Python Encoding value = cp1252 SAS process Pid value = 17980 >>>
-
None of the requested encryption algorithms are supported by both peers: xxx. (xxx is the method; AES)
This error identifies that your Workspace server is configured to use encryption. The specific method may
show up at the end of the message; for instance AES. This means that you don’t have the 3 encryption jars
in the iomclient directory of the saspy install. See the configuration section for IOM regarding this:
https://sassoftware.github.io/saspy/configuration.html#attn-as-of-saspy-version-3-3-3-the-classpath-is-no-longer-requiredIf this error is for AES, then there’s another solution than having to get those 3 jars and add them to the deployment,
but only for SAS versions prior to M7. M7 requires the encryption jars.
Java 8 (release greater than 151), has the needed support for this in it. So you just need to install the current Java 8
or higher to solve this without needing the jars. -
An exception was thrown during the encryption key exchange.
This is another possible error having to do with encryption, and is addressed by adding the 3 encryption jars to your
saspy deployment, as identified in number 8 just above.
So, hopefully this has shown you how to diagnose connection and configuration problems. When you have things set up right, you shouldn’t
have any problems, it should just work!
Problems running code¶
My model didn’t run¶
When you run an analytical method there are a number of things that occur.
The goal is to have informative messages when things go wrong and in this section we’ll explain what his happening
and how to check the various stages
-
Are the required parameters included?
Each analytical method has a set of required parameters (there are a few that have an empty set but
all the methods must have this specified).The simplest way to find the required and optional parameters is to use the ‘?’ functionality.
Here are two examples for the forest and hplogistic methods respectively:
?ml.forest() ?stat.hplogistic()
The next best option is to use the API Reference for the given method
Both ways will show you the set of required parameters and then the list of optional parameters. The requred set
and optional make up the complete set of parameters the method will take.If you are missing required parameters you will receive a SyntaxError and processing will stop.
SyntaxError: You are missing 1 required statements: {'model'}
Missing optional parameter will produce no warning.
Note
The data parameter does not appear in the required set but it is required for all modeling methods.
-
Do you have extra parameters?
If you include parameters that are neither required or optional then will be removed but as a best practice
don’t test the system. -
Are the parameter the correct type?
Parameters must be specified with the correct type. If you provided an invalid type you should recieve a
SyntaxWarning or SyntaxError and processing will stop.Here are a few of the most common parametes and their valid types
-
The data parameter must be a
SASdata
object. -
The model parameter is a str.
-
The target and inputs can be str, list, or dict types.
-
The nominals must be a list type.
Making the parameters handle more types is a great way to get involved. Enter an issue and we can help you.
-
-
Were errors generated during execution?
If you make it this far, the error is probably in the running of the genereated SAS code.
To investigate, you can display the ERROR_LOG attribute on yourSASresults
object.The resulting output will the SAS log for that generated code. You will be able to see the SAS syntax and then
and error or warning messages in context.If the ERROR_LOG doesn’t give you enough information to resolve your issue you can execute the
following code (assuming your session object is named sas).This will output the SAS log for then entire session (since you last restarted the kernel or your initial connection).
-
Summary
-
Files
-
Reviews
-
Support
-
Tickets ▾
- Bug Reports
- Feature Requests
- Patches
-
News
-
Discussion
-
Donate
-
Git
-
SVN
-
Mailing Lists
Menu
▾
▴
Fatal Error: No Connection Established
Created:
2012-04-23
Updated:
2013-05-30
-
Fatal error: Uncaught exception ‘PDOException’ with message ‘No Connection Established’ in /home/a9791986/public_html/tree/includes/classes/class_pgv_db.php:704 Stack trace: #0 /home/a9791986/public_html/tree/includes/functions/functions_db.php(2744): PGV_DB::prepare(‘SELECT setting_…’) #1 /home/a9791986/public_html/tree/includes/session.php(533): get_user_setting(‘1’, ‘language’) #2 /home/a9791986/public_html/tree/config.php(75): require_once(‘/home/a9791986/…’) #3 /home/a9791986/public_html/tree/index.php(29): require(‘/home/a9791986/…’) #4 {main} thrown in /home/a9791986/public_html/tree/includes/classes/class_pgv_db.php on line 704
Mostly this happens on the Welcome Page and the Portal, when logged in. When you are anonymous the welcome page seems to work just fine, but shows different ‘blocks’. If I reload the page the blocks that load are not consistent.
My only thought is that the different blocks are timing out, I am using free hosting. The PHP time limit is set to 10 even and I can not change that.Users are confused/concerned about the errors and being family are pretty insistent that I should fix them. I’m still trying to sort out all the settings at this point.
Any suggestions as to what I can do?
-
Once you log in, privacy calculations apply. Get a new host that actually provides decent service and parameters. You need at least a 30 second script time, maybe more depending on the size and complexity of your gedcom.
-Stephen
-
Hi Stephen,
I’ve got similar error which occured after I moved to another server. I’m not sure what time do you mean? Some forums refer to database connection timeout and some to script one.Anyway.. my server reports
max_execution_time=30
mysql.connect_timeout=30On previous server it was
max_execution_time=30
mysql.connect_timeout=60I am very suspicious about those values to be guilty because errors occur instantly after page refreshing so.. there is no 30+ sec timeout , not even 2 sec.
Also configuration check reporting «You may not be able to run all functions on large databases with many individuals.
Your maximum time limit is 30″ does not seem to refer to my «large» database because it actually consists of only 108 individuals.The error occurs ONLY on MyGedView page, ALWAYS on right hand side panels. Page reloads quickly (1-2 sec) almost instantly and errors occur randomly (appr 3 errors on every 4 refreshes)
Any hint?
-
Lithodora/Tom,
Both server memory and timeout limits may cause errors in PGV. I am surprised that a 108 person site causes problems. 108 is supposed to be a lucky number — another superstition bites the dust. Do you have large media files?
Anyway, you may not have the same problems. It won’t hurt to upgrade if you’re not already on the SVN version. Let us know who your hosting companies are & how your problem is resolved. This will help others who find themselves in a similar position.
George
-
Server memory doesn’t seem to be an issue here because I’ve tested it on direct copy from other server (with errors on new one) and then on a fresh install with only GEDCOM file imported (no media files). The same errors appear.
My first hosting company (no errors) is http://www.hostmonster.com. The second one is http://www.easyisp.com (with errors). I have good experience with EasyISP and they are very helpful in problem solving but first I have to know what to ask them about.
I have got some idea, but I am not sure. My PHP/MySQL knowledge is not so deep. Maybe the problem sits in number of concurrent connections? This idea comes from my observation, that error appears only on MyGedView page where there is many simultaneous «spinning wheels» running (I suppose, they mean waiting for script/database answer). On other pages error does not show up. Even on start page (logged out) in spite simmilar boxex displayed on the right hand side but left side is different. As an effect, there is less «wheels» (less busy) so I suppose there is less parallel database connections and problem does not occur.
Let me know What d you think?
Tom
PS
In my last post I said, that error occurs always on right hand side panels. This prooved not to be true. It does appear on left hand side boxes also but less often.
-
Tom …
First problem easyisp.com is being listed as an available domain, so if they were having problems when you tried …
Each panel does need an open connection to the database, so if your connections are limited, then you will see problems. Not sure that it is easy to ‘slow down’ things so that you use a smaller number of connections, but enquiring if there is a limit would be the starting point … that is if they are still around
-
Hi,
Sorry for mistake.. http://www.easyisp.pl ofcourse.So you think, that I might be right with my suggestion?
My new server (with errors) shows:
mysql.max_links Unlimited
mysql.max_persistent 100Old one shows:
mysql.max_links Unlimited
mysql.max_persistent UnlimitedCould it be, that 100 persistent connections limit generate that problem? If yes, what can I do about it apart of asking them to increase the number?
Tom
-
I’m sorry, but I have to add another dimension to this disscusion.
I have changed PHP version on my new server (EasyISP) from 5.2 to 5.3 and along with it, some parameters changed. So now it shows:max_execution_time=30
mysql.connect_timeout=60mysql.max_links Unlimited
mysql.max_persistent UnlimitedIt is exactly the same as on the old (working) server. So.. all assumptions about the root of problem vanished
What can I do?
Tom
-
I assume Apache?
Does Apache have limits set? One of the protections from attack is to limit the number of connections that occur in a short time, and this would probably give different errors, so are you still seeing the PDO error in the failing modules?
( Don’t use PDO or MySQL myself — so I can’t compare anything )
-
What kind of limits are you talking about? Have a look yourself and compare
(error site) http://genealogia.dudarscy.pl/a.php
(good site) http://dudarscy.co.cc/a.phpStill, the effect of errors produced while many blocs open at once, tells me to look for reason in growing connections number. My knowledge of PhpGedView script is close to zero so it is hard to tell what is the source of problem.
PS
Is it possible to switch off some blocks showing on MyGedView page?
-
A very important question: What version of PhpGedView are you running? You should be using version 4.3.0, which is also known as the «SVN» version. Download and install instructions are in a recent Help topic whose title begins with «Repost: Download …» This post is actually quite old, but periodically it gets «bumped» to appear at the top of the Help list.
If you can log in as Admin, you can customize the Welcome page to reduce or eliminate unwanted blocks.
If you can’t log in, you can change the contents of the «blocks» directory. Rename the unwanted block scripts to something other than «xxx.php» by changing the «.php» extension. Use a name such as «xxx.foo». Alternatively, just delete the unwanted block scripts altogether. You can always restore them from the PGV install files.
-
If the GEDCOM Welcome block is showing, there’s a link to customize the Welcome page in that block. If this block is not showing, you should see a link to customize the Welcome page at the bottom of the page.
I would suggest that you get rid of the On This Day and the Upcoming Events blocks. These blocks eat up a lot of processing time.
-
Unfortunately, SVN version produces the same error
-
I have reverted to the oryginal copy and as you suggested Gerry removed On This Day and User Favourites from MyGedView.
It helped. Error disappared. I am half-happy because it means, that I am on the edge of available resources and I still do not know what is failing? It is kind of temporary fix.I understand, that changes I’ve made to blocks layout affect only my portal? What do I do to propagate it on the whole system as general setting?
I hope, you can address this problem in next releases.
Tom
-
With such a small GEDCOM, it is unlikely you have exhausted resources. More likely you have a loop or error in your family tree data. Have you run GEDCHECK ?
I have reverted to the oryginal copy
Huh? Do you mean you have NOT upgraded to SVN 4.3? While even this version is rather long-in-the-tooth, it is reasonable stable. Any other version contains significant security holes and XSS problems, as well as serious bugs. I am not saying v4.3 is perfect by any measure, but it is so much better than any other option, you should always be using that version of the project.
-Stephen
-
Stephen,
Do not bother with previous question. I’ve found explanation so it is not serious problem just GEDCOM standard sticking problem. There is no other error.
I’m still trying to find the root of oryginal problem. My error shows (always the same):
Fatal error: Uncaught exception 'PDOException' with message 'No Connection Established' in /home/atomik/domains/dudarscy.pl/public_html/genealogia/includes/classes/class_pgv_db.php:704 Stack trace: #0 /home/atomik/domains/dudarscy.pl/public_html/genealogia/includes/functions/functions_db.php(2744): PGV_DB::prepare('SELECT setting_...') #1 /home/atomik/domains/dudarscy.pl/public_html/genealogia/includes/session.php(533): get_user_setting('1', 'language') #2 /home/atomik/domains/dudarscy.pl/public_html/genealogia/config.php(75): require_once('/home/atomik/do...') #3 /home/atomik/domains/dudarscy.pl/public_html/genealogia/index.php(29): require('/home/atomik/do...') #4 {main} thrown in /home/atomik/domains/dudarscy.pl/public_html/genealogia/includes/classes/class_pgv_db.php on line 704
Look at the line #1.. it looks like simple query «get_user_setting(‘1’, ‘language’)». In my view, Just one db query without any crossreferences whatsoever.. but it fails exactly on this, always! Isn’t it odd? If it was a loop or GEDCOM error, it wouldn’t stop on simple user language query. Imagine, different boxex fail randomly having different history behind and still failing on that simple query. Not likely.
Maybe I misinterpret it? What is your opinion?
Tom
-
Tom — I think you will find that is the FIRST query for a page or module load, so it IS still indicating that something is limiting your database access. I think I would still be looking at an ISP ‘problem’ rather than anything which is wrong in your configuration. I am assuming that the ‘ISP’ is providing the database? This is the norm with most of this shared hosting, and so it’s access to THAT which is restricted.
I run my own database servers so never hit that area …
-
You are right Lester, that it is database connection problem, but have a look on that. It says ‘No Connection Established’. So why is it, that there is a dozen of succesful connections around (obviously because other boxex work) and suddenly one connection fails to establish and it is always the same query comming from the same script line? Isn’t it odd? Does it look to you as database problem? Not for me, because if it was, it would fail on random query. On the other hand, asking for user language happens very often. Each box requires it. Why does it not fail anywhere else? The only common thing (visualy) that distinguish «failng» boxes is «spinning wheel» while waiting. Only those boxex are prune to fail. Maybe this observation will help to resolve the problem?
Tom
-
Tom — you still have not answered the question ‘where is the database?’
If the ISP is providing MySQL as a service, then ‘No Connection Established’ would be the message I would expect when you have exceeded your limit on accessing that service …
-
Ofcourse it is ISP who is providing web and db servers for me. I told before it was www.easyisp.pl.
What limit do you mean I have exceeded? With 100 individuals on GEDCOM file?! and why is it still refusing connection only while asked for user language? Some kind of privacy protection? (just kidding). What about 100.000 indviduals in Stephen’s GEDCOM (myarnolds.com)? What kind of monster server does he have to accomodate 1000 more data than I have?
‘No Connection Established’ message could be the message meaning «you are trying to submit a query but your database is not connected (ie because you didn’t ask to connect, because of failure, because of unaware disconnection.. anything)»
Failure is unlikely because it happens always in the same line of the script.
Anyway, I’ve raised a ticket to my ISP asking for help and maybe I will have some news soon.
Tom
-
Tom — There is a difference between shared hosting, and our running our own servers.
On shared hosting, many ISP’s charge extra for ‘databases’ and so you probably have a limit on how many you can use. The software that runs this is a separate service to that providing the website PHP, so none of the limits on your website settings affect it.
Your ISP is the only person who can answer this problem — I think — as they control the number of connections they allow to the database. The error you are seeing is telling you that you can’t open any MORE connections to the database. That is why we can’t help you other than reducing the number of open connections. It does sound as if easyisp have just restricted access to the database more than your previous ISP and so only they can fix this — if this is indeed the reason — which I am fairly sure now it is.
Just to confirm, you have a connection string for the database which takes you to another ‘domain’ where the databases are managed by easyisp ?
-
Lester,
I admit, it is not easy to say where the problem oryginates. That’s why I asked easyisp for help.
It does sound as if easyisp have just restricted access to the database more than your previous ISP
What kind of restriction do you mean exactly? You can see here, settings for ma previous ISP http://www.dudarscy.co.cc/a.php and compare them with easyisp settings here http://genealogia.dudarscy.pl/a.php. You can see clearly, that:
mysql.max_links=Unlimited
mysql.max_persistent=UnlimitedIn both cases NO LIMIT There is also no limit on the number and size of databases on my account. I have even deleted 2 spare databases today to check if it was a problem. No change. So.. where is the problem? Do they lie and present fake settings?
Just to confirm, you have a connection string for the database which takes you to another ‘domain’ where the databases are managed by easyisp ?
Database is local not remote (localhost in settings) if this is what you are asking about.
-
Tom — the problem here is I’m not quite sure exactly WHERE your database is being managed from. MOST ISP’s run the database service themselves, so as I have already said, the limits you set IN php are not relevant. Now setting ‘localhost’ would suggest to me that the MySQL software is running on your machine, but does the ‘control panel’; for your web hosting give you a separate section for managing your ‘databases’ . On the few shared hosting setups that I have plaid with, you get perhaps one database, and you can manage it via the control panel. I can see from the google translation of easyisp that you get ‘unlimited’ but I would still anticipate that these are ‘hosted’ in a different area to you web pages …
-
I have no faintest idea Lester where are databases hosted. One is sure that they are not on my home computer if this is what you mean by «your machine». «localhost» for me means, that it runs on IP 127.0.0.1 which is local address for operating system pointing to itself. So for me, both (PHP and MySQL) run on the same machine and operating system (phisical or virtual.. doesn’t mater).
I am given DirectAdmin panel for account/domains administration purposes and among others, there is phpMyAdmin available to manage MySQL databases. Both DirectAdmin and phpMyAdmin run on the same IP which is also my domain IP. Is it enough to believe, that MySQL and PHP run on the same server?Tom
Log in to post a comment.
# #node.js #firebase #google-cloud-firestore
Вопрос:
Я пытаюсь использовать SDK администратора для firebase на своей машине. Когда я пытаюсь получить коллекцию пользователей, я получаю Error: 14 UNAVAILABLE: No connection established
. Запись в firestore также ничего не дает. Как я могу это исправить?
РЕДАКТИРОВАНИЕ из документов:
SDK администратора Firebase автоматически подключаются к эмулятору Cloud Firestore, когда установлена переменная среды FIRESTORE_EMULATOR_HOST
У меня действительно есть набор переменных среды, но я пытаюсь подключиться к производству. Как я могу поручить SDK сделать это?
index.js
const admin = require("firebase-admin");
const serviceAccount = require("./serviceAccount.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: ""
});
const snapshot = admin.firestore().collection('users').get().then((snapshot)=>{
snapshot.forEach((doc) => {
console.log(doc.id, '=>', doc.data());
});
}).catch(e=>{
console.error(e);
});
Полный журнал ошибок:
PS C:Userssimeon.ramjitDocumentsprojectscontrollino-server> node index
Error: 14 UNAVAILABLE: No connection established
at Object.callErrorFromStatus (C:Userssimeon.ramjitDocumentsprojectscontrollino-servernode_modules@grpcgrpc-jsbuildsrccall.js:31:26)
at Object.onReceiveStatus (C:Userssimeon.ramjitDocumentsprojectscontrollino-servernode_modules@grpcgrpc-jsbuildsrcclient.js:330:49)
at Object.onReceiveStatus (C:Userssimeon.ramjitDocumentsprojectscontrollino-servernode_modules@grpcgrpc-jsbuildsrcclient-interceptors.js:299:181)
at C:Userssimeon.ramjitDocumentsprojectscontrollino-servernode_modules@grpcgrpc-jsbuildsrccall-stream.js:145:78
at processTicksAndRejections (internal/process/task_queues.js:77:11)
Caused by: Error
at CollectionReference._get (C:Userssimeon.ramjitDocumentsprojectscontrollino-servernode_modules@google-cloudfirestorebuildsrcreference.js:1450:23)
at CollectionReference.get (C:Userssimeon.ramjitDocumentsprojectscontrollino-servernode_modules@google-cloudfirestorebuildsrcreference.js:1439:21)
at Object.<anonymous> (C:Userssimeon.ramjitDocumentsprojectscontrollino-serverindex.js:41:57)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
code: 14,
details: 'No connection established',
metadata: Metadata { internalRepr: Map(0) {}, options: {} }
}
Ответ №1:
Как упоминалось выше, если установлена переменная среды FIRESTORE_EMULATOR_HOST, SDK администратора попытается подключиться к вашему эмулятору.
После этого комментария я удалил переменную env и перезапустил свой терминал, и он успешно подключился к работе
One of the most annoying errors that I’ve faced during my projects is when my Arduino code is not uploading. Many times the reason behind each error was different. After troubleshooting this error over and over, I thought to pen down my experiences and share them in a helpful post.
So, here’s 7 reasons your Arduino code not uploading? The most common reasons your Arduino code is not uploading are:
- Errors in the connection
- Wrong port selection
- Erroneous code
- Drivers not installed
- The board needs resetting
- Presence of a short circuit
- Your board is drawing too much current
As you can see, the reason could be anywhere between a connection error in the circuit to a syntax error in the program. Meaning the problem your Arduino code is not uploading could be happening in the hardware or software. So, let’s check at the reasons in detail and give the right solution to each of these problems.
I wrote a step-by-step guide to upload code to Arduino, if you need a bit more help, check it out here: chipwired.com/uploading-code-arduino
Here’s Why The Arduino Code is not Uploading:
1. Errors in The Connection
One of the reasons why your Arduino code might not be working is because of errors in the connection between the Arduino board and your PC.
One can use a type A/B USB cable to connect the Arduino UNO and MEGA boards via the USB port of a computer, which is OK. But, since we can use such cables for many other applications like charging our mobiles, they can easily give an error.
Moreover, another error in connection could be due to a fault in your computer’s USB port. If it’s not working, your computer won’t recognize the Arduino board; hence, you won’t be able to upload your Arduino code.
Similarly, a damaged Arduino USB port could cause the same problem.
I wrote a step-by-step guide for uploading code to Arduino, which includes details on plugging in the right cables. Check it out here: chipwired.com/uploading-code-arduino/
2. Wrong Port Selection
The port number through which Arduino IDE uploads the program to the board plays a significant role. Before uploading your code, make sure that the port number selected by your Arduino IDE matches the port number at which you connect your Arduino board.
To do so, connect your Arduino board to your PC and open the Arduino IDE. Then, look at the lower right side of the window to find out at which port is Arduino connected. An example text written on the blue stripe at the bottom of the window could be “Arduino UNO on COM17”. This line indicates that your Arduino UNO board is connecting through the serial port COM17, and that’s where the Arduino IDE should upload the code.
How to check if the Arduino IDE is selecting the right port?
- Click on the “Tools” menu present on the top left side of the Arduino IDE window.
- In the drop-down menu, hover over the “Ports” menu.
- Then select the port where your Arduino board is connected.
If it is already selected (you’ll notice a small tick beside it), that means this isn’t the reason why your Arduino code is not uploading.
So, let’s move on to the next possible problem.
3. Erroneous Code
The best lessons are the ones that you learn from your mistakes. If you’re unable to upload your code, then you need to check for errors in your program and correct them.
It’s entirely OK to make mistakes while writing an Arduino code (and any other code to be honest), so if you’re one of those people who end up with a list of errors after writing a program, don’t worry!
Arduino IDE comes with a built-in compiler just like many other programming platforms. This compiler is responsible for checking errors and uploading an error-free program to your Arduino board.
After the compiler checks your program, it will show you the list of errors at the bottom of the screen, which you can quickly identify and correct.
4. Drivers Not Installed
Every software on your computer needs a driver to run because it enables the operating system to communicate with that specific software. Similarly, Arduino also requires drivers to function correctly.
Your Arduino code might not be uploading because of incompatible or outdated drivers or directly no drivers installed at all.
To check whether you have the correct drivers installed on Windows, open the device manager present in the control panel of your PC. You’ll find your Arduino board listed.
To update the Arduino driver to the latest version available, right-click on the name of your Arduino board and click on “update driver.”
After updating the Arduino drivers, go back to your Arduino IDE and check if now it recognizes your board through the “Tools” menu, as explained previously.
Installing the proper drivers and keeping them updated should solve this problem, and you’ll be able to upload your code without any problem.
5. The Board Needs Resetting
Another reason why your Arduino code is not uploading might be that your board has been running for too long and needs a break. All it needs is a push on the tiny reset button embedded in it.
If this doesn’t work, then check out this interesting article showing 5 Simple Ways to Reset Arduino.
In case the reset button on your Arduino board is inaccessible (due to external shields), then you can try connecting a push button as a reset button, as shown in this tutorial.
6. Presence of A Short Circuit
A short circuit on your board can occur if you’ve joined the 5V pin to the ground pin. This error usually happens when working on a project that has too many jumper wires going here and there, one can easily make the mistake of connecting the power pin to the ground pin. When this happens, your PC automatically disconnects your Arduino board from the port, and therefore, you won’t be able to upload your code.
If you were able to upload your code before making those changes in your project circuitry, then a short circuit could be the culprit behind this upload error.
Disconnect your Arduino board from the computer and check all the connections involving the 5V and GND pins. If you find that the 5V and GND pins wee accidentally shorted, rectify the fault and try uploading your code again.
7. Your Board Is Drawing Too Much Current
Are you using a heavy load in your Arduino project? Have you calculated the maximum current requirement of your project?
If your Arduino board is drawing more current than a computer can provide, you need to limit your project’s current requirements because the computer will automatically disconnect your board from the port whenever this happens. You won’t be able to upload your code.
So, make sure that your Arduino is not drawing too much current from your PC.
To read more about the power and current limitations of Arduino, check this short article.
What’s Next?
If you have successfully managed to identify the reason why your Arduino code is not uploading, then you must move on to the next step; troubleshooting.
In case an error in connectivity was the culprit in your case, then you need to either buy a new USB cable or repair your damaged USB port. To avoid inconvenience in the future, you can buy a genuine USB cable designed specially for Arduino, from the official Arduino website. Otherwise, you can buy it from an electronics store, but make sure that the store offers an exchange policy in case the cable is not compatible with Arduino.
Other solutions include selecting the right port from the IDE, updating drivers, and looking for errors in your code and project circuitry. These solutions will solve your problem and will allow you to upload your code without any hassle.
A good practice is always to double-check your code and connections in your Arduino circuit.
Checking the port and drivers before you start writing your code will also save you from uploading errors. So, make sure to keep these points in mind when working on your next Arduino project.
Happy coding!
To Learn More Why Your Arduino Code is not Uploading:
- Why Won’t My Code Upload to Arduino? (moretech.co).
- Why I can’t upload my programs to the Arduino board? (arduino.cc)