cheat.sh icon indicating copy to clipboard operation
cheat.sh copied to clipboard

Internal Server Error 500 (re-issue)

Open chicago-joe opened this issue 4 months ago • 28 comments

Original Issue: #422

I didn't have permissions to re-open it so I had to make a new issue.

Glanced into the build logs and see: Image

Job Run Snippet Lines 615-758

job log

Running 8: :cht.sh
/usr/bin/python3 ../lib/standalone.py :cht.sh
--- results/8^I2025-08-08 05:15:15.525999978 +0000
+++ /tmp/cht.sh.tests-M1VjSQvCA3yaiF^I2025-08-08 05:16:41.971926720 +0000
@@ -114,7 +114,7 @@
     cht.sh --mode lite      # use https://cheat.sh/ only
     cht.sh --mode auto      # use local installation
 
-For intallation and standalone usage, you need \`git\`, \`python\`,
+For installation and standalone usage, you need \`git\`, \`python\`,
 and \`virtualenv\` to be installed locally.
 EOF
     return
@@ -559,7 +559,7 @@
 }
 
 cmd_copy() {
-  if [ -z "$DISPLAY" ]; then
+  if [ -z "$DISPLAY" ] && [ "$is_macos" != yes ]; then
     echo copy: supported only in the Desktop version
   elif [ -z "$input" ]; then
     echo copy: Make at least one query first.
@@ -579,7 +579,7 @@
 }
 
 cmd_ccopy() {
-  if [ -z "$DISPLAY" ]; then
+  if [ -z "$DISPLAY" ] && [ "$is_macos" != yes ]; then
     echo copy: supported only in the Desktop version
   elif [ -z "$input" ]; then
     echo copy: Make at least one query first.
@@ -731,7 +731,7 @@
   curl -s "${CHTSH_URL}"/:cht.sh > "$TMP2"
   if ! cmp "$0" "$TMP2" > /dev/null 2>&1; then
     if grep -q ^__CHTSH_VERSION= "$TMP2"; then
-      # section was vaildated by us already
+      # section was validated by us already
       args=(--shell "$section")
       cp "$TMP2" "$0" && echo "Updated. Restarting..." && rm "$TMP2" && CHEATSH_RESTART=1 exec "$0" "${args[@]}"
     else
FAILED: [8] :cht.sh
Running 9: cht.sh python copy file     # [online]
/usr/bin/python3 ../lib/standalone.py python copy file
--- results/9^I2025-08-08 05:15:15.527000037 +0000
+++ /tmp/cht.sh.tests-M1VjSQvCA3yaiF^I2025-08-08 05:16:42.916926284 +0000
@@ -1,16 +1,23 @@
-^[[38;5;246;03m#  How do I copy a file in Python?^[[39;00m
-^[[38;5;246;03m#  ^[[39;00m
-^[[38;5;246;03m#  shutil (http://docs.python.org/3/library/shutil.html) has many methods^[[39;00m
-^[[38;5;246;03m#  you can use. One of which is:^[[39;00m
-
-^[[38;5;70;01mfrom^[[39;00m^[[38;5;252m ^[[39m^[[38;5;68;04mshutil^[[39;00m^[[38;5;252m ^[[39m^[[38;5;70;01mimport^[[39;00m^[[38;5;252m ^[[39m^[[38;5;252mcopyfile^[[39m
-
-^[[38;5;252mcopyfile^[[39m^[[38;5;252m(^[[39m^[[38;5;252msrc^[[39m^[[38;5;252m,^[[39m^[[38;5;252m ^[[39m^[[38;5;252mdst^[[39m^[[38;5;252m)^[[39m
-
-^[[38;5;246;03m#  Copy the contents of the file named src to a file named dst. The^[[39;00m
-^[[38;5;246;03m#  destination location must be writable; otherwise, an IOError exception^[[39;00m
-^[[38;5;246;03m#  will be raised. If dst already exists, it will be replaced. Special^[[39;00m
-^[[38;5;246;03m#  files such as character or block devices and pipes cannot be copied^[[39;00m
-^[[38;5;246;03m#  with this function. src and dst are path names given as strings.^[[39;00m
-^[[38;5;246;03m#  ^[[39;00m
-^[[38;5;246;03m#  [Swati] [so/q/123198] [cc by-sa 3.0]^[[39;00m
+^[[38;5;248;03m#  [`shutil`][1] has many methods you can use. One of which is:^[[39;00m
+^[[38;5;248;03m#  ^[[39;00m
+^[[38;5;248;03m#  ```^[[39;00m
+^[[38;5;248;03m#  from shutil import copyfile^[[39;00m
+^[[38;5;248;03m#  copyfile(src, dst)^[[39;00m
+^[[38;5;248;03m#  ```^[[39;00m
+^[[38;5;248;03m#  ^[[39;00m
+^[[38;5;252m ^[[39m^[[38;5;248;03m#  - Copy the contents of the file named **src** to a file named^[[39;00m
+^[[38;5;248;03m#  **dst**.^[[39;00m
+^[[38;5;252m ^[[39m^[[38;5;248;03m#  - The destination location must be writable; otherwise, an^[[39;00m
+^[[38;5;248;03m#  **IOError** exception will be raised.^[[39;00m
+^[[38;5;252m ^[[39m^[[38;5;248;03m#  - If **dst** already exists, it will be replaced.^[[39;00m
+^[[38;5;252m ^[[39m^[[38;5;248;03m#  - Special files such as character or block devices and pipes cannot^[[39;00m
+^[[38;5;248;03m#  be copied with this function.^[[39;00m
+^[[38;5;252m ^[[39m^[[38;5;248;03m#  - With **copy**, **src** and **dst** are path names given as^[[39;00m
+^[[38;5;248;03m#  __strings__.^[[39;00m
+^[[38;5;248;03m#  ^[[39;00m
+^[[38;5;248;03m#  If you use `os.path` operations, use `copy` rather than `copyfile`.^[[39;00m
+^[[38;5;248;03m#  `copyfile` will only accept strings.^[[39;00m
+^[[38;5;248;03m#  ^[[39;00m
+^[[38;5;252m  ^[[39m^[[38;5;248;03m#  [1]: [http://docs.python.org/3/library/shutil.html^[[39;00m](http://docs.python.org/3/library/shutil.html%5E[[39;00m)
+^[[38;5;248;03m#  ^[[39;00m
+^[[38;5;248;03m#  [Swati] [so/q/123198] [cc by-sa 3.0]^[[39;00m
FAILED: [9] python copy file
Running 10: python/copy+file            # [online]
/usr/bin/python3 ../lib/standalone.py python/copy+file
--- results/10^I2025-08-08 05:15:15.524999919 +0000
+++ /tmp/cht.sh.tests-M1VjSQvCA3yaiF^I2025-08-08 05:16:43.696925653 +0000
@@ -1,16 +1,23 @@
-^[[38;5;246;03m#  How do I copy a file in Python?^[[39;00m
-^[[38;5;246;03m#  ^[[39;00m
-^[[38;5;246;03m#  shutil (http://docs.python.org/3/library/shutil.html) has many methods^[[39;00m
-^[[38;5;246;03m#  you can use. One of which is:^[[39;00m
-
-^[[38;5;70;01mfrom^[[39;00m^[[38;5;252m ^[[39m^[[38;5;68;04mshutil^[[39;00m^[[38;5;252m ^[[39m^[[38;5;70;01mimport^[[39;00m^[[38;5;252m ^[[39m^[[38;5;252mcopyfile^[[39m
-
-^[[38;5;252mcopyfile^[[39m^[[38;5;252m(^[[39m^[[38;5;252msrc^[[39m^[[38;5;252m,^[[39m^[[38;5;252m ^[[39m^[[38;5;252mdst^[[39m^[[38;5;252m)^[[39m
-
-^[[38;5;246;03m#  Copy the contents of the file named src to a file named dst. The^[[39;00m
-^[[38;5;246;03m#  destination location must be writable; otherwise, an IOError exception^[[39;00m
-^[[38;5;246;03m#  will be raised. If dst already exists, it will be replaced. Special^[[39;00m
-^[[38;5;246;03m#  files such as character or block devices and pipes cannot be copied^[[39;00m
-^[[38;5;246;03m#  with this function. src and dst are path names given as strings.^[[39;00m
-^[[38;5;246;03m#  ^[[39;00m
-^[[38;5;246;03m#  [Swati] [so/q/123198] [cc by-sa 3.0]^[[39;00m
+^[[38;5;248;03m#  [`shutil`][1] has many methods you can use. One of which is:^[[39;00m
+^[[38;5;248;03m#  ^[[39;00m
+^[[38;5;248;03m#  ```^[[39;00m
+^[[38;5;248;03m#  from shutil import copyfile^[[39;00m
+^[[38;5;248;03m#  copyfile(src, dst)^[[39;00m
+^[[38;5;248;03m#  ```^[[39;00m
+^[[38;5;248;03m#  ^[[39;00m
+^[[38;5;252m ^[[39m^[[38;5;248;03m#  - Copy the contents of the file named **src** to a file named^[[39;00m
+^[[38;5;248;03m#  **dst**.^[[39;00m
+^[[38;5;252m ^[[39m^[[38;5;248;03m#  - The destination location must be writable; otherwise, an^[[39;00m
+^[[38;5;248;03m#  **IOError** exception will be raised.^[[39;00m
+^[[38;5;252m ^[[39m^[[38;5;248;03m#  - If **dst** already exists, it will be replaced.^[[39;00m
+^[[38;5;252m ^[[39m^[[38;5;248;03m#  - Special files such as character or block devices and pipes cannot^[[39;00m
+^[[38;5;248;03m#  be copied with this function.^[[39;00m
+^[[38;5;252m ^[[39m^[[38;5;248;03m#  - With **copy**, **src** and **dst** are path names given as^[[39;00m
+^[[38;5;248;03m#  __strings__.^[[39;00m
+^[[38;5;248;03m#  ^[[39;00m
+^[[38;5;248;03m#  If you use `os.path` operations, use `copy` rather than `copyfile`.^[[39;00m
+^[[38;5;248;03m#  `copyfile` will only accept strings.^[[39;00m
+^[[38;5;248;03m#  ^[[39;00m
+^[[38;5;252m  ^[[39m^[[38;5;248;03m#  [1]: [http://docs.python.org/3/library/shutil.html^[[39;00m](http://docs.python.org/3/library/shutil.html%5E[[39;00m)
+^[[38;5;248;03m#  ^[[39;00m
+^[[38;5;248;03m#  [Swati] [so/q/123198] [cc by-sa 3.0]^[[39;00m
FAILED: [10] python/copy+file
Running 11: python/copy+file?Q          # [online]
/usr/bin/python3 ../lib/standalone.py python/copy+file?Q
--- results/11^I2025-08-08 05:15:15.524999919 +0000
+++ /tmp/cht.sh.tests-M1VjSQvCA3yaiF^I2025-08-08 05:16:44.458925349 +0000
@@ -1,3 +1 @@
-^[[38;5;70;01mfrom^[[39;00m^[[38;5;252m ^[[39m^[[38;5;68;04mshutil^[[39;00m^[[38;5;252m ^[[39m^[[38;5;70;01mimport^[[39;00m^[[38;5;252m ^[[39m^[[38;5;252mcopyfile^[[39m
 
-^[[38;5;252mcopyfile^[[39m^[[38;5;252m(^[[39m^[[38;5;252msrc^[[39m^[[38;5;252m,^[[39m^[[38;5;252m ^[[39m^[[38;5;252mdst^[[39m^[[38;5;252m)^[[39m
FAILED: [11] python/copy+file?Q
Running 1

chicago-joe avatar Aug 19 '25 09:08 chicago-joe

It seems that some permission / path issues exist during the build and testing stages.

Furthermore the downstream docker job fails on running to the max execution time of 24 hours. Likely this has something to do with the previous job failures.

Image

chicago-joe avatar Aug 19 '25 09:08 chicago-joe

The 'Internal Server Error 500' on the live deployment (https://cheat.sh/) was fixed, please retry

chubin avatar Aug 19 '25 09:08 chubin

Not fixed for me

LelouBil avatar Aug 29 '25 03:08 LelouBil

Try again

chubin avatar Aug 29 '25 06:08 chubin

It works now !

LelouBil avatar Aug 29 '25 14:08 LelouBil

I am still unable to reach https://cheat.sh with the exact same issue.

Froopity avatar Sep 02 '25 02:09 Froopity

Can confirm, same issue for me.

sleepymincy avatar Sep 07 '25 16:09 sleepymincy

try again

chubin avatar Sep 07 '25 18:09 chubin

try again

Works now! What's the issue, may I ask? Would be awkward to keep bothering you each time it happens.

sleepymincy avatar Sep 07 '25 18:09 sleepymincy

I've restarted the server. Seems to be a leaked file descriptor.

chubin avatar Sep 07 '25 18:09 chubin

still unreachable with Internal Server Error 500

manero6 avatar Sep 11 '25 12:09 manero6

Try again

chubin avatar Sep 11 '25 13:09 chubin

@chubin nice, it works now!

manero6 avatar Sep 11 '25 15:09 manero6

Looks like it's down again. Getting a 500.

mre avatar Sep 24 '25 09:09 mre

Please retry

chubin avatar Sep 24 '25 09:09 chubin

It's up, thanks!

mre avatar Sep 24 '25 09:09 mre

Maybe setup automated alerting? Not sure if there any bots on GitHub Marketplace.

abitrolly avatar Sep 24 '25 18:09 abitrolly

Better fix it properly instead, and that's exactly what I am going to do

chubin avatar Sep 25 '25 16:09 chubin

Attempting to use cheat.sh today and it still gives me a 500 error

andylin2004 avatar Oct 07 '25 18:10 andylin2004

Please retry

chubin avatar Oct 07 '25 19:10 chubin

Perfect. Seems like it’s working again.On Oct 7, 2025, at 3:02 PM, Igor Chubin @.***> wrote:chubin left a comment (chubin/cheat.sh#423) Please retry

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

andylin2004 avatar Oct 07 '25 19:10 andylin2004

It's down again. Has been for ages with a few openings occasionally.

psychananaz avatar Oct 08 '25 13:10 psychananaz

Please try again now.

I am working on a new version (a complete rework from scratch) where the problem does not exist

chubin avatar Oct 08 '25 13:10 chubin

Attempting to use cheat.sh today and it still gives me a 500 error

morindo avatar Oct 20 '25 15:10 morindo

Not still, but again. Please retry now

chubin avatar Oct 20 '25 19:10 chubin

Down again! Thank you for maintaining this - saves my life every other day :)

HumbleGrumble87 avatar Nov 26 '25 17:11 HumbleGrumble87

Please retry

chubin avatar Nov 26 '25 17:11 chubin

ferris bueller you're my hero

Sent from Proton Mail for Android.

-------- Original Message -------- On Wednesday, 11/26/25 at 11:25 Igor Chubin @.***> wrote:

chubin left a comment (chubin/cheat.sh#423)

Please retry

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

HumbleGrumble87 avatar Nov 26 '25 17:11 HumbleGrumble87