All environment variables are not available in Production

  • 28 October 2009
  • 6 replies
  • 1 view

Badge +8

I have a piece of code in my web page that returns values from the environment variables in K2.


When I run this code in development it runs as expected and returns all of the variables (this would be all of the variables in the string table), but when I run this code in prodcution it only returns the base variables that originally shipped with K2.


My results look something like this


Development:


ApplicationWebServer:Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=XXX;Port=5555


ASRClientID:xxxx


ASRDocumentLibrary:Completed_ASRs


ASRExternalWebPathToPages:http://vmlgmtdvwsk201


ASRIncidentAssignedTo:CORP-NETWORK ENGINEERING


ASRIncientCat:IEN ASR REQUEST


ASRMailFrom:asr_request@xxxxx.com


ASRPathToDocLibrary:SiteDirectory/ASR


ASRWebPathToPages:http://xxx:8080


ASRWebPathToPages_External:http://xxx:8080


ASRWOCatCircuitOrderInstall:CIRCUIT ORD/INS


ASRWOCatTSPSS7Turnup:TSP SS7 TURNUP


ASRWOCatTSPTrunkGroupOrder:TRUCKGRPORD/AUG


BPAMailFrom:Xxx_Automated_Process@xxx.com


Category Server:Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=XXX;Port=5555


K2Workspace:http://xxx.lgmt.trdo


MagicServiceDeskEmail:svc_magicdevemail@xxx.com


Mail Server:bridgeheads.lgmt.trdo


PeeringAndPricingMailFrom:Peering_And_Pricing_Request@xxx.com


PeeringAndPricingWebPathToPages:http://xxx:9090


PeeringPricingPathToDocLibrary:SiteDirectory/Peering_And_Pricing


SecureAccessDocumentLibrary:Completed_Forms


SecureAccessMailFrom:Secure_Access_Request@xxx.com


SecureAccessPathToDocLibrary:SiteDirectory/SecureAccess


SecureAccessWebPathToPages:http://xxx


ServiceObject Server:Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=XXX;Port=5555


Sharepoint Server:xxx.lgmt.trdo


SharePointServer:http://xxx.lgmt.trdo/


SharepointServerVariable:http://xxx.lgmt.trdo/


SharepointSiteSecureAccess:SiteDirectory/SecureAccess


SmartObject Server:Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=XXX;Port=5555


TXMailFrom:PSAP_Move_Change@xxx.com


TXWebPathToPages:http://xxx:9090


Web Service URL:http://xxx


webserver:xxx


Workflow Management Server:Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=XXX;Port=5555


Workflow Server:Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword


Production:


Category Server:Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=XXX;Port=5555
Mail Server:bridgeheads.lgmt.trdo
ServiceObject Server:Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=XXX;Port=5555
SmartObject Server:Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=XXX;Port=5555
Web Service URL:http://XXX:80
Workflow Management Server:Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=XXX;Port=5555
Workflow Server:Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=XXX;Port=5252


<p>



The string table on the dev server and the production server contain all of the variables but they are not showing up as part of the 'CurrentEnvironment.EnvironmentFields' collection.


6 replies

Badge +2

Are you trying to get the server variables or the variables associated w/ a process?

Badge +8

Environment variables / String Table not the Process Data Fields


If you look at the first example you can see there are about 25 variables (development) but in the second example there are only about 5 (production)


Badge +4

Hi,

Can you perhaps post your code that you use to retrieve the values?

You can also execute the following query against your 'Categories' database and see what the results are and if possible post the result set on this thread:

          SELECT E.EnvironmentName, F.FieldName, V.FieldValue
          FROM EnvironmentSettings.._FieldValue V
          JOIN EnvironmentSettings.._Environment E ON E.EnvironmentID = V.EnvironmentID
          JOIN EnvironmentSettings.._Field F ON V.FieldID = F.FieldID
          ORDER BY E.EnvironmentName


thanks,

Badge +8

Sorry it appears that this has stalled. I got called off onto another project and just got back to this. I ran the suggested query in both environments and the production database is definitely missing the environment variables. When looking in the workspace I can see the variables in production. When I run msbuild to deploy into production the PropertyGroup EnvironmentFields never appears to run. It is in the msbuild file but it never appears to configure the production environment.


It is very strange that when looking at the StringTable in the production workspace I can see all of the variables but they are not in the db.

Badge +8

I think you may have a slight misunderstanding on the two concepts. Your Environment Fields are "templates" to be used in development. When you deploy the process, your Environment Fields are added to the MSBuild and then deployed, but once deployed, they are translated to String Table entries, not the Environment Fields.


If I read your scenario correctly, your dev tools are connecting to the Dev environment, in which the field have been created. Even if you set the environment to Production, it uses the Production fields stored in the Dev db. If you use the "Change Server" option and point to the Production server, the fields will most likely not exist.


I would recommend that you open the Workspace of your Production server, you should see the fields are not there. Once you created then in the Workspace (or in VS if you did the "Change Server" option) that points to the Production dbs, your code should execute fine. 

Badge +8

Thank you, I hadn't seen that anywhere in the documentation. Once I called the string table from code instead of the environment variables the key value pairs were available.

Reply