The Username And Password is Incorrect

I am trying to Create a .BT File for my Bartender report which will act as a MAP File.

In have Bartender Integration And Bartender Admin Console in Place.

the only thing here is I am creating the.BT File from the Output of a BAQ using Below Code

///////////////////////////////// BPM Code triggering from Data Directive UD01  /////////////////////////////////////

string JobNum = string.Empty;
//string OrderNum = string.Empty;

var ttUD01Var = (from ds in ttUD01 where ds.Company == Session.CompanyID &&  ds.RowMod == "A" select ds).FirstOrDefault();
if(ttUD01Var != null)
{
JobNum = ttUD01Var.Character02.ToString();

 
List<string> JobList = new List<string>();

string[] subs = JobNum.Split(',');

foreach (var sub in subs)
{
    JobList.Add(sub); 
  
    var DbJobhead = (from ds in Db.JobHead where ds.Company == Session.CompanyID &&  ds.JobNum == sub select ds).FirstOrDefault();
    if(DbJobhead != null)
    {
        DbJobhead.TravelerLastPrinted = DateTime.Today;
        Db.Validate();
        Db.SaveChanges();
    }
}
try
  {  
    Ice.Contracts.DynamicQuerySvcContract boDynamicQuery2 = Ice.Assemblies.ServiceRenderer.GetService<Ice.Contracts.DynamicQuerySvcContract>(Db);
    Ice.Tablesets.QueryExecutionTableset dsQueryExecution = new QueryExecutionTableset();
    
    foreach(string JobNumParam in JobList)
    {
      ExecutionParameterRow drRow10 = new ExecutionParameterRow();
      drRow10.ParameterID = "JobNum"; 
      drRow10.ParameterValue = JobNumParam;
      drRow10.ValueType = "nvarchar";
      drRow10.IsEmpty = false;
      drRow10.RowMod = "A";
      drRow10.SysRowID = new Guid();
      dsQueryExecution.ExecutionParameter.Add(drRow10);
    }
    
    
    DataSet dsResults = boDynamicQuery2.ExecuteByID("MYBAQData", dsQueryExecution);
    DataTable dtResults = dsResults.Tables[0];
    if( dtResults.Rows.Count == 0)
    {
      this.PublishInfoMessage("No record found", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "ABCCode", "Update");
      return;
    }      
    try
    {
      DateTime DateTime = DateTime.Now;
      //IMPORTANT NOTE!!!
      // BTWLocation can be set on the SHIPTO,CUSTOMER,USERCODE (field name BTWLocation_c) (format C:\BARTENDER\Labels\RcvLabelPCID.btw)
      //string BTWLocation = "\""+ "c:\\Bartender\\Labels\\BartenderReport.btw" + "\"";
      string BTWLocation = "\""+ "c:\\Bartender\\Labels\\BartenderReport" + "\"";
      //string BTWFile = UserCode.CodeDesc;
      string BTWFile = "BTW File";
      //string FileName = UserCode.LongDesc;
      string FileName = "File Name";

      int NumberOfPrints = 1;
      NumberOfPrints = NumberOfPrints == 0 ? 1 : NumberOfPrints;
      for( int i = 1 ; i <= NumberOfPrints ; i++)
      {
        string BTWFileFormat = @"\\MyMountedDrive\\Site\\Production\\Bartender\\";
        string PrefixFileName = "FileName";
        string postFix = DateTime.Now.ToString("yyyy-dd-M--HH-mm-ss");
        string NewFileName = BTWFileFormat + PrefixFileName +"" + postFix + ".bt";
        //string NewFileName = BTWFileFormat + "sp.bt";
        using (StreamWriter sw = File.CreateText(NewFileName))
        {
          //this.PublishInfoMessage("Create New File", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "ABCCode", "Update");
          string PRNValue = "\""+ "\\\\Printer\\Job Traveler" + "\"";
          if(PRNValue == string.Empty)
          {
            this.PublishInfoMessage("Network not found on the printer", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "ABCCode", "Update");

            return;
          }
          if(BTWLocation == string.Empty || FileName == string.Empty)
          {
            this.PublishInfoMessage("BTW file value or FileName Value shouldn't be empty", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "ABCCode", "Update");
            return;
          }
          string ConfigString = "%BTW% /AF=" + BTWLocation + " /D=\"<Trigger File Name>\" /PRN=" +  PRNValue + " /DBTEXTHEADER=3 /R=3 /P " ;
          string ConfigEndString = "%END%";
          sw.WriteLine(ConfigString);
          sw.WriteLine(ConfigEndString);
          DataTable table = dtResults;
          bool firstCol = true;
          foreach (DataColumn col in table.Columns)
          {
            if (!firstCol) 
            sw.Write(",");
            sw.Write("\"" + col.ColumnName+ "\"" );
            firstCol = false;
          }
          sw.WriteLine();
          foreach (DataRow row in table.Rows)
          {
            firstCol = true;
            foreach (DataColumn col in table.Columns)
            {
              if (!firstCol) 
              sw.Write(",");
              sw.Write("\"" + row[col].ToString() + "\"" );
              firstCol = false;
            }
          sw.WriteLine();
          } 
        }
      }
    } 
    catch(Exception E)
    {
      this.PublishInfoMessage(E.Message.ToString(), Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "ABCCode", "Update");
    }
      this.PublishInfoMessage("Submitted to Printing!", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "ABCCode", "Update");
  }    
  catch(Exception E)
  {
  this.PublishInfoMessage(E.Message.ToString(), Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "ABCCode", "Update");
  }  
}

////////// Code END /////////

Before Couple of Weeks I was able to successfully create the.BT File there was no Problem But Suddenly System started throwing below Error message of Username and password.
image

Any help is much appreciated.

Sounds like the permissions / passwords etc are messed up on your network drive.

Usually the account running Epicor is a service account and service accounts can’t read / write to “mounted drives” (if that’s trully a mounted drive like N: )

Otherwise if its a networkshare the account running epicor needs to have access to that network share.

Also, shouldn’t this be:

@"\\MyMountedDrive\Site\Production\Bartender\";
1 Like

Is it that the .bt file is password protected? Cause I know you can set a password inside the .bt file itself.

Like excel, you can have an excel file and then password protect it inside office.

Are you somehow setting a password on the .bt file?

Or is this really windows native access having trouble with read rights to a file/file location?

Hello @josecgomez , the instance is on cloud and the FTP script which cloud support team gave us we ran it successfully to create mounted drive.

Since Everything is handled on Epicor Side do we need to pass some additional credentials on the Mount drive ?

No @utaylor The file is not Password protected.
It was working from last 9 months without any problem.

The Above Code was creating files successfully but suddenly the last run was in Mid January and I am still chasing this issue with no clue about it.

Is this in your Pilot Environment? Recently updated?

Yes this is Recently Updated

Your pilot system was probably migrated to the AKS environment, and FTP no longer works.

You will be forced to use an Azure File Share, and you will need to get that information from support.

2 Likes

Quick clarification -

As the Epicor Cloud transitions to Azure Kubernetes Services managed infrastructure, no changes are required of your integrations. Both the FTP/SFTP and Azure File Share configured Endpoints will continue to work.

There was an issue in the migration of some Pilot systems but those should be resolved. If you are experiencing a problem, please open a call with Tech Support.

2 Likes

I did, that’s when they told me we had to use the Azure File Share and that
ALL FTPs were migrating and we would have to use that.

They even provided my login info, scripts and instructions.

Could you please confirm. Some department is not getting the right guidance.

1 Like

so cool

Thanks for figuring this out Kevin.

Hey Kevin - Sorry for the confusion. There was a disconnect on this within Epicor, but that has been resolved. The Epicor AKS instances will support both existing types of Endpoints. Going forward, we are provisioning the AKS instances with Azure File Shares but we are not forcing a move away from FTP.

3 Likes

Thank you for the clarification.

I will check my pilot to see if my ftp is working and contact support if it is not.

1 Like

Our Bartender FTP just up and quit working Monday.

image

Yes got instructions after raising a ticket with EpicCare but over my head. Turning it over to our IT provider…

You don’t need instructions, raise the ticket with cloud services and get them to fix it.

1 Like

They gave me a whole page of instructions to include a PowerShell script to run…

1 Like

Yep, raise the ticket. That’s for an azure file share.

You don’t need it, ftp is still supported and promised to work.

The left hand and the right hand aren’t talking again.

Push the ticket to cloud services.

1 Like