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

chown: changing ownership for bitbucket azure pipelines #2271

Closed
Khalifa1997 opened this issue Nov 30, 2023 · 5 comments
Closed

chown: changing ownership for bitbucket azure pipelines #2271

Khalifa1997 opened this issue Nov 30, 2023 · 5 comments
Assignees

Comments

@Khalifa1997
Copy link

Khalifa1997 commented Nov 30, 2023

Bug Report

  • At what date and time did you most recently experience the problem?

November 29th 2023, 9:43:56 am (GMT+2).

  • Where did you experience the problem? E.g. Azure Web Apps, Azure Functions, Azure Container Registry, or offline use.

Bitbucket Pipelines, used for deploying a website by microsoft/azure-static-web-apps-deploy .

  • If your repo is publicly available please share its URL:

It's not public.

  • What happened?

started getting this error for every file in my repo (path changes per file)
chown: changing ownership of '/opt/atlassian/pipelines/agent/build/staticwebapp.config.json': Operation not permitted

  • What did you expect or want to happen?

To build the web app and deploy it normally without problems.

  • How can we reproduce it?

This is my bitbucket-pipelines.yml file

options:
  max-time: 10
definitions:
  services:
    docker:
      memory: 3071
image: node:16.14.0
pipelines:
  custom:
    deploy-stage:
      - step:
          name: Deploy to Azure
          deployment: staging
          script:
            - pipe: microsoft/azure-static-web-apps-deploy:main
              variables:
                APP_LOCATION: "$BITBUCKET_CLONE_DIR/"
                API_TOKEN: $deployment_token_stage
                APP_BUILD_COMMAND: yarn run build --mode=stage
                DEVELOPMENT_ENVIRONMENT: stage
  • Do you have log output? Please include between the backticks:
Try to validate location at: '/bin/staticsites/opt/atlassian/pipelines/agent/build'.
App Directory Location: '/opt/atlassian/pipelines/agent/build/' was found.
Try to validate location at: '/bin/staticsites/swa-db-connections'.
Looking for event info
Could not get event info. Proceeding
Starting to build app with Oryx
Azure Static Web Apps utilizes Oryx to build both static applications and Azure Functions. You can find more details on Oryx here: https://github.com/microsoft/Oryx
Oryx will build app with the following custom override command: yarn run build --mode=stage
---Oryx build logs---
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues
Oryx Version: 0.2.20231027.1, Commit: 22314309551107182cffca9fc39d97480466c11c, ReleaseTagName: 20231027.1
Build Operation ID: a6163d50e9f6ce68
OS Type           : bullseye
Image Type        : jamstack
Detecting platforms...
Detected following platforms:
  nodejs: 16.20.2
Version '16.20.2' of platform 'nodejs' is not installed. Generating script to install it...
Detected the following frameworks: Vue.js,Typescript
Source directory     : /opt/atlassian/pipelines/agent/build
Destination directory: /bin/staticsites/81bd691d-a560-4014-a47a-9d9f0e1be478-swa-oryx/app
Installing common platform dependencies...
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8062 kB]
Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [259 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [17.7 kB]
Fetched 8547 kB in 1s (6519 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
  libpq-dev libpq5 libtiff5
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 614 kB of archives.
After this operation, 3072 B of additional disk space will be used.
Get:1 http://deb.debian.org/debian-security bullseye-security/main amd64 libpq-dev amd64 13.13-0+deb11u1 [141 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security/main amd64 libpq5 amd64 13.13-0+deb11u1 [182 kB]
Get:3 http://deb.debian.org/debian-security bullseye-security/main amd64 libtiff5 amd64 4.2.0-1+deb11u5 [290 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 614 kB in 0s (23.4 MB/s)
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 20486 files and directories currently installed.)
Preparing to unpack .../libpq-dev_13.13-0+deb11u1_amd64.deb ...
Unpacking libpq-dev (13.13-0+deb11u1) over (13.11-0+deb11u1) ...
Preparing to unpack .../libpq5_13.13-0+deb11u1_amd64.deb ...
Unpacking libpq5:amd64 (13.13-0+deb11u1) over (13.11-0+deb11u1) ...
Preparing to unpack .../libtiff5_4.2.0-1+deb11u5_amd64.deb ...
Unpacking libtiff5:amd64 (4.2.0-1+deb11u5) over (4.2.0-1+deb11u4) ...
Setting up libpq5:amd64 (13.13-0+deb11u1) ...
Setting up libpq-dev (13.13-0+deb11u1) ...
Setting up libtiff5:amd64 (4.2.0-1+deb11u5) ...
Processing triggers for libc-bin (2.31-13+deb11u7) ...
Reading package lists...
Building dependency tree...
Reading state information...
git is already the newest version (1:2.30.2-1+deb11u2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Downloading and extracting 'nodejs' version '16.20.2' to '/opt/nodejs/16.20.2'...
Detected image debian flavor: bullseye.
Downloaded in 0 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: nodejs...
Done in 1 sec(s).
Removing existing manifest file
Creating directory for command manifest file if it does not exist
Creating a manifest file...
Node Build Command Manifest file created.
Using Node version:
v16.20.2
Using Yarn version:
1.22.15
chown: changing ownership of '/opt/atlassian/pipelines/agent/build/global-setup.ts': Operation not permitted
chown: changing ownership of '/opt/atlassian/pipelines/agent/build/public/favicon.ico': Operation not permitted
chown: changing ownership of '/opt/atlassian/pipelines/agent/build/public/index.html': Operation not permitted
chown: changing ownership of '/opt/atlassian/pipelines/agent/build/public': Operation not permitted
.......

---End of Oryx build logs---
Oryx has failed to build the solution.
For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
Exiting
@sassyrog
Copy link

I have been having the exact same issue and all production has been halted because of the same problem

The only difference is my base is node:18.14.2 and I'm deploying a Vue 3 project

@Khalifa1997
Copy link
Author

I have been having the exact same issue and all production has been halted because of the same problem

The only difference is my base is node:18.14.2 and I'm deploying a Vue 3 project

I am also trying to deploy a Vue3 application, our node versions aren't that different too!

@reiser
Copy link

reiser commented Dec 3, 2023

Same issue here workaround:
Just build on your own and deploy only with Onxy.

pipelines:
  branches:
    main:
      - step:
          name: build
          image: node:18.19.0-slim
          caches:
            - node
          script:
            - yarn install
            - rm -rf .next out
            - yarn next build
          artifacts:
            - out/**
      - step:
          name: Deploy to test
          deployment: Staging
          caches:
            - docker
          script:
            - pipe: microsoft/azure-static-web-apps-deploy:main
              variables:
                APP_LOCATION: '$BITBUCKET_CLONE_DIR/out'
                OUTPUT_LOCATION: '$BITBUCKET_CLONE_DIR/out'
                API_TOKEN: $deployment_token
                SKIP_API_BUILD: "true"
                SKIP_APP_BUILD: "true"

@yt11sf
Copy link

yt11sf commented Dec 4, 2023

Have you tried adding - chown -R 165536:165536 $BITBUCKET_CLONE_DIR just before the pipe?

This is raised on this github issue.
Official Bitbucket explanation

@simonjj
Copy link

simonjj commented Jan 13, 2024

This issue seems resolved. Will be closing this issue. If this is still relevant and impacting you please open a new issue and link back to this issue for reference.

@simonjj simonjj closed this as completed Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants