Skip to content

Mass source download fails on zero record memebers #2513

Description

@m-tyler

Odd as it may seem we have (had actually) some members in production source that are (were) empty. When downloading the source the statements with these commands Call QSYS2.QCMDEXC('QSYS/CPYF FROMFILE(LIB/QRPGSRC) TOFILE(QTEMP/QTEMPSRC) FROMMBR(RSE3445053) TOMBR(TEMPMEMBER) MBROPT(*REPLACE) CRTFILE(*YES)'); Call QSYS2.QCMDEXC('QSYS/CPYTOSTMF FROMMBR(''/QSYS.LIB/QTEMP.LIB/QTEMPSRC.FILE/TEMPMEMBER.MBR'') TOSTMF(''/home/lib/tmp/code4itempO_gneZyLLJqbmBExawNA0H/rse3445053.sqlrpgle'') STMFOPT(*REPLACE) STMFCCSID(1208) DBFCCSID(*FILE)'); The error is CPF2869: Empty member RSE3445053 in file QRPGSRC in library LIB is not copied. CPF2817: Copy command ended because of error. SQL0443: Trigger program or external routine detected an error. SQL0443: Trigger program or external routine detected an error.

The process runs this query before hand

with MEMBERS as (
    select
           rtrim(cast(A.SYSTEM_TABLE_SCHEMA as char(10) for bit data)) as LIBRARY
           ,B.AVGROWSIZE as RECORD_LENGTH ,A.IASP_NUMBER as ASP
           ,rtrim(cast(A.SYSTEM_TABLE_NAME as char(10) for bit data)) as SOURCE_FILE
           ,rtrim(cast(B.SYSTEM_TABLE_MEMBER as char(10) for bit data)) as NAME
           ,coalesce( rtrim(cast(B.SOURCE_TYPE as varchar(10) for bit data)), '') as TYPE
           ,coalesce(rtrim(varchar(B.PARTITION_TEXT)), '') as TEXT
           ,B.NUMBER_ROWS as LINES
           ,extract(epoch from (B.CREATE_TIMESTAMP)) * 1000 as CREATED
           ,extract(epoch from (B.LAST_SOURCE_UPDATE_TIMESTAMP)) * 1000 as CHANGED
      from QSYS2.SYSTABLES as A
           join QSYS2.SYSPARTITIONSTAT as B
             on (B.SYSTEM_TABLE_SCHEMA, B.SYSTEM_TABLE_NAME) = (A.SYSTEM_TABLE_SCHEMA, A.SYSTEM_TABLE_NAME)
  )
  select *
    from MEMBERS
    where LIBRARY = 'LIB 
     and SOURCE_FILE = 'QRPGSRC'
    order by  NAME desc

It seems sensible (even more so that removing these empty members) to have the query filter out the empty members. Mainly, b4ecuse the download fails without a specific reason and looking through the log is problematic if there are a lot of source members.


Context Version
Code for IBM i version 2.14.5
Visual Studio Code version 1.95.3
Operating System win32_x64
Active extensions
All Autocomplete (All-Autocomplete): 0.0.26
Code Spell Checker (code-spell-checker): 4.0.34
Code for IBM i User Spooled Files (vscode-ibmi-UserSpooledFiles): 0.1.2
Code for IBM i Walkthroughs (vscode-ibmi-walkthroughs): 0.5.0
Configuration Editing (configuration-editing): 1.0.0
Data Preview (vscode-data-preview): 2.3.0
Db2 for IBM i (vscode-db2i): 1.8.3
Emmet (emmet): 1.0.0
Error Lens (errorlens): 3.23.0
Extension Authoring (extension-editing): 1.0.0
Git (git): 1.0.0
Git Base (git-base): 1.0.0
GitHub (github): 0.0.1
GitHub Authentication (github-authentication): 0.0.2
Hawkeye Pathfinder (vscode-ibmi-hawkeye): 0.1.0
IBM i Debug (ibmidebug): 2.0.2
JSON Language Features (json-language-features): 1.0.0
JSON to CSV (json2csv): 1.0.0
Merge Conflict (merge-conflict): 1.0.0
NPM support for VS Code (npm): 1.0.1
Node Debug Auto-attach (debug-auto-launch): 1.0.0
Overtype (overtype): 0.5.0
Partial Diff (partial-diff): 1.4.3
Query JSON - lite (query-json-lite): 0.5.1
Rainbow CSV (rainbow-csv): 3.17.0
Remove empty lines (remove-empty-lines): 1.0.1
Server Ready Action (debug-server-ready): 1.0.0
TODO Highlight (vscode-todo-highlight): 1.0.5
Text Marker (Highlighter) (text-marker): 1.11.0
TypeScript and JavaScript Language Features (typescript-language-features): 1.0.0
undefined (indent-rainbow): 8.3.1

Remote system
Setting Value
IBM i OS V7R5M0
Tech Refresh 5
CCSID Origin 37
Runtime CCSID 37
Default CCSID 37
SSHD CCSID ?
cqsh true
SQL Enabled
Source dates Enabled

Enabled features

/QOpenSys/pkgs/bin /usr/bin /QSYS.LIB /QIBM/ProdData/IBMiDebugService/bin /QOpenSys/QIBM/ProdData/JavaVM/jdk80 /QOpenSys/QIBM/ProdData/JavaVM/jdk11
bash attr QZDFMDB2.PGM startDebugService.sh 64bit 64bit
find iconv
git setccsid
grep uname
ls
md5sum
sort
stat
tar
tn5250
Shell env
Variants
{
  "american": "#@$",
  "local": "#@$"
}

Activity

  1. added
    bugA confirmed issue when something isn't working as intended
    good first issueGood for newcomers. Feel free to ask for help with these!
    and removed on Feb 14, 2025
  2. wimjongman commented on Feb 26, 2025

    @wimjongman
    Contributor

    When trying to copy an empty member to an already existing member
    the system issues CPF2869.

    When the empty member is copied to a new member, the message is
    not send and the transaction continues.

    The fix is to use the member name for the temporary member
    and not reuse the existing 'TEMPMEMBER' member.

    This also fixes:
    Strange dialog button when downloading members #2527

  3. added a commit that references this issue on Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA confirmed issue when something isn't working as intendedgood first issueGood for newcomers. Feel free to ask for help with these!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions