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

Generator in docker crash #844

Closed
polyn0m opened this issue Oct 15, 2023 · 10 comments · Fixed by #1464
Closed

Generator in docker crash #844

polyn0m opened this issue Oct 15, 2023 · 10 comments · Fixed by #1464
Labels
bug Something isn't working released

Comments

@polyn0m
Copy link

polyn0m commented Oct 15, 2023

Describe the bug

I use docs command for generating docs

docker run --rm -it \
   -v ${PWD}/docks.yaml:/app/asyncapi.yml \
   -v ${PWD}/output:/app/output \
   asyncapi/cli generate fromTemplate -o /app/output /app/asyncapi.yml @asyncapi/html-template --force-write

And getting output:

Generation in progress. Keep calm and wait a bit... done

Generator Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/node-fetch/node_modules'

Docs not generated!

How to Reproduce

  • Run a command
Env:
  • macOS 13.4.1

  • Docker info
     Client:
      Context:    default
      Debug Mode: false
      Plugins:
       buildx: Docker Buildx (Docker Inc., v0.10.3)
       compose: Docker Compose (Docker Inc., v2.15.1)
       dev: Docker Dev Environments (Docker Inc., v0.1.0)
       extension: Manages Docker extensions (Docker Inc., v0.2.18)
       sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
       scan: Docker Scan (Docker Inc., v0.25.0)
       scout: Command line tool for Docker Scout (Docker Inc., v0.6.0)
     Server:
      Containers: 11
       Running: 4
       Paused: 0
       Stopped: 7
      Images: 35
      Server Version: 20.10.23
      Storage Driver: overlay2
       Backing Filesystem: extfs
       Supports d_type: true
       Native Overlay Diff: true
       userxattr: false
      Logging Driver: json-file
      Cgroup Driver: cgroupfs
      Cgroup Version: 2
      Plugins:
       Volume: local
       Network: bridge host ipvlan macvlan null overlay
       Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
      Swarm: inactive
      Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2
      Default Runtime: runc
      Init Binary: docker-init
      containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640
      runc version: v1.1.4-0-g5fd4c4d
      init version: de40ad0
      Security Options:
       seccomp
        Profile: default
       cgroupns
      Kernel Version: 5.15.49-linuxkit
      Operating System: Docker Desktop
      OSType: linux
      Architecture: x86_64
      CPUs: 4
      Total Memory: 3.841GiB
      Name: docker-desktop
      ID: ZRRM:VY6O:OMPU:L2Q5:W3QB:VVON:PI2O:Z4US:TEKF:A2OA:TORO:YIOR
      Docker Root Dir: /var/lib/docker
      Debug Mode: false
      HTTP Proxy: http.docker.internal:3128
      HTTPS Proxy: http.docker.internal:3128
      No Proxy: hubproxy.docker.internal
      Registry: https://index.docker.io/v1/
      Labels:
      Experimental: false
      Insecure Registries:
       hubproxy.docker.internal:5000
       127.0.0.0/8
      Live Restore Enabled: false
    

Expected behavior

Docs generated in output folder!

@polyn0m polyn0m added the bug Something isn't working label Oct 15, 2023
@github-actions
Copy link
Contributor

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@hofin34
Copy link

hofin34 commented Oct 20, 2023

You need to run it with argument --user=root - I didn't search in source code, but I think, that the problem is, that the container downloads and installs template (in your case @asyncapi/html-template) after startup.

@ldynia
Copy link

ldynia commented Nov 28, 2023

It doesn't work despite the --user=root flag being provided.

@derberg
Copy link
Member

derberg commented Dec 18, 2023

@polyn0m sorry for not an addressing the problem earlier but we were focused on AsyncAPI v3 release.
@ldynia can you please clarify if after using --user=root the error is still related to permissions an nothing else

to share also more context, I believe permission issues are related to the same reason I described in asyncapi/html-template#454 (comment)

@polyn0m
Copy link
Author

polyn0m commented Dec 18, 2023

@hofin34 @derberg yep, adding --user=root problem is gone.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

Copy link
Collaborator

Amzani commented Apr 29, 2024

still relevant

@github-actions github-actions bot removed the stale label Apr 30, 2024
@Altair-Bueno
Copy link

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

Closing issues just because nobody is writing comments about it every day is a terrible practice, specially when the only workaround is running the docker command as root (which is a HUGE security risk)

@Amzani
Copy link
Collaborator

Amzani commented Jun 10, 2024

@Altair-Bueno Thanks for your feedback,
As a maintainer, it helps to check non-active issues and prioritize them again, so in practice, valid issues are never closed if maintainers are active.

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 2.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

7 participants