Skip to content

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

@ghadgeabhi

Description

@ghadgeabhi

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions