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

[Bug] Crystal build fails #2665

Closed
Northernside opened this issue Nov 26, 2021 · 20 comments
Closed

[Bug] Crystal build fails #2665

Northernside opened this issue Nov 26, 2021 · 20 comments
Labels
bug Something isn't working

Comments

@Northernside
Copy link

Northernside commented Nov 26, 2021

Describe the bug

While running crystal build src/invidious.cr --release --error-trace it fails with the following error:

invidious@raspberrypi:~/invidious $ crystal build src/invidious.cr --release --error-trace
In src/invidious.cr:23:1
 23 | require "pg"
      ^
Error: while requiring "pg"

In lib/pg/src/pg.cr:1:1
 1 | require "db"
     ^
Error: while requiring "db"

In lib/db/src/db.cr:2:1
 2 | require "log"
     ^
Error: can't find file 'log'

If you're trying to require a shard:
- Did you remember to run `shards install`?
- Did you make sure you're running the compiler in the same directory as your shard.yml?

Yes, I already executed shards install and I'm in the same directory as the shard.yml.

Steps to Reproduce

Just install Invidious on a Raspberry Pi 4B 8GB (using http://public.portalier.com/raspbian/ for crystal-lang).

Logs

No browser log bc yk it isn't running yet haha
Screenshots

image

Additional context

I'm trying to install Invidious on a Raspberry Pi 4B running on Rasbian via a 256GB SSD.

@Northernside Northernside added the bug Something isn't working label Nov 26, 2021
@unixfox
Copy link
Member

unixfox commented Nov 26, 2021

Please post your crystal version: crystal --version

@Northernside
Copy link
Author

crystal --version output:

Crystal 0.33.0 (2020-03-02)

LLVM: 5.0.1
Default target: arm-unknown-linux-gnueabihf

@unixfox
Copy link
Member

unixfox commented Nov 26, 2021

Please use at least crystal 1.1.0. We don't support older versions.

That's why you are having issues compiling invidious.

@Northernside
Copy link
Author

That's the thing. The only working method to use crystal on a Raspberry Pi was http://public.portalier.com/raspbian/. But it seems like it's outdated. Do you know any other alternative to use on a Raspberry Pi?

@unixfox
Copy link
Member

unixfox commented Nov 26, 2021

Depending on your raspberry pi version, for example if you have a raspberry pi 3 or 4 then you may consider using our docker image available for ARM64/armv8: #361 (comment). You will need a ARM64/ARMv8 operating system though, raspbian support ARM64: https://old.reddit.com/r/raspberry_pi/comments/gs6omd/raspberry_pi_os_for_arm64_finally_released/ or you can use ubuntu core or archlinux arm.

@unixfox unixfox closed this as completed Nov 26, 2021
@SamantazFox
Copy link
Member

SamantazFox commented Nov 26, 2021

@Northernside ARM has no official releases, so you'll either have to use docker, as recommended by unixfox, or follow the instructions to install crystal from source: https://crystal-lang.org/install/from_sources/ (NB: this requires cross-compilation at some poinf from a x86 or x86_64 host).

@Northernside
Copy link
Author

@Northernside ARM has no official releases, so you'll either have to use docker, as recommended by unixfox, or follow the instructions to install crystal from source: https://crystal-lang.org/install/from_sources/ (NB: this requires cross-compilation at some poinf from a x86 or x86_64 host).

I tried the Docker variant now but the terminal is spammen with standard_init_linux.go:219: exec user process caused: exec format error. What should I do?

@unixfox
Copy link
Member

unixfox commented Nov 26, 2021

@Northernside ARM has no official releases, so you'll either have to use docker, as recommended by unixfox, or follow the instructions to install crystal from source: crystal-lang.org/install/from_sources (NB: this requires cross-compilation at some poinf from a x86 or x86_64 host).

I tried the Docker variant now but the terminal is spammen with standard_init_linux.go:219: exec user process caused: exec format error. What should I do?

You aren't using a ARMv8/ARM64 operating system but a ARMv7 operating system. Please install one of these operating system on your Raspberry Pi:

And make sure to use the correct docker image: quay.io/invidious/invidious:latest-arm64

@Northernside
Copy link
Author

@Northernside ARM has no official releases, so you'll either have to use docker, as recommended by unixfox, or follow the instructions to install crystal from source: crystal-lang.org/install/from_sources (NB: this requires cross-compilation at some poinf from a x86 or x86_64 host).

I tried the Docker variant now but the terminal is spammen with standard_init_linux.go:219: exec user process caused: exec format error. What should I do?

You aren't using a ARMv8/ARM64 operating system but a ARMv7 operating system. Please install one of these operating system on your Raspberry Pi:

And make sure to use the correct docker image: quay.io/invidious/invidious:latest-arm64

Sadly, the Raspberry Pi can't boot any other OS than the armv7 Raspbian from an external SSD without a micro SDCard. So I have to wait until tomorrow when my micro SDCards arrive. I'll update you tomorrow.

@Northernside
Copy link
Author

So,
update for today: My Pi is now running on ARM64 Raspbian. Docker itself is working but Invidious makes some problems under Docker.

Log.

Does somebody know what to do now?

@unixfox
Copy link
Member

unixfox commented Nov 27, 2021

Not sure how you installed docker, but your docker seems broken. Did you install docker using this script: https://get.docker.com/?
And you forgot to use the correct docker image, it's this one: quay.io/invidious/invidious:latest-arm64

@Northernside
Copy link
Author

Northernside commented Nov 27, 2021

Yeah sorry about that. I installed Docker now correctly and used the correct Docker image. No errors so far image but if I open the website via mypi'saddress:3000 nothing happens. Do you know why? And yes, I opened the port 3000

@unixfox
Copy link
Member

unixfox commented Nov 27, 2021

You should try to remove all the docker volumes and containers with docker system prune -a and try again. Make sure to turn off invidious completely with docker-compose down twice before that.

I think I've seen this weird blank page bug before but I don't remember how the user fixed the issue.

@SamantazFox any ideas?

@Northernside
Copy link
Author

image
Didn't help sadly (pruning everything).

@unixfox
Copy link
Member

unixfox commented Nov 27, 2021

Oh that's this page that you are talking about. Invidious listen by default only on localhost and not on the public IP so you will have to change:

ports:
      - "127.0.0.1:3000:3000"

to:

ports:
      - "3000:3000"

@Northernside
Copy link
Author

Ohh haha, yeah thanks! Imma try that as soon as Windows finished the update haha. I'll update you. Could take some times yk Windows is slow asf

@Northernside
Copy link
Author

image
It's working.. kinda. Videos aren't displayed sadly, do you know why?

@unixfox
Copy link
Member

unixfox commented Nov 27, 2021

Click on trending, they should display.

@Northernside
Copy link
Author

I'm sorry for the late answer but GitHub had (and having it now) a major outage.
image
Thanks, it's working! Any way to make the Trending page as the starting page?

@Northernside
Copy link
Author

Northernside commented Nov 27, 2021

Oh, and how do I change the port? I wan't Invidious to be run under the default HTTP port (80) but it isn't working when I change 3000:3000 to 80:80.

EDIT: Changed mapping to 80:3000. Working now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants