JAMS Scheduler: No such host is known - c#

I've been given a task to update a C# tool that works with the JAMS scheduler tool, and I've only heard good things about JAMS in spite of my complete inability to install or get it to work at all. I haven't been able to find anything online about this problem, so I know it must be something stupid that I'm doing. (I come from a mac/unix background and everything on windows seems fairly foreign to me)
I've gone through (multiple) successful installs of the JAMS x64 demo, but when I open the Windows JAMS Client GUI, I get consistently get an error popup saying:
Unable to load specified root folder: \
Exception:System.Net.Sockets.SocketException (0x80004005): No such host is known
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
at MVPSI.JAMS.Server.GetURL(String objectURL)
at MVPSI.JAMS.Server.GetRemoteObject[T](String objName)
at MVPSI.JAMS.Server.Connect()
at MVPSI.JAMS.Server.GetRemoteObject[T](String objName)
at MVPSI.JAMS.Folder.Check(Int32& folderID, String folderName, FolderAccess access, Server js)
at JAMSWin.FolderNavigatorCtl.LoadRootFolder(String folderAddress) in c:\ProductionAZ\JAMS\Release\V6.1\JAMSWin\FolderNavigatorCtl.cs:line 406
I believe this error is caused by the JAMS server service using an incorrect server name, but I've tried many combinations (I've also installed/setup JAMS dbs in both my SQL2008 database engine and SqlExpress):
(local)
(local)\SqlExpress (with various capitalizations though I don't think this matters, does it?)
(local)\SQL2008
domainName\SqlExpress
... (the list goes on. Some of them were entirely impossible and I shouldn't have tried them, such as SQLEXPRESS\JAMS, but in my panic I did try it.)
No matter what I enter as the server name, I get the same result - the popup, and then the GUI window comes up saying "Unable to connect to the JAMSServer service; No such host is known."
This is all local, so I don't think it is a connectivity problem.
Any help would be greatly, greatly appreciated.

blue - full disclosure here as I work for JAMS.
Without seeing your logs here, it's a little difficult to say for sure what could be going wrong, my best guess is you're defining the SQL Server as the Server the client is connecting to, rather than just your local machine. The Client is trying to connect to the JAMS Server which in turn is trying to talk to SQL.
There is a Red J at the upper left hand corner of the product, if you click there and then on "Servers" you can define the JAMS Server you're trying to talk to. As you mentioned this is all local, simply utilize "localhost" and you should be off to the races.
If you're still having issues, I'd recommend sending in your logs to support for review because there may be something else going on here, it's too tough to say at the moment.
Devon

Related

Inaccessible logs: Security. The source was not found, but some or all event logs could not be searched

I am assuming it has something to do with my app pool/IIS but why is this error only being thrown while in Production?
To Start- I have read every related question about this topic on SO.
I cannot reproduce this error in my Dev and/or Test environments. I have sent hundreds of POST requests using postman(DEV), I have also used my iOS application pointing to my Test Environment and sent thousands of requests and I am still in the same boat.
About my Project: I am using WebAPI and my application is running on iOS10 written in swift. I only receive this error occasionally and cannot reproduce it on command. I am wondering if anyone else has run into this issue and if so, what were the steps you took to take care of this problem?
Error #1
The source was not found, but some or all event logs could not be searched.
To create the source, you need permission to read all event logs to make
sure that the new source name is unique. Inaccessible logs: Security.
Note: This error is not causing me to lose any data when I receive it, all records are still being committed to my database. So it is not a huge issue since I only get the error 1 out of about 100 times a new record is submitted. But curiosity is killing me and wanted to see if anyone had any suggestions.

EF 6 Arithmetic Overflow on Open

I am trying to solve a boring issue with an EF 6 data context now for several hours, though the entire code is small and simple. I did the same within the same solution already a couple of times and I never encountered this problem. Even when I compare the different implementations, configurations and references, I cannot find a difference. Here is the (very small) code snippet:
using (var context = new ConnectorDataContext())
{
var customer = context.Customers.FirstOrDefault();
}
Of course, there is more inside the using after the query, but it is not relevant whether it is there or not.
The collection is defined as
DbSet<ConnectCustomer> Customer {get;set;}
The context is derived from DbContext. Everything is attributed correctly (was copied from other, well working code parts of the solution.
The connection string points to a database which is used in other parts of the solution too. Yet, the test is isolated, so there is definately no other open connection.
But now, with this one, I always get an EntityException, caused by the underlying Provider, with an inner exception of "Overflow caused by the arithmetic operation". I am really close to desperation. Please help.
I've been battling a similar issue for far too long, and have only seen it emerge since upgrading to EF 6.x (not that I can conclusively say this is the cause). In my case, all calls to entity framework extension methods result in the "Arithmetic Overflow on Open" exception. Additionally, I only see this issue with IIS (any version), not IIS Express.
I found the following combination of things fixed the issue for me:
Manually clean your deployment location (del your obj and bin folders), try creating a new DB and point to it instead
Ensure your App Pool in IIS has "Enable 32-Bit Applications" set to True (right click on App Pool -> Advanced Settings)
Ensure that your database accepts remote connections - SQL Server Mgmt Studio, Right click on DB Server Instance -> Properties -> Connections -> Check the "Allow remote connections to this server" box
Ensure that DTC allows "Remote Clients": Windows Search for "Component Services" -> expand Computers -> My Computer -> Distributed Transaction Coordinator -> Right Click on "Local DTC" -> properties -> Security Tab -> Check Network DTC Access, Allow Remote Clients, Allow Inbound and Allow Outbound Transaction Manager Communication
Ensure that your Connection String is legit. I find this useful: http://www.developerfusion.com/tools/sql-connection-string/
Best of luck
I had the same issue. The application worked fine and then it suddenly started with the exceptions (no apparent changes in the code were made).
The solution was uninstalling program called "Web Companion" (I accidentally installed it by installing something else and not unticking during the installation process).
Therefore if you suddenly get these errors for no apparent reason, check for recent programs installed on your machine. Some of them can apparently cause it.

Access denied for user 'root'#'localhost' (using password: YES) in Visual Studio

Kindly bear with me. I am a Microsoft SQL Server person with loads of Visual Studio experience, but I need to get something done using a MySQL database.
I am trying to create a little tool here that will allow our developers to quickly update database records, and I am using Visual Studio to create a small Windows Form to do this.
In a Microsoft SQL Server connection string, I could write something like this:
Server=myServerAddress;Database=myDataBase;User Id=username;Password=password;
In a MySQL connection string, there appear to be multiple other options, but the first one looks basically the same:
Server=myServerAddress;Database=myDataBase;Uid=username;Pwd=password;
When I attempt to open the MySQL connection from my PC, I get the exception listed in the title (actually, it shows the Uid value and the IP Address of my PC instead of localhost, but I am hoping more people will recognize the error easier this way):
public static void MySQLi_Connect() {
m_err = null;
var str = Properties.Settings.Default.ConnStr;
try {
m_conn = new MySqlConnection(Properties.Settings.Default.ConnStr);
m_conn.Open();
} catch (MySqlException err) {
ErrorLog("MySQLi_Connect", err);
}
}
I did a search, and it seems that the Uid on MySQL needs to be granted access from the specific IP Address that the connection is being made from.
Further, I found this on the mysql.com doc pages:
If you do not know the IP address or host name of the machine from which you are connecting, you should put a row with '%' as the Host column value in the user table. After trying to connect from the client machine, use a SELECT USER() query to see how you really did connect. Then change the '%' in the user table row to the actual host name that shows up in the log. Otherwise, your system is left insecure because it permits connections from any host for the given user name.
A few things:
It looks like I can connect to MySQL by using a % setting in the Uid jp2code, but MySQL says I need to change that back right away to remove system vulnerability.
Microsoft SQL Server did not seem to require this - or, if it did, I simply never was slapped in the face with this vulnerability issue like MySQL is doing.
Now, I ask:
If this is going to be a tool used by different developers on different PCs, is it common practice to turn the blind eye to this horrendous system vulnerability?
Is this not really as big of a concern as MySQL is making it appear?
What is the best way to continue with a Windows Forms application that needs to connect from various locations? Obviously, I do not want to continuously be adding more entries for a particular application every time another developer wants to use the tool or someone tries to run it from a different PC.
You can configure the security of your MySQL server as strong as you like, usually you dont connect users but applications. So if you have your root user without password in production environment is your fault. Usually developers have access to development environment, so this is not a big deal.
Of course try to have as many users as roles you need, for your example I think one user is enough. In production use a secure config file for save a secure password and set you mysqlserver restricted.
I was having the same issue and I found out that the password wasn't correct.
GO to your sql command line and type the code below:
mydb in the line below is the name of the database you are working on.
passwd in the line has to match the password you have in c# code so in your case "password"
grant all privileges on mydb.* to myuser#localhost identified by 'passwd';
Like OP says you can wildcard the hostname portion. I used this on our dev-server (not recommended for production servers):
update mysql.user set host = '%' where host='localhost';
Then I had to restart the server to make MySQL use it (propably I could just have restarted the MySQL service).

UserPrincipal.GetGroups crashing on only one server in the domain

I'm having issues with .NET's UserPrincipal.GetGroups() method.
On nearly all system in my domain I can call
var groups = UserPrincipal.Current.GetGroups().ToArray()
and it returns the groups the current user is in. But there is one Windows 2008 R2 Enterprise Server which crashes when executing this with the message:
The server is not operational.
Name: TESTDOMAIN.ORG
I think that this server has a different configuration somehow but it's part of the same domain.
Console.WriteLine(
new DirectoryEntry("LDAP://RootDSE")
.Properties["defaultNamingContext"]
.Value
.ToString()
);
Shows the same on all systems: DC=GLOBAL,DC=TESTDOMAIN,DC=ORG
Where could I look ? What could be the problem ? How to solve it ?
I finally found it.
The problem is, that the server did not know what standard gateway to use.
Solution is to go to network options, select the LAN interface which is used, edit the IPv4 entry and set a standard gateway. This way the network will no longer be shown as "unidentified network" under network neighbourhood and all LDAP related queries will work again.
This one struggled me for days, so I hope this answer could help you too.

Connecting to a network drive programmatically and caching credentials

I'm finally set up to be able to work from home via VPN (using Shrew as a client), and I only have one annoyance. We use some batch files to upload config files to a network drive. Works fine from work, and from my team lead's laptop, but both of those machines are on the domain. My home system is not, and won't be, so when I run the batch file, I get a ton of "invalid drive" errors because I'm not a domain user.
The solution I've found so far is to make a batch file with the following:
explorer \\MACHINE1
explorer \\MACHINE2
explorer \\MACHINE3
Then manually login to each machine using my domain credentials as they pop up. Unfortunately, there are around 10 machines I may need to use, and it's a pain to keep entering the password if I missed one that a batch file requires.
I'm looking into using the answer to this question to make a little C# app that'll take the login info once and login programmatically. Will the authentication be shared automatically with Explorer, or is there anything special I need to do? If it does work, how long are the credentials cached?
Is there an app that does something like this automatically?
Unfortunately, domain authentication via the VPN isn't an option, according to our admin.
EDIT: If there's a way to pass login info to Explorer via the command line, that would be even easier using Ruby and highline.
EDIT: In case anyone else has the same problem, here's the solution I wound up using. It requires Ruby and the Highline gem.
require "highline/import"
domain = ask("Domain: ")
username = ask("Username: ")
password = ask("Password: ") { |q| q.echo = false }
machines = [
'\\MACHINE1\SHARE',
'\\MACHINE2\SHARE',
'\\MACHINE3\SHARE',
'\\MACHINE4\SHARE',
'\\MACHINE5\SHARE'
]
drives = ('f'..'z').to_a[-machines.length..-1]
drives.each{|d| system("net use #{d}: /delete >nul 2>nul"); }
machines.zip(drives).each{|machine, drive| system("net use #{drive}: #{machine} #{password} /user:#{domain}\\#{username} >nul 2>nul")}
It'll figure out how many mapped drives I need, then start mapping them to the requested shares. In this case, it maps them from V: to Z:, and assumes I don't have anything shared with those drive letters.
If you already have an Explorer window open to one of the shares, it may give an error, so before I ran the Ruby script, I ran:
net use * /delete
That cleared up the "multiple connections to a share not permitted" error, and allowed me to connect with no problems.
You could create a batch file that uses "NET USE" to connect to your shares. You'd need to use a drive letter for each share, but it'd be super simple to implement.
Your batch file would look like this:
net use h: \\MACHINE1 <password> /user:<domain>\<user>
net use i: \\MACHINE2 <password> /user:<domain>\<user>
net use j: \\MACHINE3 <password> /user:<domain>\<user>
UPDATE
Whether the connection remains or not depends upon what you specified for the /persistent switch. If you specified yes, then it will attempt to reconnect upon your next logon. If you specified no then it won't. The worrying this is the documentation says that it defaults to the value that you used last!
If you specified no, the connection will remain until you next reboot. If you drop your VPN connection the drive would be unavailable (but if you reconnect to the VPN the drive should be available as long as you haven't removed it).
I don't know of a way to use it without mapping to a drive letter, the documentation would lead you to believe that it isn't possible.
I understand your problem, that you're just trying to give explorer the correct credentials so it stops nagging you with login boxes. Using mapped drives though not perfect will at least alleviate your pain.
to pass credential by command line to the explorer you should take a look into the command net use
Use API WNetAddConnection2() via P/Invoke.

Categories