zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
116 stars 85 forks source link

getting "Failed to initialize secure credential manager" while using profInfo.readProfilesFromDisk() #2294

Closed kumnar02 closed 1 month ago

kumnar02 commented 1 month ago

using below code m i'm getting Failed to initialize secure credential manager , any idea whats wrong ?



import { ProfileInfo } from "@zowe/imperative";
import { GetJobs } from "@zowe/zos-jobs-for-zowe-sdk";

(async () => {
    // Load connection info from default z/OSMF profile
    const profInfo = new ProfileInfo("zowe");
    await profInfo.readProfilesFromDisk();
    const zosmfProfAttrs = profInfo.getDefaultProfile("zosmf");
    const zosmfMergedArgs = profInfo.mergeArgsForProfile(zosmfProfAttrs, { getSecureVals: true });
    const session = ProfileInfo.createSession(zosmfMergedArgs.knownArgs);

    const owner: string = session.ISession.user;
    // This may take awhile...
    const response = await GetJobs.getJobsByOwner(session, owner);
    console.log(response);
})().catch((err) => {
    console.error(err);
    process.exit(1);
});
kumnar02 commented 1 month ago

i have the .zowe/zowe.config.json file which is a team config