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

how to pull from a separate Fedora instance #86

Open
jmcgranahan opened this issue Feb 19, 2025 · 13 comments
Open

how to pull from a separate Fedora instance #86

jmcgranahan opened this issue Feb 19, 2025 · 13 comments

Comments

@jmcgranahan
Copy link

It looks like Fedora is part of the package here, but we are needing to link Avalon to a separate Fedora instance (that is running Fedora 6). Before I start mucking around in the code, thought I would ask here if there was any guidance or anyway to do this easily.

<style> </style>
IMAGE COMMAND NAMES
avalonmediasystem/avalon:8 "bundle exec sidekiq…" avalon-docker-worker-1
avalonmediasystem/avalon:8 "bash -c 'bundle exe…" avalon-docker-avalon-1
fcrepo/fcrepo:6-tomcat9 "catalina.sh run" avalon-docker-fedora-1
postgres:14-alpine "docker-entrypoint.s…" avalon-docker-db-1
solr:9 "docker-entrypoint.s…" avalon-docker-solr-1
avalonmediasystem/nginx "/sbin/my_init" avalon-docker-hls-1
redis:alpine "docker-entrypoint.s…" avalon-docker-redis-1
@cjcolvar
Copy link
Member

@jmcgranahan If you are wanting to connect Avalon to a separate Fedora 6 instance, you should be able to do this by editing the avalon service in your docker-compose.yml and changing the following environment variables:

      - FEDORA_BASE_PATH
      - FEDORA_URL=http://fedoraAdmin:fedoraAdmin@fedora:8080/fcrepo/rest

It should also work setting these in .env instead of docker-compose.yml.

These environment variables are used in this initializer to setup the Fedora connection.

@jmcgranahan
Copy link
Author

@cjcolvar unfortunately there's been no change - either when adding the FEDORA_URL to the .env or updating the docker-compose.yml. Should the Fedora container even be running if we are trying to connect to an external Fedora 6 instance? When I look at the logs for the Fedora container, I see no indication it is even pointing to our external Fedora instance - it all appears to be local. Ideas?

Current .env

# Required Settings
APP_NAME=avalon
AVALON_BRANCH=main
SETTINGS__DOMAIN=http://10.55.58.198/
STREAMING_HOST=http://10.55.58.198/
AVALON_DB_PASSWORD=xxxxxxxx
FEDORA_DB_PASSWORD=yyyyyyy
SECRET_KEY_BASE=11111111
 
# Recommended Settings
EMAIL_COMMENTS=libwebmaster@list.vanderbilt.edu
EMAIL_NOTIFICATION=lds@vanderbilt.edu
EMAIL_SUPPORT=lds@vanderbilt.edu
SMTP_ADDRESS=email-smtp.us-east-1.amazonaws.com
SMTP_PORT=587
 
# set FEDORA connector
FEDORA_URL=http://10.55.58.175:8080/rest

@cjcolvar
Copy link
Member

Setting FEDORA_URL should direct Avalon to connect to the external Fedora server. Are you seeing an error in the avalon logs?

The Fedora container doesn't need to be running but that shouldn't impact things. To avoid running the fedora container, you can comment out - fedora from the depends_on under the avalon service. Then it won't startup when starting docker-compose.

@jmcgranahan
Copy link
Author

Unfortunately, no @cjcolvar - nothing unusual at least. I did log into avalon-docker-avalon-1 and confirmed we can access the external Fedora system using wget (after installing it) so at least I know it's not a firewall issue. It just appears to be ignoring the .env file and I'm not sure why :

Avalon logs:

[root@ip-10-55-58-198 avalon-docker]# docker-compose logs avalon
avalon-1  | /home/app/avalon/config/initializers/presenter_config.rb:124: warning: already initialized constant SpeedyAF::Base::SOLR_ALL
avalon-1  | /usr/local/bundle/gems/speedy-af-0.4.0/lib/speedy_af/base.rb:8: warning: previous definition of SOLR_ALL was here
avalon-1  | You can remove `require 'dalli/cas/client'` as this code has been rolled into the standard 'dalli/client'.
avalon-1  | WARNING: Sidekiq::Web.sessions= is no longer relevant and will be removed in Sidekiq 7.0. /usr/local/bundle/gems/sidekiq-6.5.12/lib/sidekiq/web.rb:79:in `set'
avalon-1  | 2025-02-27T13:18:28.988Z pid=8 tid=840 INFO: Cron Jobs - added job with name: Scan for batches - every 1min
avalon-1  | 2025-02-27T13:18:29.023Z pid=8 tid=840 INFO: Cron Jobs - added job with name: Status Checking and Email Notification of Existing Batches - every 15min
avalon-1  | 2025-02-27T13:18:29.043Z pid=8 tid=840 INFO: Cron Jobs - added job with name: Status Checking and Email Notification for Stalled Batches - every 1day
avalon-1  | 2025-02-27T13:18:29.058Z pid=8 tid=840 INFO: Cron Jobs - added job with name: Clean out user sessions older than 7 days - every 6hour
avalon-1  | You can remove `require 'dalli/cas/client'` as this code has been rolled into the standard 'dalli/client'.
avalon-1  | => Booting Puma
avalon-1  | => Rails 7.2.2 application starting in production
avalon-1  | => Run `bin/rails server --help` for more startup options
avalon-1  | /home/app/avalon/config/initializers/presenter_config.rb:124: warning: already initialized constant SpeedyAF::Base::SOLR_ALL
avalon-1  | /usr/local/bundle/gems/speedy-af-0.4.0/lib/speedy_af/base.rb:8: warning: previous definition of SOLR_ALL was here
avalon-1  | DEPRECATION WARNING: Blacklight::Base is deprecated and will be removed in Blacklight 8.0.0.
avalon-1  |     Include Blacklight::Configurable and Blacklight::SearchContext as needed (included in Blacklight::Catalog). (called from include at /usr/local/bundle/gems/blacklight-7.38.0/app/controllers/concerns/blacklight/catalog.rb:9)
avalon-1  | DEPRECATION WARNING: Blacklight::Base is deprecated and will be removed in Blacklight 8.0.0.
avalon-1  |     Include Blacklight::Configurable and Blacklight::SearchContext as needed (included in CatalogController). (called from include at /home/app/avalon/app/controllers/catalog_controller.rb:20)
avalon-1  | DEPRECATION WARNING: Blacklight::AccessControls::Enforcement is deprecated and will be removed in 1.0. (called from include at /home/app/avalon/app/models/collection_search_builder.rb:17)
avalon-1  | DEPRECATION WARNING: Blacklight::AccessControls::Enforcement is deprecated and will be removed in 1.0. (called from include at /home/app/avalon/app/models/search_builder.rb:18)
avalon-1  | DEPRECATION WARNING: Blacklight::AccessControls::Enforcement is deprecated and will be removed in 1.0. (called from include at /usr/local/bundle/gems/hydra-core-13.0.0/app/models/hydra/search_builder.rb:4)
avalon-1  | WARNING: Sidekiq::Web.sessions= is no longer relevant and will be removed in Sidekiq 7.0. /usr/local/bundle/gems/sidekiq-6.5.12/lib/sidekiq/web.rb:79:in `set'
avalon-1  | 2025-02-27T13:18:41.170Z pid=1 tid=7il INFO: Cron Jobs - added job with name: Scan for batches - every 1min
avalon-1  | 2025-02-27T13:18:41.195Z pid=1 tid=7il INFO: Cron Jobs - added job with name: Status Checking and Email Notification of Existing Batches - every 15min
avalon-1  | 2025-02-27T13:18:41.200Z pid=1 tid=7il INFO: Cron Jobs - added job with name: Status Checking and Email Notification for Stalled Batches - every 1day
avalon-1  | 2025-02-27T13:18:41.203Z pid=1 tid=7il INFO: Cron Jobs - added job with name: Clean out user sessions older than 7 days - every 6hour
avalon-1  | Puma starting in single mode...
avalon-1  | * Puma version: 6.4.3 (ruby 3.3.6-p108) ("The Eagle of Durango")
avalon-1  | *  Min threads: 3
avalon-1  | *  Max threads: 3
avalon-1  | *  Environment: production
avalon-1  | *          PID: 1
avalon-1  | * Listening on http://0.0.0.0:3000
avalon-1  | Use Ctrl-C to stop

Fedora logs:

[root@ip-10-55-58-198 avalon-docker]# docker-compose logs fedora
fedora-1  | NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
fedora-1  | 27-Feb-2025 13:18:18.578 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.98
fedora-1  | 27-Feb-2025 13:18:18.630 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Dec 5 2024 19:50:29 UTC
fedora-1  | 27-Feb-2025 13:18:18.637 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.98.0
fedora-1  | 27-Feb-2025 13:18:18.637 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
fedora-1  | 27-Feb-2025 13:18:18.637 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            6.1.128-136.201.amzn2023.x86_64
fedora-1  | 27-Feb-2025 13:18:18.638 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
fedora-1  | 27-Feb-2025 13:18:18.638 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /opt/java/openjdk
fedora-1  | 27-Feb-2025 13:18:18.639 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           11.0.25+9
fedora-1  | 27-Feb-2025 13:18:18.639 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Eclipse Adoptium
fedora-1  | 27-Feb-2025 13:18:18.640 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
fedora-1  | 27-Feb-2025 13:18:18.640 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
fedora-1  | 27-Feb-2025 13:18:18.644 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
fedora-1  | 27-Feb-2025 13:18:18.651 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
fedora-1  | 27-Feb-2025 13:18:18.651 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
fedora-1  | 27-Feb-2025 13:18:18.651 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
fedora-1  | 27-Feb-2025 13:18:18.652 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
fedora-1  | 27-Feb-2025 13:18:18.652 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
fedora-1  | 27-Feb-2025 13:18:18.660 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
fedora-1  | 27-Feb-2025 13:18:18.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
fedora-1  | 27-Feb-2025 13:18:18.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
fedora-1  | 27-Feb-2025 13:18:18.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
fedora-1  | 27-Feb-2025 13:18:18.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfcrepo.autoversioning.enabled=false
fedora-1  | 27-Feb-2025 13:18:18.661 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfcrepo.db.password=avalonfedoradb
fedora-1  | 27-Feb-2025 13:18:18.662 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfcrepo.db.user=fedora
fedora-1  | 27-Feb-2025 13:18:18.663 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfcrepo.db.url=jdbc:postgresql://db:5432/fcrepo_cache
fedora-1  | 27-Feb-2025 13:18:18.663 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfcrepo.home=/data
fedora-1  | 27-Feb-2025 13:18:18.663 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.EnvironmentPropertySource
fedora-1  | 27-Feb-2025 13:18:18.663 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=UTF-8
fedora-1  | 27-Feb-2025 13:18:18.663 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.tomcat.util.digester.REPLACE_SYSTEM_PROPERTIES=true
fedora-1  | 27-Feb-2025 13:18:18.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
fedora-1  | 27-Feb-2025 13:18:18.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
fedora-1  | 27-Feb-2025 13:18:18.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
fedora-1  | 27-Feb-2025 13:18:18.664 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
fedora-1  | 27-Feb-2025 13:18:18.667 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.3.1] using APR version [1.7.2].
fedora-1  | 27-Feb-2025 13:18:18.686 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true].
fedora-1  | 27-Feb-2025 13:18:18.687 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
fedora-1  | 27-Feb-2025 13:18:18.690 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 3.0.13 30 Jan 2024]
fedora-1  | 27-Feb-2025 13:18:20.183 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
fedora-1  | 27-Feb-2025 13:18:20.266 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [2779] milliseconds
fedora-1  | 27-Feb-2025 13:18:20.567 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
fedora-1  | 27-Feb-2025 13:18:20.601 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.98]
fedora-1  | 27-Feb-2025 13:18:20.625 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/fcrepo]
fedora-1  | 27-Feb-2025 13:18:38.584 WARNING [main] org.apache.catalina.startup.ContextConfig.validateSecurityRoles Security role name [fedoraUser] used in an <auth-constraint> without being defined in a <security-role>
fedora-1  | 27-Feb-2025 13:18:38.633 WARNING [main] org.apache.catalina.startup.ContextConfig.validateSecurityRoles Security role name [fedoraAdmin] used in an <auth-constraint> without being defined in a <security-role>
fedora-1  | 27-Feb-2025 13:18:38.984 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
fedora-1  | INFO 13:18:43.713 [main] (FedoraPropsConfig) Fedora is an open source project supported entirely by its users. To continue the on-going maintenance of the software and ensure Fedora is meeting the needs of the community, we are working to gather information on current installations. We strongly encourage all users to register their instance in the DuraSpace Community Supported Program Registry hosted by LYRASIS at https://fedora.lyrasis.org/register-your-site/
fedora-1  | INFO 13:18:43.715 [main] (FedoraPropsConfig) Fedora home: /data
fedora-1  | INFO 13:18:44.679 [main] (OcflPropsConfig) Fedora storage type: ocfl-fs
fedora-1  | INFO 13:18:44.679 [main] (OcflPropsConfig) Fedora staging: /data/data/staging
fedora-1  | INFO 13:18:44.680 [main] (OcflPropsConfig) Fedora OCFL temp: /data/data/ocfl-temp
fedora-1  | INFO 13:18:44.681 [main] (OcflPropsConfig) Fedora OCFL reindexing threads: 1
fedora-1  | INFO 13:18:44.681 [main] (OcflPropsConfig) Fedora OCFL reindexing batch size: 100
fedora-1  | INFO 13:18:44.682 [main] (OcflPropsConfig) Fedora OCFL reindexing fail on error: true
fedora-1  | INFO 13:18:44.682 [main] (OcflPropsConfig) Fedora OCFL root: /data/data/ocfl-root
fedora-1  | INFO 13:18:44.683 [main] (OcflPropsConfig) Fedora OCFL digest algorithm: SHA-512
fedora-1  | INFO 13:18:44.683 [main] (OcflPropsConfig) Fedora OCFL show path: false
fedora-1  | INFO 13:18:44.780 [main] (DatabaseConfig) JDBC URL: jdbc:postgresql://db:5432/fcrepo_cache
fedora-1  | INFO 13:18:44.780 [main] (DatabaseConfig) JDBC User: fedora
fedora-1  | INFO 13:18:44.780 [main] (DatabaseConfig) JDBC Password length: 14
fedora-1  | INFO 13:18:44.781 [main] (DatabaseConfig) Using database driver: org.postgresql.Driver
fedora-1  | INFO 13:18:46.353 [main] (JmsConfig) JMS messaging enabled
fedora-1  | INFO 13:18:46.457 [main] (AuthConfig) Auth delegate principal provider enabled
fedora-1  | INFO 13:18:47.680 [ScheduledTask1] (RepositoryInitializer) Initializing repository
fedora-1  | 27-Feb-2025 13:18:49.400 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/fcrepo] has finished in [28,774] ms
fedora-1  | 27-Feb-2025 13:18:49.404 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
fedora-1  | 27-Feb-2025 13:18:49.415 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [29108] milliseconds

@cjcolvar
Copy link
Member

Without anything in Avalon's log, I think it is possible that Avalon is connecting to the external Fedora but that it isn't apparent. You can see the config that Avalon is using by running:
docker-compose exec avalon /bin/bash -c "RAILS_ENV=production bundle exec rails r 'puts ActiveFedora.fedora.inspect'"

The output should look like:
#<ActiveFedora::Fedora:0x00007a15617ec340 @config={:user=>"user", :password=>"password", :base_path=>"/test", :url=>"http://localhost:8080/fcrepo/rest"}>

@jmcgranahan
Copy link
Author

@cjcolvar Running that command I get the following output:

#<ActiveFedora::Fedora:0x00007faa0dd41e58 @config={:user=>"test", :password=>"test", :base_path=>"", :url=>"http://10.55.58.175:8080/rest"}>

Should there be something for "base_path"? Also, if it was connecting to our Fedora instance, shouldn't it be pulling in our collections? We did setup the FEDORA_NAMESPACE to a single namespace that we know is in our Fedora instance, yet we're not seeing any of its content in Avalon.

@cjcolvar
Copy link
Member

cjcolvar commented Mar 4, 2025

base_path gets appended to the url to form the base url that avalon will work with. As your config is now Avalon will work with http://10.55.58.175:8080/rest. I'm not sure if FEDORA_NAMESPACE does anything now. What do you have it set to? I'd try setting it as the base_path and see if that helps.

@jmcgranahan
Copy link
Author

@cjcolvar - here's our docker-compose.yml file. Maybe you can spot something that is out of whack:

volumes:
  streaming:
  database:
  fedora:
  solr:

services:
  db:
    image: postgres:14-alpine
    volumes:
      - ./db/init-db:/docker-entrypoint-initdb.d
      - ./db_data:/data
    environment:
      - AVALON_DB_PASSWORD
      - FEDORA_DB_PASSWORD
      - PGDATA=/data
      - POSTGRES_USER=postgres
      - POSTGRES_HOST_AUTH_METHOD=trust
  fedora:
    image: fcrepo/fcrepo:6-tomcat9
    environment:
      - FEDORA_DB_PASSWORD
      - CATALINA_OPTS=-Dfcrepo.autoversioning.enabled=false -Dfcrepo.db.password=${FEDORA_DB_PASSWORD} -Dfcrepo.db.user=fedora -Dfcrepo.db.url=jdbc:postgresql://db:5432/fcrepo_cache -Dfcrepo.home=/data
    depends_on:
      - db
    volumes:
      - ./fedora_data:/data
  solr:
    image: solr:9
    volumes:
      - ./solr/conf:/opt/solr/avalon_conf
      - ./solr_data:/var/solr
    command:
      - solr-precreate
      - avalon
      - /opt/solr/avalon_conf
    environment:
      - SOLR_MODULES=analysis-extras,extraction
  hls:
    image: avalonmediasystem/nginx
    build:
      context: ./nginx
    environment:
      AVALON_DOMAIN: http://avalon:3000
    volumes:
      - streaming:/data
      - ./nginx/nginx.conf.template:/etc/nginx/nginx.conf.template
    ports:
       - "8880:80"
  redis:
    image: redis:alpine
  avalon: &avalon
    image: avalonmediasystem/avalon:8
    build:
      context: https://github.com/avalonmediasystem/avalon.git#v8.0
      target: prod
    command: bash -c "bundle exec rake db:migrate && bundle exec rails server -b 0.0.0.0"
    depends_on:
      - db
      - fedora
      - solr
      - redis
      - hls
    environment:
      - APP_NAME
      - SECRET_KEY_BASE
      - ASSET_HOST
      - SETTINGS__DOMAIN
      - DATABASE_URL=postgres://avalon:${AVALON_DB_PASSWORD}@db/avalon
      - SETTINGS__DROPBOX__PATH=/masterfiles/dropbox
      - SETTINGS__DROPBOX__UPLOAD_URI=./masterfiles/dropbox
      - SETTINGS__ENCODING__WORKING_FILE_PATH=/masterfiles
      - SETTINGS__EMAIL__COMMENTS
      - SETTINGS__EMAIL__NOTIFICATION
      - SETTINGS__EMAIL__SUPPORT
      - ENCODE_WORK_DIR=/streamfiles
      - FEDORA_BASE_PATH
      - FEDORA_NAMESPACE=essss
      - FEDORA_URL=http://test:test@10.55.58.175:8080/rest
      - SETTINGS__FFMPEG__PATH=/usr/bin/ffmpeg
      - MASTER_FILE_PATH
      - SETTINGS__MASTER_FILE_MANAGEMENT__STRATEGY=delete
      - MATTERHORN_URL=http://matterhorn_system_account:CHANGE_ME@matterhorn:8080/
      - MEDIAINFO_PATH=/usr/bin/mediainfo
      - RAILS_ADDITIONAL_HOSTS=avalon
      - RAILS_ENV=production
      - RAILS_LOG_TO_STDOUT=true
      - RAILS_SERVE_STATIC_FILES=true
      - SETTINGS__REDIS__HOST=redis
      - SETTINGS__REDIS__PORT=6379
      - SMTP_ADDRESS
      - SMTP_AUTHENTICATION
      - SETTINGS__STREAMING__STREAM_TOKEN_TTL=20
      - SMTP_DOMAIN
      - SMTP_ENABLE_STARTTLS_AUTO
      - SMTP_OPENSSL_VERIFY_MODE
      - SMTP_PASSWORD
      - SMTP_PORT
      - SMTP_USER_NAME
      - SOLR_URL=http://solr:8983/solr/avalon
      - SETTINGS__STREAMING__CONTENT_PATH=/streamfiles
      - SETTINGS__STREAMING__HTTP_BASE=http://${STREAMING_HOST}:8880/avalon
      - SETTINGS__STREAMING__SERVER=nginx
      - SYSTEM_GROUPS=administrator,group_manager,manager
      - Z3950_ATTRIBUTE
      - Z3950_DATABASE
      - Z3950_HOST
      - Z3950_PORT
    volumes:
      - ./masterfiles:/masterfiles
      - ./storage:/home/app/avalon/storage #Config another location in storage.yml
      - streaming:/streamfiles
    ports:
      - "80:3000"
  worker:
    <<: *avalon
    command: bundle exec sidekiq -C config/sidekiq.yml
    ports: []

@cjcolvar
Copy link
Member

cjcolvar commented Mar 4, 2025

Try changing this line in your docker-compose.yml and restart.

- FEDORA_BASE_PATH=essss

@jmcgranahan
Copy link
Author

Before we continue beating this to a pulp here, is there anyway I can confirm Fedora connection within the Avalon app? Just launching the app (which I can access) I just have a blank slate so I would assume it is not finding our Fedora collections but I just am not sure.

docker exec avalon-docker2-avalon-1 /bin/bash -c "RAILS_ENV=production bundle exec rails r 'puts ActiveFedora.fedora.inspect'"

#<ActiveFedora::Fedora:0x00007fbca45abe10 @config={:user=>"test", :password=>"test", :base_path=>"essss", :url=>"http://10.55.58.175:8080/rest/"}>

@cjcolvar
Copy link
Member

cjcolvar commented Mar 4, 2025

Is there Avalon content in your Fedora? If you know of a particular item by id then you could test if avalon is able to load it as a generic object from the rails console as a first step.

docker exec avalon-docker2-avalon-1 /bin/bash -c "RAILS_ENV=production bundle exec rails r 'puts ActiveFedora::Base.find(\"id\").uri' "

For instance for a test system I have with this fedora config:

#<ActiveFedora::Fedora:0x00007fd1dc9d84a0 @config={:user=>"fedoraAdmin", :password=>"fedoraAdmin", :base_path=>"", :url=>"http://localhost:8080/fcrepo/rest"}>

and an item with avalon url of https://localhost:3000/media_objects/g158bh28p I get the following:

docker exec avalon /bin/bash -c "RAILS_ENV=production bundle exec rails r 'puts ActiveFedora::Base.find(\"g158bh28p\").uri'"

http://localhost:8080/fcrepo/rest/g1/58/bh/28/g158bh28p

@jmcgranahan
Copy link
Author

Looks like I'm getting a 500 error when running that rails command.

[root@ip-10-55-58-198 avalon-docker2]# docker exec avalon-docker2-avalon-1 /bin/bash -c "RAILS_ENV=production bundle exec rails r 'puts ActiveFedora::Base.find(\"id\").uri' "
/usr/local/bundle/gems/ldp-1.1.0/lib/ldp/client/methods.rb:119:in `block in check_for_errors': STATUS: 500 ... (Ldp::HttpError)
        from <internal:kernel>:90:in `tap'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp/client/methods.rb:117:in `check_for_errors'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp/client/methods.rb:96:in `block in put'
        from /usr/local/bundle/gems/activesupport-7.2.2/lib/active_support/notifications.rb:212:in `instrument'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp.rb:43:in `instrument'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp/client/methods.rb:88:in `put'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/caching_connection.rb:24:in `put'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/initializing_connection.rb:61:in `rescue in init_base_path'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/initializing_connection.rb:53:in `init_base_path'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/initializing_connection.rb:21:in `head'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp/resource.rb:59:in `head'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp/resource.rb:42:in `new?'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/relation/finder_methods.rb:180:in `load_from_fedora'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/relation/finder_methods.rb:167:in `find_one'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/relation/finder_methods.rb:212:in `find_with_ids'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/relation/finder_methods.rb:48:in `find'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/querying.rb:3:in `find'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands/runner/runner_command.rb:49:in `<main>'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands/runner/runner_command.rb:49:in `eval'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands/runner/runner_command.rb:49:in `block in perform'
        from /usr/local/bundle/gems/activesupport-7.2.2/lib/active_support/execution_wrapper.rb:91:in `wrap'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands/runner/runner_command.rb:70:in `conditional_executor'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands/runner/runner_command.rb:48:in `perform'
        from /usr/local/bundle/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
        from /usr/local/bundle/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/command/base.rb:178:in `invoke_command'
        from /usr/local/bundle/gems/thor-1.3.2/lib/thor.rb:538:in `dispatch'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/command/base.rb:73:in `perform'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/command.rb:71:in `block in invoke'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/command.rb:149:in `with_argv'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/command.rb:69:in `invoke'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands.rb:18:in `<main>'
        from /usr/local/bundle/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /usr/local/bundle/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from bin/rails:4:in `<main>'
/usr/local/bundle/gems/ldp-1.1.0/lib/ldp/client/methods.rb:119:in `block in check_for_errors': Ldp::NotFound
        from <internal:kernel>:90:in `tap'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp/client/methods.rb:117:in `check_for_errors'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp/client/methods.rb:25:in `block in head'
        from /usr/local/bundle/gems/activesupport-7.2.2/lib/active_support/notifications.rb:212:in `instrument'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp.rb:43:in `instrument'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp/client/methods.rb:17:in `head'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/initializing_connection.rb:56:in `init_base_path'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/initializing_connection.rb:21:in `head'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp/resource.rb:59:in `head'
        from /usr/local/bundle/gems/ldp-1.1.0/lib/ldp/resource.rb:42:in `new?'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/relation/finder_methods.rb:180:in `load_from_fedora'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/relation/finder_methods.rb:167:in `find_one'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/relation/finder_methods.rb:212:in `find_with_ids'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/relation/finder_methods.rb:48:in `find'
        from /usr/local/bundle/bundler/gems/active_fedora-0f5ccb153622/lib/active_fedora/querying.rb:3:in `find'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands/runner/runner_command.rb:49:in `<main>'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands/runner/runner_command.rb:49:in `eval'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands/runner/runner_command.rb:49:in `block in perform'
        from /usr/local/bundle/gems/activesupport-7.2.2/lib/active_support/execution_wrapper.rb:91:in `wrap'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands/runner/runner_command.rb:70:in `conditional_executor'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands/runner/runner_command.rb:48:in `perform'
        from /usr/local/bundle/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
        from /usr/local/bundle/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/command/base.rb:178:in `invoke_command'
        from /usr/local/bundle/gems/thor-1.3.2/lib/thor.rb:538:in `dispatch'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/command/base.rb:73:in `perform'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/command.rb:71:in `block in invoke'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/command.rb:149:in `with_argv'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/command.rb:69:in `invoke'
        from /usr/local/bundle/gems/railties-7.2.2/lib/rails/commands.rb:18:in `<main>'
        from /usr/local/bundle/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /usr/local/bundle/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from bin/rails:4:in `<main>'
[root@ip-10-55-58-198 avalon-docker2]#

@jmcgranahan
Copy link
Author

I think there may be a misconception here. We were under the impression that Avalon could serve as the Front End for Fedora - so this statement, "Is there Avalon content in your Fedora?", wouldn't apply - it's all Fedora data @cjcolvar

Image

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

2 participants