vitorgalvao / tiny-scripts

Collection of small scripts
The Unlicense
308 stars 53 forks source link

appcast non-200 response code #77

Closed ecbrodie closed 7 years ago

ecbrodie commented 7 years ago

I was using cask-repair to update a caskfile in Homebrew Cask (in this case, update Webcatalog from 5.2.0 to 5.2.1). After I was prompted for the new version number and I was shown the correct-looking diff for the caskfile, I received the following prompt:

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
• appcast is probably incorrect, as a non-200 (OK) HTTP response code was returned (301).
• ==> Installing or updating 'rubocop-cask' gem
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Is everything correct? ([y]es / [n]o / [e]dit)

I entered in y to continue, but continued to get the same error showing up after another diff of the caskfile shows up. Each time I entered in y, another line about the rubocop-cask gem would appear, like so:

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
• appcast is probably incorrect, as a non-200 (OK) HTTP response code was returned (301).
• ==> Installing or updating 'rubocop-cask' gem
• ==> Installing or updating 'rubocop-cask' gem
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Is everything correct? ([y]es / [n]o / [e]dit)

With this bug occurring, I am forced to update the caskfile by hand, which seems like a difficult task for a first-time updater like me. This issue fix would help greatly.

vitorgalvao commented 7 years ago

Installing or updating 'rubocop-cask' gem

The problem lies there. For some reason you’re not being able to install this gem. Do you use the system ruby? If yes, you may need to sudo gem install rubocop-cask, though I’d recommend making your default ruby any that not the system one.

Either way, the issue is not cask-repair-related. Something is preventing you from installing that gem, and that is what you need to fix.

Try what I recommended. If that does not work, search the HBC issues. Similar things have been fixed there.

Also, in the future please use fenced code blocks for code, not quotes.

ecbrodie commented 7 years ago

@vitorgalvao thank you for the fast reply.

I am using a RVM-installed Ruby 2.3.1 installation on my machine. When I ran into the error, I ran gem install rubocop-cask. However, that did not appear to fix the problem. What I'll try to do next is run the cask-repair command using a clean gemset on that Ruby installation, so that any gems I have installed already do not interfere with this command's execution. I'll report back after I've tried this to let you know how it goes.

Regarding my usage of quotes instead of code blocks, my apologies about that. I did not realize that the quote blocks were formatted so poorly. My intent was that this was shell output, thus it was not source code and should not be formatted as code. But formatting as code looked much cleaner. Thanks for that feedback.

ecbrodie commented 7 years ago

@vitorgalvao unfortunately, I now need to report a separate issue that is occuring when I use a fresh gemset:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
• appcast is probably incorrect, as a non-200 (OK) HTTP response code was returned (301).
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Is everything correct? ([y]es / [n]o / [e]dit) y
Submitting…
Username for 'https://github.com': ecbrodie
Password for 'https://ecbrodie@github.com':
Error creating pull request: Unprocessable Entity (HTTP 422)
Invalid value for "head"
Error creating pull request: Unprocessable Entity (HTTP 422)
Invalid value for "head"

There was an error submitting the pull request. Please open a bug report on the repo for this script (https://github.com/vitorgalvao/tiny-scripts).

I tried this again and got the same exact error. Since the output is suggesting I open a bug report on this repo, I figure that we could resolve the issue in this thread.

vitorgalvao commented 7 years ago

Glad to see the first problem was fixed. As for the second one, here’s my canned response:

As I’ve mentioned on several occasions, I’m pretty tired of debugging that specific issue. It is hub-related (search for the error on Google) and generally happens with certain git configs. I can’t test them all. You can see from the other issues (e.g. #20) how much time I’ve already wasted on it.

Unfortunately, I won’t keep shooting in the dark. I’m happy to take a PR that squashes the problem for good, but don’t intend to waste much longer trying to diagnose it. It only affects a small set of users and is no longer worth the commitment and frustration.

ecbrodie commented 7 years ago

@vitorgalvao Thank you for the note. I do understand the frustration that you have with repeated Issues being filed to report the same problem. However, do note that I not only filed the Issue to legitimately help the project and its users, but also because the STDOUT from the command literally encouraged me to file a new Issue.

I do want to help you save having to respond in the same exact manner to all future Issues that report this problem with appcast. As such, I have created PR #78 to add both a contributing guide and an issue template to the project. The only content they have for now is to mention Issue #20 in the contributing guide and the issue template encouraging users to read the contributing guide before pressing submit. Hopefully this helps save you time having to deal with new duplicate issues from being followed and also raise encouragement to have a PR submitted to solve the appcast issue once and for all.

vitorgalvao commented 7 years ago

However, do note that I not only filed the Issue to legitimately help the project and its users, but also because the STDOUT from the command literally encouraged me to file a new Issue.

And you did fine. Thank you.