Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkgx --sync on main never finishes if the pantry repo was not updated in the last 24 hours #1021

Closed
felipecrs opened this issue Jul 6, 2024 · 6 comments

Comments

@felipecrs
Copy link
Contributor

I have a lot of pipelines stuck at pkgx install. After some troubleshooting, it seems that they aren't being able to sync the pantry.

Then I tried in my local machine and can reproduce it:

pkgx --sync

Never finishes, hangs forever.

@felipecrs felipecrs changed the title Is the server down? Is the pkgx down? Jul 6, 2024
@felipecrs felipecrs changed the title Is the pkgx down? Is pkgx down? Jul 6, 2024
Copy link

dosubot bot commented Jul 6, 2024

The hanging issue during the pkgx --sync command could be due to network issues, server downtime, or local environment problems such as file system permissions. To diagnose the issue, you can enable logging to get more insights.

Here's an example of how you might add logging to the useSync function call:

export default async function({ flags, ...opts }: Args, logger_prefix?: string) {
  const logger = make_logger(flags.verbosity, logger_prefix);

  if (flags.sync) {
    try {
      logger.replace('Starting sync...');
      await useSync();
      logger.replace('Sync completed successfully.');
    } catch (err) {
      logger.replace(`Sync failed: ${err.message}`);
      if (!flags.keepGoing) throw err;
    }
  }

  // ... rest of the code
}

Additionally, you can manually check the status of the pantry server by using the ensure_pantry function:

async function ensure_pantry() {
  if (usePantry().missing()) {
    await useSync();
  }
}

If the pantry is missing and the synchronization fails, it indicates that there might be an issue with the pantry server or related services [1].

If the problem persists, you might want to check the operational status of the external services zlib.net and python.org, as pkgx relies on these for syncing [2][3].

To continue talking to Dosu, mention @dosu.

@felipecrs
Copy link
Contributor Author

lol. Found out the issue!

Since there was no change in the last 24 hours of pantry git, the following line always returns true, causing an infinite loop!

https://github.com/pkgxdev/libpkgx/blob/2aec73a0c16222d2c1a4eddb96acc867dddaa191/src/hooks/usePantry.ts#L267

@felipecrs
Copy link
Contributor Author

@felipecrs
Copy link
Contributor Author

@jhheider I realized this issue only affects/affected the main branch of pkgx, and not the last released version 1.1.6.

I'm very sorry about it.

@felipecrs felipecrs closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2024
@felipecrs felipecrs reopened this Jul 10, 2024
@felipecrs
Copy link
Contributor Author

In fact, let me keep it open just as a reminder that this has to be fixed before releasing a new version from main.

@felipecrs felipecrs changed the title Is pkgx down? pkgx --sync on main never finishes if the pantry repo was not updated in the last 24 hours Jul 10, 2024
@jhheider
Copy link
Contributor

That's great to know, and explains the lack of outrage. ;)

But it'll definitely need fixing.

mxcl added a commit to pkgxdev/libpkgx that referenced this issue Sep 5, 2024
We shouldn't need this since we sync for various pkg-not-found situations.

Closes #73
Closes pkgxdev/pkgx#1021
mxcl added a commit to pkgxdev/libpkgx that referenced this issue Sep 5, 2024
We shouldn't need this since we sync for various pkg-not-found situations.

Closes #73
Closes pkgxdev/pkgx#1021
mxcl added a commit to pkgxdev/libpkgx that referenced this issue Sep 5, 2024
We shouldn't need this since we sync for various pkg-not-found situations.

Closes #73
Closes pkgxdev/pkgx#1021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants