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

Building on arm64 for arm64 is broken. #586

Closed
1 of 11 tasks
IngwiePhoenix opened this issue Aug 14, 2023 · 2 comments
Closed
1 of 11 tasks

Building on arm64 for arm64 is broken. #586

IngwiePhoenix opened this issue Aug 14, 2023 · 2 comments
Labels
a:bug Something isn't working

Comments

@IngwiePhoenix
Copy link

Can the issue be reproduced with the latest available release? (y/n) Yes, I am using master, in fact.

Which one is the environment gotify server is running in?

  • Docker
  • Linux machine
  • Windows machine

Do you have an reverse proxy installed in front of gotify server? (Please select None if the problem can be reproduced without the presense of a reverse proxy)

  • None
  • Nginx
  • Apache
  • Caddy

On which client do you experience problems? (Select as many as you can see)

  • WebUI
  • gotify-cli
  • Android Client
  • 3rd-party API call (Please include your code)

What did you do?

  • Clone the repository
  • Install NodeJS and NPM via NVM
  • Globally install yarn, as it is used in the Makefile
  • Try make build-js
  • Also try make build-linux-arm64

What did you expect to see?
A running build process

What did you see instead? (Include screenshots, android logcat/request dumps if possible)
When I tried to do build-js, I get:

root@birb:/srv/gotify# make build-js
(cd ui && yarn build)
yarn run v1.22.19
$ react-scripts build
Creating an optimized production build...
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (/srv/gotify/ui/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/srv/gotify/ui/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/srv/gotify/ui/node_modules/webpack/lib/NormalModule.js:471:10)
    at /srv/gotify/ui/node_modules/webpack/lib/NormalModule.js:503:5
    at /srv/gotify/ui/node_modules/webpack/lib/NormalModule.js:358:12
    at /srv/gotify/ui/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/srv/gotify/ui/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/srv/gotify/ui/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /srv/gotify/ui/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/srv/gotify/ui/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/srv/gotify/ui/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/srv/gotify/ui/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/srv/gotify/ui/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /srv/gotify/ui/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
/srv/gotify/ui/node_modules/react-scripts/scripts/build.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (/srv/gotify/ui/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/srv/gotify/ui/node_modules/webpack/lib/NormalModule.js:417:16)
    at /srv/gotify/ui/node_modules/webpack/lib/NormalModule.js:452:10
    at /srv/gotify/ui/node_modules/webpack/lib/NormalModule.js:323:13
    at /srv/gotify/ui/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /srv/gotify/ui/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/srv/gotify/ui/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /srv/gotify/ui/node_modules/react-scripts/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v20.5.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
make: *** [Makefile:127: build-js] Error 1

Something tells me this has to do with the fact that I am running on Ubuntu 22.04 on a Linux server; a VPS rented at Hetzner, part of their recent ARM line.

However, when I tried to do make build-linux-arm64, I get:

root@birb:/srv/gotify# make build-linux-arm64
docker run --rm -v "$PWD/.:/proj" -v "`go env GOPATH`/pkg/mod/.:/go/pkg/mod:ro" -w /proj gotify/build:`cat GO_VERSION`-linux-arm64 go build -mod=readonly -a -installsuffix cgo -ldflags "$LD_FLAGS" -o ./build/gotify-linux-arm64 /proj
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
exec /usr/local/go/bin/go: exec format error
make: *** [Makefile:139: build-linux-arm64] Error 1

So... Do you have any ideas here? I am trying to migrate away from the Docker image since that one doesn't have an ARM image, meaning I couldn't keep using it anymore once i switched servers, unfortunately.

Thank you and kind regards,
Ingwie

@IngwiePhoenix IngwiePhoenix added the a:bug Something isn't working label Aug 14, 2023
@eternal-flame-AD
Copy link
Member

Your first problem is duplicate of #574 , for now you need to export NODE_OPTIONS=--openssl-legacy-provider.

The second problem is you are running an amd64 image for cross compiling to arm on an arm system. If you are building gotify yourself and you have go installed locally you can try build without docker using make build-js && go build -o gotify -ldflags="-s -w -X main.Mode=prod" app.go

@jmattheis
Copy link
Member

See also #377 (comment)

@jmattheis jmattheis closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug Something isn't working
Development

No branches or pull requests

3 participants