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

nodejs-nextjs have swc-linux-s390x-gnu error on s390x #797

Closed
xkwangcn opened this issue Mar 9, 2022 · 1 comment
Closed

nodejs-nextjs have swc-linux-s390x-gnu error on s390x #797

xkwangcn opened this issue Mar 9, 2022 · 1 comment
Labels
area/registry Devfile registry for stacks and infrastructure kind/bug Something isn't working

Comments

@xkwangcn
Copy link

xkwangcn commented Mar 9, 2022

/kind bug

Which area this bug is related to?

/area registry

What versions of software are you using?

Operating System:
OpenShift on Z(s390x), OCP_4.9.10

Go Pkg Version:

Bug Summary

Describe the bug:
when do odo push, have error "not install swc-linux-s390x-gnu".

To Reproduce:

odo project create nodejs-nextjs
odo create nodejs-nextjs my-nodejs-nextjs --starter=nodejs-nextjs-starter
odo push

Expected behavior

do odo push success.

Any logs, error output, screenshots etc? Provide the devfile that sees this bug, if applicable.

[odo@7dc71e8ad0ff nextjs]$ odo project create nodejs-nextjs
 ✓  Project "nodejs-nextjs" is ready for use
 ✓  New project created and now using project: nodejs-nextjs
[odo@7dc71e8ad0ff nextjs]$ odo create nodejs-nextjs my-nodejs-nextjs --starter=nodejs-nextjs-starter
Devfile Object Creation
 ✓  Checking if the devfile for "nodejs-nextjs" exists on available registries [41266ns]
 ✓  Creating a devfile component from registry "DefaultDevfileRegistry" [37ms]
Validation
 ✓  Validating if devfile name is correct [18047ns]
 ✓  Validating the devfile for odo [6ms]

Starter Project
 ✓  Downloading starter project nodejs-nextjs-starter from https://github.com/devfile-samples/devfile-stack-nodejs-nextjs.git [3s]
 ✓  Updating the devfile with component name "my-nodejs-nextjs" [40ms]

Please use `odo push` command to create the component with source deployed
[odo@7dc71e8ad0ff nextjs]$ cat devfile.yaml 
schemaVersion: 2.1.0
metadata:
  description: Stack with Next.js 12
  displayName: Next.js
  icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/next-js.svg
  language: javascript
  name: nodejs-nextjs
  projectType: nextjs
  tags:
    - NodeJS
    - Nextjs
  version: 1.0.1
starterProjects:
  - name: nodejs-nextjs-starter
    git:
      checkoutFrom:
        revision: main
      remotes:
        origin: https://github.com/devfile-samples/devfile-stack-nodejs-nextjs.git
components:
  - container:
      endpoints:
        - name: http
          targetPort: 3000
      image: node:lts-slim
      memoryLimit: 1024Mi
    name: runtime
commands:
  - exec:
      commandLine: yarn install
      component: runtime
      group:
        isDefault: true
        kind: build
      workingDir: ${PROJECT_SOURCE}
    id: install
  - exec:
      commandLine: yarn dev
      component: runtime
      group:
        isDefault: true
        kind: run
      hotReloadCapable: true
      workingDir: ${PROJECT_SOURCE}
    id: run
[odo@7dc71e8ad0ff nextjs]$ odo push
 ✓  Waiting for Kubernetes resources [14s]
 ✓  Syncing files into the container [741ms]
 ✓  Building your application in container on cluster [20s]
 ✗  Building your application in container on cluster [6s]
 ✗  Failed to start component with name "my-nodejs-nextjs". Error: Failed to create the component: command execution failed: command execution failed: unable to execute the run command: unable to exec command [/bin/sh -c cd /project && yarn build && yarn install --production --ignore-scripts --prefer-offline]: 
yarn run v1.22.17
warning Skipping preferred cache folder "/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1003410000".
$ next build
warning Cannot find a suitable global folder. Tried these: "/usr/local, /.yarn"
info  - Checking validity of types...
info  - Creating an optimized production build...
error - Failed to load SWC binary for linux/s390x, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
info  - Attempted to load @next/swc-linux-s390x-gnu, but it was not installed
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
: error while streaming command: command terminated with exit code 1

Additional context

Any workaround?

  1. change the code which is clone from https://github.com/devfile-samples/devfile-stack-nodejs-nextjs, modify file package.json from https://raw.githubusercontent.com/devfile-samples/devfile-stack-nodejs-nextjs/main/package.json to:
{
  "name": "nodejs-nextjs",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "11.0.1",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
  "devDependencies": {
    "eslint": "^7.29.0",
    "eslint-config-next": "^11.0.1"
  }
}
  1. vi devfile.yaml, add "yarn add --dev typescript @types/react && " before "yarn install":
[odo@aa04447aef3c nodejs-nextjs]$ cat devfile.yaml 
schemaVersion: 2.1.0
metadata:
  description: Stack with Next.js 12
  displayName: Next.js
  icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/next-js.svg
  language: javascript
  name: nodejs-nextjs
  projectType: nextjs
  tags:
    - NodeJS
    - Nextjs
  version: 1.0.1
starterProjects:
  - name: nodejs-nextjs-starter
    git:
      checkoutFrom:
        revision: main
      remotes:
        origin: https://github.com/devfile-samples/devfile-stack-nodejs-nextjs.git
components:
  - container:
      endpoints:
        - name: http
          targetPort: 3000
      image: node:lts-slim
      memoryLimit: 1024Mi
    name: runtime
commands:
  - exec:
      commandLine: yarn add --dev typescript @types/react && yarn install
      component: runtime
      group:
        isDefault: true
        kind: build
      workingDir: ${PROJECT_SOURCE}
    id: install
  - exec:
      commandLine: yarn dev
      component: runtime
      group:
        isDefault: true
        kind: run
      hotReloadCapable: true
      workingDir: ${PROJECT_SOURCE}
    id: run
  1. then do odo push again, will success.

Suggestion on how to fix the bug

In my opinion, "next: 11.0.1" working fine on s390x, but there are some issue for "next: 12.0.10".
If we want next: 12.0.10 working on s390x, it seems we need to install swc-linux-s390x-gnu from devfile.
But I don't know where we can find swc-linux-s390x-gnu, or who is doing this, or if there is some solution for this.

@kadel That's all, thanks. Looking forward to your reply.

@openshift-ci openshift-ci bot added kind/bug Something isn't working area/registry Devfile registry for stacks and infrastructure labels Mar 9, 2022
@schultzp2020
Copy link
Contributor

This shouldn't be an issue any longer. Let me know if it still pops up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry Devfile registry for stacks and infrastructure kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants