Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.
I have an issue that is driving me absolutely bonkers.

I have a C# app that is running as a service on a windows server. It polls a bunch of different shopping cart web services on a fixed schedule.

For one particular client, it fails with a SSL/TLS error that the certificate is not trusted. This is only for that client, we can query that same exact service for other clients on their servers. The error only appears though after the service has been running for a couple of hours. If I shutdown the service and restart it, it starts working again for awhile.

- I have explicitly trusted their cert and the intermediary cert on the windows server where we run the C# service.
- When running the plugin using a unit test I setup and using the client credentials for their service, it works fine
- I have no SSL errors or anything when browsing to the client's website, it looks fine
- Rackspace looked at our server and claim it is all setup right

I am about to lose my mind since it works for an hour or so, then stops, and it is working fine for all of our 100+ other integrations that the service polls.

Adbot
ADBOT LOVES YOU

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.

Mr Shiny Pants posted:

Can the server download a CRL? Does it have access to the CRL? Sounds like it does a check after awhile and can't validate the chain or something.

One thing you can test is to download the certificate and use the windows Certutil utility to check if you can build the certificate chain.

It uses the exact same apis as .Net does so any error should also turn up in there.

Another thing: Is the service running as a user and does it have the rootcerts in its own cert store?

Thanks for this, finally got back from a camping trip and working on this today, I'll see if I can get it to work.

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.
Right now I have a window service coded in .NET that runs a set of scheduled jobs from a database. Every 5 minutes it checks the database for schedule changes, then it will look for jobs that are ready to run, and runs them.

Each job runs a specific module/plugin, and each of those has a PluginRunner that is basically a class that inherits the a PluginRunner interface. The modules are separate .NET assemblies, and the Type is stored as a record in a plugin table like this, and the service instatiantes an instance of the correct module using this type.

"MyCompany.TheService.PluginAssemblyName.PluginRunner, MyCompany.TheService.PluginAssemblyName"

This all works great right now. The only problem is that all the plugins are all part of one single big huge project which has created a few issues with being lazy about putting in stupid dependencies, but the biggest deal is that whenever we commit a change for a plugin, we have to completely down the services then have team city push out the new changes.

Ideally I would like each module to be its own project with its own repository and unit tests, then just push out a single DLL to the live server without having to down it. Is there a strategy that I can use to make that work?

We just got a new continuous integration server setup, and we are going to migrate this all from SVN to GIT. So I figure if I am going to do this, now would be a good time.

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.

EssOEss posted:

You can unload assemblies by unloading the AppDomain that they belong to, though managing AppDomains can be a bit of a hassle. Is it really worth the convenience of swapping bits out at runtime? Possibly it is easier to just stop the service, update it and start it again. This, of course, assumes that the service code has been built with proper stopping logic in mind - not always the case.

Ok, I didn't know it was this complicated. It would be nice if I could toggle a new version flag in the db where the service would then reload the new dll and flip the flag bit, but I don't want to rock the boat. I mean it gets the job done like it is and the service does have proper stopping logic in there.

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.
I am trying to integrate with WooCommerce which uses a rest API and get this error from an instance of WebClient in a WebException

The underlying connection was closed: An unexpected error occurred on a receive.

I am only getting this error on a specific call, which is a PUT to update an order status. The rest of the calls to this client work fine. The response from the server is null.

Here is what is driving me nuts
- This is only happening with this one client, we have 10 or 15 or so other clients and the call works for them perfectly.
- This only happens on our live server at rackspace. I cannot get the call to fail on my local dev PC with unit tests.
- I have eliminated everything I can think of from the code on the live server that is not touched in the unit tests, I even commented out every database and logging call.

I have spent my day just tweaking all kinds of poo poo and deploying changes to the live server trying to get this one stupid call to work. I haven't gotten it to work once. I am about to just give up and tell the client tough poo poo, which will piss of them and the customer service dept, but I am out of ideas. As a last resort, I ask you, my fellow goons.....

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.

Ithaqua posted:

Have you captured the traffic with fiddler?

Yes, the URL that I am posting too is formatted identically to what I am sending from my PC, as well as the JSON body, and the method etc. It is using oauth, and the signature in the URL is ok. From the live server, if I set it generate an invalid oauth signature, I get the proper authentication error on that call.

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.
I just logged in and checked it, ECN is disabled on the production server (2008 R2 Enterprise)

=(

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.

EssOEss posted:

Aww. Can you go lower? If you say Fiddler traces look the same, what about the Wireshark traces? If you can post them here (as screenshots with whatever stuff you want blacked out, if needed) maybe we can point a finger at something.

I am not sure if I can go lower than that without our server guy shooting me since it is a production server....

Before I try that, I want to try one more thing though. I usually develop on a mac and have a few rest clients where I can just paste poo poo in, put in the method, and click submit. Is there one for windows that is decent? I'll then generate the oauth signature by hand, and try submitting requests that way. If that fails, it will for sure rule out an issue with the codebase. If it does fail, I'll talk to our server admin about getting a lower level trace and if I can do it without loving up all the poo poo that is running on that server..

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.
It works fine in fiddler on the production server....


arrgggggghhhhh

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.

wwb posted:

^^^ Congratulations, you've isolated the problem. Ask ops if they are fronting the production server with anything, something is stomping on the request between your box and the server.

They said they aren't doing anything funky at the network level, its just a vanilla server behind a single router and firewall with nothing special setup on the cisco devices. But since it was successful in fiddler, it leads me to believe that there is something wrong with the .NET codebase and it is not at the network level.

I am going to try a few tweaks to the web client settings, we are rebooting the server right now and applying all the latest .NET updates. At this mornings scrum we decided that its not worth spending more time on beyond that unless it happens to more clients. If I can't get it to work after these last few things, I'll just script a dirty hack in python or php to do the rest calls from one of our other servers.

I love dirty and nasty cron jobs to fix poo poo.

Thanks all for your ideas.

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.

bpower posted:

I recently started web dev with .net mvc c# and its been great. With VS and ReSharper my productivity has been really really high. In the last month I started using Angularjs and my productivity has tanked. The intellisense for JS seems useless, it reminds of writing Java in Notepad. How do you discover anything? Can you guys describe your workflow / tools you use for front end dev? Is there anything comparable to vs/resharper for javascript?

For a lot of the web dev stuff here we use phpstorm from jet brains. The web only version is called webstorm and its basically the same IDE sans the PHP plugin. Give it a try.

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.
I am having an issue with the project settings for a C# app. The settings work fine when i debug the project on its own. But when I include that project as part of another project, the settings are not compiled and the .config file does not exist, then I get a null exception.

Here it is a little more specifically:
I am using Telerik reporting. The only thing that you can use for a datasource connection string is either a value of type connectionString from the project properties, or an embedded string. I don't want to use an embedded string if possible because that means pasting in the loving value for 20+ datasources, then going through and changing it everywhere when I switch to production.

So I have this type of project

MyApp.Reports - Has the reports and the datasources which are part of the report definitions.
MyApp.Reports.Properties.Settings.Default - Has the connectionString which the report definitions read just fine

MyApp.Reports works just fine by itself

Then i have something like this
MyApp.ReportViewerThing - Has a reference to MyApp.Reports and displays the reports in a WPF viewer

In MyApp.ReportViewerThing the MyApp.Reports.Properties.Settings.Default class does not exist so the reports take all take a poo poo unless I use an embedded connection string.

Any ideas on how I can fix this? I tried switching the visibility of the settings to public, but they are still not compiled.

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.
Ok, I solved this by exposing the data sources in the report as public and then setting the connection strings from the calling app after the report was created and before it was displayed. There are a bunch of threads on the telerik forums about this same problem with some convoluted workarounds suggested by their support.

I like Telerik for some things, but you have to use it in their specific way, as soon as you step outside of their workflow you are stuck with hacks such as this which is often frustrating.

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.

Kekekela posted:

Somehow I'm always current on the latest esoteric javascript libraries my boss wouldn't let within 1000 miles of production, and yet find out about updates to Visual Studio, the IDE for 99% of my work related programming, via CoC. :smith:

Visual studio told me with the little update flag that appeared in the upper right.

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.
Hey, guess what, literally within seconds after replying I noticed the flag turned white. They released NuGet 3.3 and I am happy to say its no longer a filthy steaming pile of poo poo interface.

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.

Munkeymon posted:

Just a quick rant but the fact that I can't simply do
C# code:
IList<IThing> things = new List<Thing>();
Combined with the "interfaces for everything everywhere" policy i'm currently working under drives me up the loving wall sometimes.

C# code:
class Thing : IThing { ... }

class SomeOtherThing : IThing { ... }

IList<IThing> things = new List<Thing>();

things.add(SomeOtherThing);  
This is why. The rest of your code is expecting list "things" to allow any objects that implement IThing, however, you set the value to be a list that only allows a specific implementation. So if that assignment was allowed, it would fail to compile because you cannot add SomeOtherThing to List<Thing>().

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.
We need to roll a new REST server at work. It doesn't need to be some sort of rapid development framework, we want something that is easy to maintain and well written first and foremost.

ASP.NET web api v2 looks pretty cool, so does ASP.NET v5 that is currently RC. Is the former doable on a linux platform in production? The new ASP.NET looks nice since it supposed to be written for mac/linux, but we have a hard 6 month release date to get the initial feature list complete. Anyone have experience with either?

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.

uncurable mlady posted:

Comedy response; Use Python + Flask

Ha! Someone recommended this to me. I have been recommended all kinds of poo poo.

This is what is tough about this. If you ask someone the best solution, 90% of the time they will tell you whatever they currently use is the best solution. Its hard to filter out those sort of replies. I have been told to do it in PHP, node.js, django, spring.io, etc. etc.

It is looking more and more like C# something or other, and not ASP.NET 5 core. We'll dick around with it on Mono take some other platforms for a spin. We can host it on a windows server if need be, but our current windows platform where we have another C# service gives us more headaches than any of our other servers. That one has poo poo running as windows services and also under IIS, so at the very least it looks like OWIN/Katana will make it overall easier, and also easier to try out on both linux and windows.

Adbot
ADBOT LOVES YOU

Begby
Apr 7, 2005

Light saber? Check. Black boots? Check. Codpiece? Check. He's more machine than kid now.

Ithaqua posted:

Yeah, as much as I love the direction Microsoft is heading with ASP .NET Core, it's not ready for prime-time yet.

Good advice, I am not going to waste time on it then. As long as we don't create poo poo code, it shouldn't be hard to port it over to the new platform in the future should we decide it has some super new stuff we can't live without.

Thanks all for your input.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply