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

Mac: dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib #278

Closed
imochurad opened this issue Jul 29, 2019 · 7 comments
Closed
Labels
helpwanted high Mac Anything specific only to Mac, not affecting Linux

Comments

@imochurad
Copy link

I've been following this tutorial (https://objectpartners.com/2017/06/19/using-mariadb4j-for-a-spring-boot-embedded-database/) in order to configure my embedded MariaDB and, unfortunately, it fails:

2019-07-29 14:12:54.218  INFO [] 23801 --- [ost-startStop-1] ch.vorburger.mariadb4j.Util              : Created directory: /var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/data/55603
2019-07-29 14:12:54.221  INFO [] 23801 --- [ost-startStop-1] ch.vorburger.mariadb4j.Util              : chmod +x requested on non-existing file: /var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/scripts/mysql_install_db
2019-07-29 14:12:54.222  INFO [] 23801 --- [ost-startStop-1] ch.vorburger.mariadb4j.DB                : Installing a new embedded database to: /var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base
2019-07-29 14:12:54.222  INFO [] 23801 --- [ost-startStop-1] ch.vorburger.exec.ManagedProcess         : Starting Program [/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/mysql_install_db, --datadir=/private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/data/55603, --basedir=/private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base, --no-defaults, --force, --skip-name-resolve] (in working directory /var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base)
2019-07-29 14:12:54.236  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
2019-07-29 14:12:54.237  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:   Referenced from: /private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/my_print_defaults
2019-07-29 14:12:54.237  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:   Reason: image not found
2019-07-29 14:12:54.268  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: Installing MariaDB/MySQL system tables in '/private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/data/55603' ...
2019-07-29 14:12:54.272  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
2019-07-29 14:12:54.272  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:   Referenced from: /private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/mysqld
2019-07-29 14:12:54.272  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:   Reason: image not found
2019-07-29 14:12:54.272  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: /var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/mysql_install_db: line 454: 23949 Abort trap: 6           "$mysqld_bootstrap" $defaults "$mysqld_opt" --bootstrap $silent_startup "--basedir=$basedir" "--datadir=$ldata" --log-warnings=0 --enforce-storage-engine="" $args --max_allowed_packet=8M --net_buffer_length=16K
2019-07-29 14:12:54.274  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:
2019-07-29 14:12:54.274  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: Installation of system tables failed!  Examine the logs in
2019-07-29 14:12:54.274  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: /private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/data/55603 for more information.
2019-07-29 14:12:54.274  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:
2019-07-29 14:12:54.274  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: The problem could be conflicting information in an external
2019-07-29 14:12:54.274  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: my.cnf files. You can ignore these by doing:
2019-07-29 14:12:54.274  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:
2019-07-29 14:12:54.274  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:     shell> /var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/mysql_install_db --defaults-file=~/.my.cnf
2019-07-29 14:12:54.275  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:
2019-07-29 14:12:54.275  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: You can also try to start the mysqld daemon with:
2019-07-29 14:12:54.275  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:     shell> /private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/mysqld --skip-grant --general-log &
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: and use the command line tool /private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/mysql
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: to connect to the mysql database and look at the grant tables:
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:     shell> /private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/mysql -u root mysql
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:     mysql> show tables;
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: Try 'mysqld --help' if you have problems with paths.  Using
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: --general-log gives you a log in /private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/data/55603 that may be helpful.
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: The latest information about mysql_install_db is available at
2019-07-29 14:12:54.276  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
2019-07-29 14:12:54.277  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: MariaDB is hosted on launchpad; You can find the latest source and
2019-07-29 14:12:54.277  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: email lists at http://launchpad.net/maria
2019-07-29 14:12:54.277  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:
2019-07-29 14:12:54.277  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: Please check all of the above before submitting a bug report
2019-07-29 14:12:54.277  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: at http://mariadb.org/jira
2019-07-29 14:12:54.277  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:
2019-07-29 14:12:54.278 ERROR [] 23801 --- [efault Executor] c.v.exec.LoggingExecuteResultHandler     : Program [/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/mysql_install_db, --datadir=/private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/data/55603, --basedir=/private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base, --no-defaults, --force, --skip-name-resolve] (in working directory /var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base) failed unexpectedly

org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.access$200(DefaultExecutor.java:48)
	at org.apache.commons.exec.DefaultExecutor$1.run(DefaultExecutor.java:200)
	at java.lang.Thread.run(Thread.java:748)

Could you please help me understand the stack trace? Thanks!

@imochurad
Copy link
Author

Here are my application-TEST.properties:

spring.jpa.show-sql=false
spring.jpa.properties.hibernate.type=trace
spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
mariaDB4j.dataDir=
mariaDB4j.port=0
spring.jpa.hibernate.ddl-auto=create

And this is the config class:

import ch.vorburger.mariadb4j.DBConfigurationBuilder;
import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration
class EmbeddedMariaDbConfig {

    @Bean
    public MariaDB4jSpringService mariaDB4jSpringService() {
        return new MariaDB4jSpringService();
    }

    @Bean
    public DataSource dataSource(MariaDB4jSpringService mariaDB4jSpringService,
                                 @Value("${app.mariaDB4j.databaseName}") String databaseName,
                                 @Value("${spring.datasource.username}") String datasourceUsername,
                                 @Value("${spring.datasource.password}") String datasourcePassword,
                                 @Value("${spring.datasource.driver-class-name}") String datasourceDriver) throws Exception {
        //Create our database with default root user and no password
        mariaDB4jSpringService.getDB().createDB(databaseName);

        DBConfigurationBuilder config = mariaDB4jSpringService.getConfiguration();

        return DataSourceBuilder
                .create()
                .username(datasourceUsername)
                .password(datasourcePassword)
                .url(config.getURL(databaseName))
                .driverClassName(datasourceDriver)
                .build();
    }
}

@imochurad
Copy link
Author

Please let me know if additional information is required. Thanks in advance!

@imochurad
Copy link
Author

@vorburger do I need to install binaries before using a DB in embedded mode?

@vorburger vorburger added Mac Anything specific only to Mac, not affecting Linux helpwanted high labels Sep 1, 2019
@vorburger
Copy link
Collaborator

@vorburger do I need to install binaries before using a DB in embedded mode?

Nope, you don't have... but this is some Mac specific issue, note this:

Starting Program [/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/mysql_install_db, --datadir=/private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/data/55603, --basedir=/private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base, --no-defaults, --force, --skip-name-resolve] (in working directory /var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base)
2019-07-29 14:12:54.236  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
2019-07-29 14:12:54.237  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:   Referenced from: /private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/my_print_defaults
2019-07-29 14:12:54.237  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:   Reason: image not found
2019-07-29 14:12:54.268  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: Installing MariaDB/MySQL system tables in '/private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/data/55603' ...
2019-07-29 14:12:54.272  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
2019-07-29 14:12:54.272  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:   Referenced from: /private/var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/mysqld
2019-07-29 14:12:54.272  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db:   Reason: image not found
2019-07-29 14:12:54.272  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysql_install_db: /var/folders/38/gb1knkfj1t9glj45z0sng6tmd1xc6_/T/MariaDB4j/base/bin/mysql_install_db: line 454: 23949 Abort trap: 6           "$mysqld_bootstrap" $defaults "$mysqld_opt" --bootstrap $silent_startup "--basedir=$basedir" "--datadir=$ldata" --log-warnings=0 --enforce-storage-engine="" $args --max_allowed_packet=8M --net_buffer_length=16K
2019-07-29 14:12:54.274  INFO [] 23801 --- [c Stream Pumper] ch.vorburger.exec.ManagedProcess         : mysq

Perhaps other Mac users reading this can help with this? Note also #288...

@vorburger vorburger changed the title Unable to configure MariaDB4j to work in an embedded mode Mac: dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Sep 1, 2019
@vorburger
Copy link
Collaborator

Closing this as a duplicate of #48.

@ari62
Copy link

ari62 commented Jan 2, 2022

For those with a new macbook pro 2021 with M1 , check out my comment here:
aisingapore/TagUI#635 (comment)

@vorburger
Copy link
Collaborator

For those with a new macbook pro 2021 with M1

see #497 for M1 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
helpwanted high Mac Anything specific only to Mac, not affecting Linux
Projects
None yet
Development

No branches or pull requests

3 participants