Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: CONNECT error gives Invalid login. Please enter the login information again.  (Read 16705 times)
Candy M.
Posts: 139


« on: October 18, 2017, 04:13:53 am »

I have a very simple program where I am testing a connection to a database on another server:

Code
  1. MAIN
  2.  
  3.        CONNECT TO "olc@dev2_net" AS "fms"
  4.  
  5. END MAIN
  6.  
Name of database is olc and I have an entry in $INFORMIXDIR/etc/sqlhosts for dev2_net.
Now I'm not sure you can even do that, but I was testing to see if I could connect without specifying password.   When I run at Linux command line, I get the error:

Program stopped at 'testconnect.4gl', line number 3.
SQL statement error number -951.
Incorrect password or user candy@192.168.21.4[dev4] is not known on the database server.
SYSTEM error number 2.
No such file or directory

But if I run this in the GDC, you can see that the error occurs, but a window pops up in the GDC that says
 Invalid login. Please enter the login information again.


I press OK and then it asks me to login again to the GDC:


(I tried to insert images in this post but it doesn't appear to be inserting)

Here is part of the GDC log:
2017-10-17 22:01:55   Allocated pty (ospeed 38400bps, ispeed 38400bps)
2017-10-17 22:01:55   Started a shell/command
Call testconnect.main()

]

Tue Oct 17 22:01:56 2017:Test Connect (DEV4) : Terminal sent data.

Tue Oct 17 22:01:56 2017:Test Connect (DEV4) : Data: [Program stopped at 'testconnect.4gl', line number 3.

SQL st]

Tue Oct 17 22:01:56 2017:Test Connect (DEV4) : Terminal sent data.

Tue Oct 17 22:01:56 2017:Test Connect (DEV4) : Data: [atement error number -951.

Incorrect password or user candy@192.168.21.4[dev4] is not known on the database server.

SYSTEM error number 2.

No such file or directory

]

Tue Oct 17 22:01:56 2017:Test Connect (DEV4) : Text sent corresponds to Terminal String ({Expected string "incorrect"}{Action "end terminal"}{DoItOnce "1"}{IgnoreRemainingStrings "0"}{SendResult "0"}{Restart "1"}{ClearPassword "1"}{UseMessage "1"}{Message "Invalid login. Please enter the login information again.
"}{Title "Error"}{DefaultValue ""}{Command ""}{TimeOut "-1"}{StringToReturn ""}{MessageLineCount "1"})

Tue Oct 17 22:02:21 2017:Test Connect (DEV4) : Check if fgltty exists and is executable. Path=C:/Program Files/FourJs/Genero Studio/gdc/bin/fgltty.exe

Tue Oct 17 22:02:21 2017:Test Connect (DEV4) : Connect to 192.168.21.4:22 to get local network interface

Tue Oct 17 22:02:21 2017:Test Connect (DEV4) : Connected. Can close socket. Local IP is : 192.168.21.217.


So you can see that it triggers the Invalid login message.

BDL is 3.10.07 and GDC is 3.10.08.

I thought it was odd behavior that I would get an error message in GDC, and then it asks me to login again when it should have just stopped completely and disappeared.

Candy


* Capture1.PNG (3.69 KB, 338x127 - viewed 2013 times.)

* Capture2.PNG (10.06 KB, 277x190 - viewed 2018 times.)
Reuben B.
Four Js
Posts: 1126


« Reply #1 on: October 18, 2017, 04:45:59 am »

Hi Candy,

I normally like to let other users have a chance to answer but I'll answer early just to make sure that you have not uncovered something unexpected with 3.10

I believe the answer lies in screen 6 of your GDC shortcut settings http://4js.com/online_documentation/fjs-gdc-manual-html/#gdc-topics/t_gdc_applications_shortcuts_creating_direct.html.  There should be an entry that has action = "execute the host command" and this is typically associated with the string "last login:".  This action will typically have the checkbox "Ignore remaining strings" checked.  My suspicion is that this checkbox is not checked for the entry related to "execute the host command"

Why I say that is when your 4gl program has not been able to connect it has written to stdout/stderr the text "Incorrect password or user ...".  As evidenced by the output you have given, you have a connection string for String="incorrect" Action="end terminal" Message = "Invalid login.  Please enter the login information again"  (this is the line in the log for Tue Oct 17 22:01:56 2017:)

So after launching the program, the CONNECT line has errored and written "Incorrect ..." to stdout/stderr. The GDC is still listening for connection strings, sees the word "Incorrect" and triggers the action and displays the Message you have configured it to do.

Ideally when the GDC has connected to the server, it should stop reading what is written to stdout/stderr by having the "Ignore remaining strings" option checked for the action that sends the command.  If you deliberately do not have this checked, (some have discovered that they can use these strings to raise and lower the terminal window if they don't have this checked and hence can get to the command line from a running program), then you would need to ensure that your 4gl program does not write to stdout/stderr, any text that will be actioned by the remaining terminal strings.

Reuben


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Sebastien F.
Four Js
Posts: 545


« Reply #2 on: October 18, 2017, 10:01:25 am »

Hello Candy,

I think you are mixing two issues:

1) Connect from a BDL program on a client machine to an Informix server on a remote machine (SQL statement error number -951)

2) Open a terminal session on a machine with a GDC shortcut, and here Reuben's answer may help.

Regarding (1):

Since a DB Client/Server configuration requires additional user authentication methods, you may consider to keep running programs on the same machine as the Informix server.
So why don't you run your application programs on the same machine as Informix server?
In that configuration, you only need to declare OS users and grant permissions, then as long as (2) works, the current OS user authentication is sufficient to connect to the local Informix server.
You certainly know that, but I want to make sure you are aware of this.

If you really need to setup a DB client/server configuration:

Without any extra (insecure?) configuration in Informix files, you need to pass the DB user name and password to the CONNECT instruction:

   CONNECT TO <dbsource> USER <dbusername> USING <password>

Note that with a recent Informix 11/12, it is possible to create DB users inside the database only (no need to create OS users anymore):

   CREATE USER ...

https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0/com.ibm.sqls.doc/ids_sqs_1821.htm

Do you need to distinguish real application users with a dedicated database user or do you have a unique DB user for all?

To help you efficiently, we would like to have more details about your configuration and needs.

So I suggest that you contact your support to provide all these details.

Seb
Sebastien F.
Four Js
Posts: 545


« Reply #3 on: October 18, 2017, 10:06:32 am »

Here another useful link to Informix docs about connection security:

https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0/com.ibm.sec.doc/ids_am_025.htm

Seb
Candy M.
Posts: 139


« Reply #4 on: October 18, 2017, 04:04:12 pm »

Thank you Sebastien and Reuben,

Sebastien, normally our application (that we sell) is on one server.   This happens to be for an in-house application, our support system, that uses some accounting info in another database.   Normally those 2 databases (support and accounting) are on the same server but now we are separating our development/support from the accounting on two different virtual guests.  I really appreciate the additional information your have sent and the links about trusted hosts, creating database users etc.
I was able to connect by supplying the user name and password to the database and that will be sufficient for now.  BUT sometimes imperfect code raises 4GL issues and I think Reuben has exposed the issue.

Reuben, on screen 6 for my shortcut for this shortcut  (and this shortcut was created using default settings), the "last login: " , it DOES have "Ignore remaining strings" checked.

I will attach the image

Candy


* Capture3.PNG (36.78 KB, 626x603 - viewed 2163 times.)
Reuben B.
Four Js
Posts: 1126


« Reply #5 on: October 18, 2017, 10:39:04 pm »

Quote
Reuben, on screen 6 for my shortcut for this shortcut  (and this shortcut was created using default settings), the "last login: " , it DOES have "Ignore remaining strings" checked.

interesting, you may need to raise as support issue.  What is also a useful debugging tool when looking at connection string issues is on screen 3, there is an option Show Terminal Window.  Check that to see all the communication whilst you are trying to understand what is occurring.  Another possibility, on screen 2 do you have an entry in "command" or is that blank?  If you are using the technique associated with command being blank, then it maybe the "last login:" was never executed to send the command and to then ignore remaining string.  (this technique involves the fglrun command being inside scripts that are executed at login so that a low-level user can run from terminal simply by logging in at terminal and they never get access to command prompt)

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Candy M.
Posts: 139


« Reply #6 on: October 18, 2017, 11:48:58 pm »

Reuben,
    On screen 2 I have an entry in "command": @FGL;source /users/swss/swssenv.sh;fglrun  --trace "$SSPATH"/test.srce/testconnect.42m
    I just sent in email to US support with the documents.
    The show window doesn't appear long enough for me to see what is in it.   I did try to login to the server using putty and it was giving the last login message.
   
     This will help with problems we occasionally have with the GDC giving strange messages.   We have had one case recently where we believe when the User limit exceeded message is reached, the customer gets an All modal windows must be closed to exit the GDC.   I haven't duplicated that yet, but this discussion will help.
     Do you know if there is something in the terminal strings to minimize the GDC?  We would like to do that.
Candy
Reuben B.
Four Js
Posts: 1126


« Reply #7 on: October 19, 2017, 12:46:11 am »

Reuben,
    On screen 2 I have an entry in "command": @FGL;source /users/swss/swssenv.sh;fglrun  --trace "$SSPATH"/test.srce/testconnect.42m
    ...


that is the type of entry I would expect to see


...
    The show window doesn't appear long enough for me to see what is in it.   I did try to login to the server using putty and it was giving the last login message.
 

Add a SLEEP in your 4gl program immediately after the MAIN so that you have time to read the terminal window.  Normally would not need to if the program had some UI but as the CONNECT error and subsequent exit is occurring before the UI, this will at least allow you to read what is in the terminal




...
     Do you know if there is something in the terminal strings to minimize the GDC?  We would like to do that.


there is -M option when you launch GDC http://4js.com/online_documentation/fjs-gdc-manual-html/#gdc-topics/c_gdc_cmd_line_options.html

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Candy M.
Posts: 139


« Reply #8 on: October 19, 2017, 03:10:00 am »

Reuben,
    When I added the sleep, all it showed was the trace that the main program was entered.
    The problem with using any command line options with the Mac GDC, is that you need to create an apple script.   I think Leo did put in a request for me to be able to specify the command line options in the .GDC configuration file.

Candy
Reuben B.
Four Js
Posts: 1126


« Reply #9 on: October 19, 2017, 05:18:42 am »

Quote
The problem with using any command line options with the Mac GDC, is that you need to create an apple script.   I think Leo did put in a request for me to be able to specify the command line options in the .GDC configuration file.

there is an existing request for this GDC-2725. "Would like to associate .gdc files with some command line options"  I don't see your name on this, Leo may have added you to another case in which we case we should find out what that is and consolidate the requestors.  This case does currently show as closed although based on some recent comments attached to it, I am hopeful it will be reconsidered, there was some misunderstanding of what was being asked for.




Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines