TPT05015: Error: Cannot open the file '$SCHEMA_GEN_D_TBL001.txt' due to error 13. Permission denied

Tools & Utilities
Enthusiast

TPT05015: Error: Cannot open the file '$SCHEMA_GEN_D_TBL001.txt' due to error 13. Permission denied

Hi.  I am executing `tbuild` with a job script that makes use of templates to delete from a staging table and load data into that table from a delimited text file.  When I execute this command logged in as my user it succeeds.  However, when I execute it logged in as someone else, it fails with:

Teradata Parallel Transporter Version 14.10.00.00

TPT_INFRA: TPT04032: Error: Schema generation failed for table 'MY_STG_SCHEMA.MY_STG_TABLE' in DBS 'foo':

  "GetDelimitedFileSchema" status: 48.

Job script preprocessing failed.

TPT_INFRA: TPT05015: Error: Cannot open the file '$SCHEMA_GEN_D_TBL001.txt' due to error 13.

                     Permission denied

Job terminated with status 12.

The error message is clear enough:  logged on as the other user, tbuild does not have permission to view a schema file.  But why?  Isn't tbuild creating the file and reading it in the same session?

Here is the command I am using:

tbuild -f /home/myusername/Delete_Table_Then_Load_File.txt -u TargetTdpId = 'foo', TargetUserName = 'bar', TargetUserPassword = 'baz', TargetTable = 'MY_STG_SCHEMA.MY_STG_TABLE', FileName = '/home/myusername/my_data_file.dat', DCPFileList = 'N', Format = 'Delimited', LogTable = 'MY_STG_SCHEMA.MY_STG_TABLE_L', DeleterLogTable = 'MY_STG_SCHEMA.MY_STG_TABLE_L', SourceFormat = 'Delimited', DCPSkipRows = 1, DCPSkipRowsEveryFile = 'Y', DCPOpenMode = 'Read', DCPTextDelimiter = '|', DCPQuotedData = 'Optional', DCPOpenQuoteMark = '"', DCPCloseQuoteMark = '"', LoadInstances = 1, DCPInstances = 1 TPT_20151130_153443

Here is /home/myusername/Delete_Table_Then_Load_File.txt:

DEFINE JOB Delete_Table_Then_Load_File

DESCRIPTION 'Delete data from a staging table and then load data from a file'

(

  STEP Delete_Table (

    APPLY ('DELETE FROM ' || @TargetTable)

    TO OPERATOR ($DELETER);

  );

  STEP Load_File (

    APPLY $INSERT TO OPERATOR ($LOAD()[@LoadInstances])

    SELECT * FROM OPERATOR ($DATACONNECTOR_PRODUCER()[@DCPInstances]);

  );

);

3 REPLIES
Teradata Employee

Re: TPT05015: Error: Cannot open the file '$SCHEMA_GEN_D_TBL001.txt' due to error 13. Permission denied

What are the write permissions on that directory?

The failure might be on the creation of the file, not the open to read it.

-- SteveF
Enthusiast

Re: TPT05015: Error: Cannot open the file '$SCHEMA_GEN_D_TBL001.txt' due to error 13. Permission denied

Thanks, Steve.  After posting this, I realized I can get the same effect without logging in as a different user, simply by running the command from different directories.  When I run the command from my home directory, all is well.  But when I run it from the root directory, I get the error.

So am I to conclude that `tbuild` is attempting to write a temporary file in the current working directory?  Is there any way to tell it to write (and read) the file to a different directory?  The reason I ask is because ultimately a job scheduler will be executing this and, evidently, it always does so from a directory to which it does not have read (or write) permissions (probably the root directory).

Teradata Employee

Re: TPT05015: Error: Cannot open the file '$SCHEMA_GEN_D_TBL001.txt' due to error 13. Permission denied

Yes, TPT currently attempts to create the temp files in the current working directory.

We are currently working on a fix that will create the temp files in the same directory as the log files (since everyone running TPT must have write access to that directory). There is currently no timetable for when this fix will be available.

-- SteveF