Skip to content

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

Closed
@xkwangcn

Description

@xkwangcn

/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/registryDevfile registry for stacks and infrastructurekind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions