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

Getting segmentation fault when creating using storage() function #60

Open
ghadgeabhi opened this issue Jul 23, 2024 · 0 comments
Open

Comments

@ghadgeabhi
Copy link

Following all the steps that have been included in the tutorial, I am getting a segmentation fault error when I try to use the storage() function.

This is my code :

using GoogleCloud
creds = JSONCredentials("./credentials.json")
session = GoogleSession(creds, ["devstorage.full_control"])
function upload_to_gcs(bucket_name::String, object_name::String, destination_path::String)
    try
        set_session!(storage, session)

        file_contents = read(open(destination_path, "r"), String);
        # Upload

        storage(:Object, :insert, bucket_name;     # Returns metadata about the object
            name=object_name,           # Object name is "image.jpg"
            data=file_contents,         # The data being stored on your project
        )
        @info "File uploaded successfully $destination_path"

    catch err
        @error "Something went wrong" exception=(err, catch_backtrace())
    end
end

upload_to_gcs("folder", "file.jpg", "file.jpg")

Has anyone encountered this? if so what was the fix?

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

1 participant