Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Docker container won't read the shared directory, error log says I don't have write permissions Edited

I run bitbucket under docker.  When I turn on the bitbucket server I get the following error:

"Bitbucket Home [/var/atlassian/application-data/bitbucket] exists but is not writable by Bitbucket"

I found the help page, but it looks like all of my settings are correct, and I'm unsure where I am wrong.

Here's a more complete log:

INFO:root:User is currently root. Will downgrade run user to bitbucket

INFO:root:Running Bitbucket Server with command '/bin/su', arguments ['/bin/su', 'bitbucket', '-c', '/opt/atlassian/bitbucket/bin/start-bitbucket.sh -fg']

Starting Atlassian Bitbucket as the current user

Starting bundled Elasticsearch

Hint: Run start-bitbucket.sh --no-search to skip starting Elasticsearch

future versions of Elasticsearch will require Java 11; your Java version from [/opt/java/openjdk/jre] does not meet this requirement

Bundled Elasticsearch started successfully

The current open files limit is set to less than 4096

Attempting to increase limit...

Limit increased to 4096 open files

Starting Bitbucket webapp at http://localhost:7990

2020-03-30 17:29:43,436 INFO [main] o.s.boot.SpringApplication

. ____ _ __ _ _

/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

\\/ ___)| |_)| | | | | || (_| | ) ) ) )

' |____| .__|_| |_|_| |_\__, | / / / /

=========|_|==============|___/=/_/_/_/

:: Spring Boot :: (v2.2.4.RELEASE)

2020-03-30 17:29:43,641 INFO [main] c.a.b.i.b.BitbucketServerApplication Starting BitbucketServerApplication on fdb245d439bd with PID 103 (/opt/atlassian/bitbucket/app/WEB-INF/classes started by bitbucket in /var/atlassian/application-data/bitbucket)

2020-03-30 17:29:43,888 INFO [main] c.a.b.i.b.BitbucketServerApplication The following profiles are active: nio

2020-03-30 17:29:44,694 INFO [main] c.a.b.i.boot.log.BuildInfoLogger Starting Bitbucket 7.1.0 (3d84ac1 built on Mon Mar 23 02:10:04 GMT 2020)

2020-03-30 17:29:44,695 INFO [main] c.a.b.i.boot.log.BuildInfoLogger JVM: AdoptOpenJDK OpenJDK 64-Bit Server VM 1.8.0_242-b08

2020-03-30 17:29:51,678 ERROR [main] c.a.s.i.j.HomeApplicationEventCheck Bitbucket Home [/var/atlassian/application-data/bitbucket] exists but is not writable by Bitbucket

2020-03-30 17:29:53,074 INFO [main] c.a.b.i.b.BitbucketServerApplication Started BitbucketServerApplication in 17.38 seconds (JVM running for 24.882)

2020-03-30 17:30:00,382 INFO [spring-startup] c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory /var/atlassian/application-data/bitbucket

2020-03-30 17:30:19,546 WARN [http-nio-7990-exec-1] o.a.c.util.SessionIdGeneratorBase Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [654] milliseconds.

A "ls -la" check on the hosts docker share directory shows I have the correct permissions set on the docker host, and that files can be created.

total 16
drwx------ 1 bitbucket bitbucket 178 Mar 30 10:29 .
drwxrwxrwx 1 1000 docker 220 Mar 30 10:14 ..
-rw------- 1 bitbucket bitbucket 377 Mar 30 10:29 .bash_history
-rw-r----- 1 bitbucket bitbucket 17 Mar 30 10:30 .lock
-rw-r----- 1 bitbucket bitbucket 61 Mar 30 10:17 .version
drwx------ 1 bitbucket bitbucket 66 Mar 30 10:15 __pycache__
drwxr-x--- 1 bitbucket bitbucket 0 Mar 30 10:17 bin
drwxr-x--- 1 bitbucket bitbucket 0 Mar 30 10:17 caches
drwxr-x--- 1 bitbucket bitbucket 0 Mar 30 10:17 export
-rw-r----- 1 bitbucket bitbucket 66 Mar 30 10:17 home.properties
drwxr-x--- 1 bitbucket bitbucket 12 Mar 30 10:17 lib
drwxr-x--- 1 bitbucket bitbucket 298 Mar 30 10:17 log
drwxr-x--- 1 bitbucket bitbucket 22 Mar 30 10:17 plugins
drwxrwxr-x 1 bitbucket bitbucket 46 Mar 30 10:17 shared
drwxrwxr-x 1 bitbucket bitbucket 446 Mar 30 10:29 tmp

id command on the docker host bitbucket user returns:

uid=2003(bitbucket) gid=2003(bitbucket) groups=2003(bitbucket)

I quick list of my container's environment variables:

LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
HOSTNAME=3082a17cb20a
SERVER_SCHEME=https
JDBC_PASSWORD= {is correct}
JAVA_HOME=/opt/java/openjdk
RUN_USER=bitbucket
JDBC_USER=bitbucket
BITBUCKET_INSTALL_DIR=/opt/atlassian/bitbucket
BITBUCKET_HOME=/var/atlassian/application-data/bitbucket
ELASTICSEARCH_ENABLED=true
JAVA_VERSION=jdk8u242-b08
SERVER_SECURE=true
PWD=/var/atlassian/application-data/bitbucket
HOME=/var/atlassian/application-data/bitbucket
SERVER_PROXY_NAME=git.mydomain.com
RUN_GROUP=bitbucket
JDBC_DRIVER=org.postgresql.Driver
RUN_UID=2003
TERM=xterm
SHLVL=1
LANGUAGE=en_US:en
RUN_GID=2003
PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
APPLICATION_MODE=default
JDBC_URL=jdbc:postgresql://pg:5432/bitbucket
SERVER_PROXY_PORT=443
_=/usr/bin/printenv

Here's a list of the users in the container:

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
bitbucket:x:2003:2003::/var/atlassian/application-data/bitbucket:/bin/bash

Also, the documentation outlines an altbitbucket user account, which I do not have in the container.

I can log into the docker container with the bitbucket user, use mkdir and rmdir and rm and chmod on directories and files in the /var/atlassian/application-data/bitbucket directory.  But for whatever reason, while turning the container on I'm being told I don't have write permissions?  I made a new docker host directory and shared with with the Bitbucket docker container, it wrote files to it during the container's startup, but still has an error saying it can't write to the directory.

1 answer

Edit: I thought I had it, but the issue reappeared.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.1
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

456 views 4 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you