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

Improve the troubleshooting experience of "Warning: github-pages can't satisfy your Gemfile's dependencies" #104

Open
ohadschn opened this issue Oct 20, 2023 · 7 comments

Comments

@ohadschn
Copy link

ohadschn commented Oct 20, 2023

Sample run: https://github.com/4tals/LinksForIsrael/actions/runs/6586647478/job/17895361781#step:4:13

Run actions/jekyll-build-pages@v1
/usr/bin/docker run --name ghcrioactionsjekyllbuildpagesv108_f1e46c --label 6[9](https://github.com/4tals/LinksForIsrael/actions/runs/6586647478/job/17895361781#step:4:10)7884 --workdir /github/workspace --rm -e "INPUT_SOURCE" -e "INPUT_DESTINATION" -e "INPUT_TOKEN" -e "INPUT_FUTURE" -e "INPUT_BUILD_REVISION" -e "INPUT_VERBOSE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_ID_TOKEN_REQUEST_URL" -e "ACTIONS_ID_TOKEN_REQUEST_TOKEN" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/LinksForIsrael/LinksForIsrael":"/github/workspace" ghcr.io/actions/jekyll-build-pages:v1.0.8
Bundler can't satisfy your Gemfile's dependencies.
Install missing gems with `bundle install`.
Warning:  github-pages can't satisfy your Gemfile's dependencies.

As you can see, it just says that the dependencies can't be satisfied. It would be very helpful to understand what dependencies exactly can't be satisfied and why - needless to say, it does not reproduce locally and sometimes the workaround can be simple (for example github/pages-gem#887).

@TWiStErRob
Copy link

Agreed, I just noticed the warning and had no idea what's causing it.
In the end I found this issue and realized I probably had a non-standard gem, fixed it based your linked solution @ohadschn, thanks!

TWiStErRob/twisterrob.github.io@f0040c3

@ohadschn
Copy link
Author

ohadschn commented Oct 21, 2023

Agreed, I just noticed the warning and had no idea what's causing it. In the end I found this issue and realized I probably had a non-standard gem, fixed it based your linked solution @ohadschn, thanks!

TWiStErRob/twisterrob.github.io@f0040c3

@TWiStErRob Funny thing is, that workaround didn't actually make the warning go away for me!
https://github.com/4tals/LinksForIsrael/actions/runs/6599550707
Well at least it helped someone 😅

Looking at your Gemfile I wonder though, could this be the reason?

# See https://github.com/TWiStErRob/twisterrob.github.io#upgrade
# Current latest version: https://pages.github.com/versions/
# For some reason omitting the version defaults to 0.
gem 'github-pages', '= 228', group: :jekyll_plugins

Seeing as github-pages is the only Gem I have left, I guess it's worth a shot... What did you mean by the version defaulting to 0 though? The first available version is 1: https://rubygems.org/gems/github-pages/versions?page=3

@TWiStErRob
Copy link

What did you mean by the version defaulting to 0 though?

At one point in the past years gem 'github-pages', group: :jekyll_plugins gave me a "cannot find gem github-pages v0 error" (not exact wording). Maybe that's not happening any more, I think I've done many other upgrades.

Funny thing is, that workaround didn't actually make the warning go away for me!

I think it's because you're using a bundler function and I'm using a language feature. The weird thing is that your build outputs the puts logs, which suggests that the gem might actually be processed? This might be normal behavior, but my guess (needing a strong confirmation / repro) is that there could be a strange interaction between your install_if and --dry-run in bundler.

@ohadschn
Copy link
Author

I think it's because you're using a bundler function and I'm using a language feature. The weird thing is that your build outputs the puts logs, which suggests that the gem might actually be processed? This might be normal behavior, but my guess (needing a strong confirmation / repro) is that there could be a strange interaction between your install_if and --dry-run in bundler.

I've read the code for both the gem function (which you're using and passing the install_if option) and the standalone install_if method: https://github.com/ruby/ruby/blob/8b3d044004be68acf2e71d43c51d99db3deff514/lib/bundler/dsl.rb#L94

From what I can tell, they should behave exactly the same, but I concede that I had a similar suspicion to yours (as nothing else could explain it). I could reach the same logic as I have today by duplicating (instead of nesting) the GITHUB_ACTIONS condition and check, but at this point we're probably moving to Vercel anyway - the lack of environments (dev/test/stage etc.) on GitHub pages is just too much of a deficit...

@trinitronx
Copy link

trinitronx commented Nov 11, 2023

Agreed, I just noticed the warning and had no idea what's causing it.

@TWiStErRob: It seems as if this Action's built-in Gemfile may not match the one from the repo running this Action. Based on the prior messages like:

The following gems are missing

  • concurrent-ruby (1.1.10)
  • i18n (0.9.5)
  • minitest (5.15.0)
  • thread_safe (0.3.6)
  • tzinfo (1.2.9)
    [...SNIP...]
    Install missing gems with bundle install
    Warning: github-pages can't satisfy your Gemfile's dependencies.
    To use retry middleware with Faraday v2.0+, install faraday-retry gem

So, it seems that bundler is noticing that the resolved dependency chain from this Action's Gemfile does not match that of the running repo's Gemfile{,.lock}.

@TWiStErRob
Copy link

@trinitronx For the record the warning comes from here:

if test -e "$SOURCE_DIRECTORY/Gemfile" && ! bundle check --dry-run --gemfile "$SOURCE_DIRECTORY/Gemfile" >/dev/null 2>&1; then
echo "::warning:: github-pages can't satisfy your Gemfile's dependencies."

where you can see what command the action executes. So you're right that it's "comparing" the GH Pages Classic Gemfile with the repo's actual Gemfile.


Note: I totally gave up on using the defaults though, because based on my research it seems they will never update to Jekyll 4. It might be allowed via opt-in eventually, but with the new (currently beta) approach Pages Classic feels kind of defunct.

@adamniedzielski
Copy link

@TWiStErRob thank you for doing the research and writing it down here 💛 You pointed me in the right direction. The current documentation is misleading.

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

4 participants